From fb772645f6a082e37d5ee50a2bb45a6b239f3af0 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Mon, 27 Apr 2015 19:15:18 +0000 Subject: [PATCH] - add getter for peer's permanent ECDH key --- src/cadet/gnunet-service-cadet_peer.c | 15 +++++++++++++++ src/cadet/gnunet-service-cadet_peer.h | 10 ++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c index 1185091c6..de86c0502 100644 --- a/src/cadet/gnunet-service-cadet_peer.c +++ b/src/cadet/gnunet-service-cadet_peer.c @@ -2418,6 +2418,21 @@ GCP_check_key (struct CadetPeer *peer, } +/** + * Get the Identity ECDH key of the peer. + * + * @param peer Peer whose key to get. + * + * @return Peer's permanent ECDH key (might be all 0: unknown). + * + */ +struct GNUNET_CRYPTO_EcdhePublicKey * +GCP_get_ecdh_key (struct CadetPeer *peer) +{ + return &peer->ax_key; +} + + /** * Notify a peer that a link between two other peers is broken. If any path * used that link, eliminate it. diff --git a/src/cadet/gnunet-service-cadet_peer.h b/src/cadet/gnunet-service-cadet_peer.h index 53a26b2e9..298ef50e7 100644 --- a/src/cadet/gnunet-service-cadet_peer.h +++ b/src/cadet/gnunet-service-cadet_peer.h @@ -408,6 +408,16 @@ GCP_check_key (struct CadetPeer *peer, const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, const struct GNUNET_CRYPTO_EddsaSignature *sig); +/** + * Get the Identity ECDH key of the peer. + * + * @param peer Peer whose key to get. + * + * @return Peer's permanent ECDH key (might be all 0: unknown). + */ +struct GNUNET_CRYPTO_EddsaPublicKey * +GCP_get_key (struct CadetPeer *peer); + /** * Notify a peer that a link between two other peers is broken. If any path * used that link, eliminate it. -- 2.25.1