summaryrefslogtreecommitdiffstats
path: root/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-04-24 03:33:09 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-04-24 03:33:09 +0200
commite8296fbc9f88154830a68a0a7d53aa38f93cbd66 (patch)
tree9484285e61f9b68073295f025f885939772e66dd /src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
parent4872dd03e73aac434d735782417e40ca33336dac (diff)
downloadfastd-e8296fbc9f88154830a68a0a7d53aa38f93cbd66.tar
fastd-e8296fbc9f88154830a68a0a7d53aa38f93cbd66.zip
ec25519-fhmqvc: use PUBLICKEYBYTES and SECRETKEYBYTES defines more
Diffstat (limited to 'src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c')
-rw-r--r--src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c b/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
index 9d32f3b..ec19da3 100644
--- a/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
+++ b/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c
@@ -31,7 +31,7 @@ static inline bool read_key(uint8_t key[32], const char *hexkey) {
if ((strlen(hexkey) != 64) || (strspn(hexkey, "0123456789abcdefABCDEF") != 64))
return false;
- int i;
+ size_t i;
for (i = 0; i < 32; i++)
sscanf(&hexkey[2*i], "%02hhx", &key[i]);
@@ -92,7 +92,7 @@ static void protocol_peer_configure(fastd_peer_config_t *peer_conf) {
peer_conf->protocol_config = malloc(sizeof(fastd_protocol_peer_config_t));
peer_conf->protocol_config->public_key = key;
- if (memcmp(&peer_conf->protocol_config->public_key, &conf.protocol_config->key.public, 32) == 0)
+ if (memcmp(&peer_conf->protocol_config->public_key, &conf.protocol_config->key.public, PUBLICKEYBYTES) == 0)
pr_debug("found own key as `%s', ignoring peer", peer_conf->name);
}