summaryrefslogtreecommitdiffstats
path: root/src/protocols/ec25519_fhmqvc/util.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-04-20 04:36:34 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-04-20 04:36:34 +0200
commitb9c8603931203f5d94091f7a05a5967304b62fbd (patch)
treeb10ed1db8d2a34561f0f50488af73d820ecae019 /src/protocols/ec25519_fhmqvc/util.c
parentab4ca17ba3dfc92932834b09afc83cf7fe002a14 (diff)
downloadfastd-b9c8603931203f5d94091f7a05a5967304b62fbd.tar
fastd-b9c8603931203f5d94091f7a05a5967304b62fbd.zip
Make conf global
Diffstat (limited to 'src/protocols/ec25519_fhmqvc/util.c')
-rw-r--r--src/protocols/ec25519_fhmqvc/util.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/protocols/ec25519_fhmqvc/util.c b/src/protocols/ec25519_fhmqvc/util.c
index 3e1bafd..a72ebbf 100644
--- a/src/protocols/ec25519_fhmqvc/util.c
+++ b/src/protocols/ec25519_fhmqvc/util.c
@@ -38,7 +38,7 @@ void fastd_protocol_ec25519_fhmqvc_generate_key(fastd_context_t *ctx) {
ecc_int256_t secret_key;
ecc_int256_t public_key;
- if (!ctx->conf->machine_readable)
+ if (!conf.machine_readable)
pr_info(ctx, "Reading 32 bytes from /dev/random...");
fastd_random_bytes(ctx, secret_key.p, 32, true);
@@ -48,7 +48,7 @@ void fastd_protocol_ec25519_fhmqvc_generate_key(fastd_context_t *ctx) {
ecc_25519_scalarmult_base(&work, &secret_key);
ecc_25519_store_packed(&public_key, &work);
- if (ctx->conf->machine_readable) {
+ if (conf.machine_readable) {
print_hexdump("", secret_key.p);
}
else {
@@ -57,17 +57,17 @@ void fastd_protocol_ec25519_fhmqvc_generate_key(fastd_context_t *ctx) {
}
}
-void fastd_protocol_ec25519_fhmqvc_show_key(fastd_context_t *ctx) {
- if (ctx->conf->machine_readable)
- print_hexdump("", ctx->conf->protocol_config->key.public.u8);
+void fastd_protocol_ec25519_fhmqvc_show_key(void) {
+ if (conf.machine_readable)
+ print_hexdump("", conf.protocol_config->key.public.u8);
else
- print_hexdump("Public: ", ctx->conf->protocol_config->key.public.u8);
+ print_hexdump("Public: ", conf.protocol_config->key.public.u8);
}
-void fastd_protocol_ec25519_fhmqvc_set_shell_env(fastd_context_t *ctx, const fastd_peer_t *peer) {
+void fastd_protocol_ec25519_fhmqvc_set_shell_env(const fastd_peer_t *peer) {
char buf[65];
- hexdump(buf, ctx->conf->protocol_config->key.public.u8);
+ hexdump(buf, conf.protocol_config->key.public.u8);
setenv("LOCAL_KEY", buf, 1);
if (peer && peer->protocol_config) {