diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-04-24 03:33:09 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-04-24 03:33:09 +0200 |
commit | e8296fbc9f88154830a68a0a7d53aa38f93cbd66 (patch) | |
tree | 9484285e61f9b68073295f025f885939772e66dd /src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c | |
parent | 4872dd03e73aac434d735782417e40ca33336dac (diff) | |
download | fastd-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.c | 4 |
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); } |