diff options
author | Bart Polot <bart@net.in.tum.de> | 2015-04-27 19:14:57 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2015-04-27 19:14:57 +0000 |
commit | 83b3842ed5fd67d0ad3c0abdf5a608ca70a485a9 (patch) | |
tree | 55f28b1e7fa162e0ffe8592799c6d73b223f4c41 /src/cadet/gnunet-service-cadet_peer.h | |
parent | 631731a9fd4372553be5b32a67855d17ea57fbae (diff) | |
download | gnunet-83b3842ed5fd67d0ad3c0abdf5a608ca70a485a9.tar.gz gnunet-83b3842ed5fd67d0ad3c0abdf5a608ca70a485a9.zip |
- add ECDH key caching and verifying
Diffstat (limited to 'src/cadet/gnunet-service-cadet_peer.h')
-rw-r--r-- | src/cadet/gnunet-service-cadet_peer.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/cadet/gnunet-service-cadet_peer.h b/src/cadet/gnunet-service-cadet_peer.h index a0211328b..53a26b2e9 100644 --- a/src/cadet/gnunet-service-cadet_peer.h +++ b/src/cadet/gnunet-service-cadet_peer.h | |||
@@ -390,6 +390,25 @@ void | |||
390 | GCP_try_connect (struct CadetPeer *peer); | 390 | GCP_try_connect (struct CadetPeer *peer); |
391 | 391 | ||
392 | /** | 392 | /** |
393 | * Check if the given ECDH key is correct for the peer. | ||
394 | * | ||
395 | * This function caches the results if the key has been previoulsy checked, | ||
396 | * otherwise checks that the key is signed with the peer's ID (EdDSA key). | ||
397 | * | ||
398 | * TODO: save the cached public key to permanent storage / peerinfo. | ||
399 | * | ||
400 | * @param peer Peer whose key to check. | ||
401 | * @param key ECDH key to check. | ||
402 | * @param purpose Purpose of the signature (followed by the key). | ||
403 | * @param sig Signature with the peer's EdDSA key (PeerID). | ||
404 | */ | ||
405 | int | ||
406 | GCP_check_key (struct CadetPeer *peer, | ||
407 | const struct GNUNET_CRYPTO_EcdhePublicKey *key, | ||
408 | const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, | ||
409 | const struct GNUNET_CRYPTO_EddsaSignature *sig); | ||
410 | |||
411 | /** | ||
393 | * Notify a peer that a link between two other peers is broken. If any path | 412 | * Notify a peer that a link between two other peers is broken. If any path |
394 | * used that link, eliminate it. | 413 | * used that link, eliminate it. |
395 | * | 414 | * |