From dba32dc385bf922c7cd91eecc209e1a37b96c137 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Wed, 14 Oct 2020 23:57:25 +0200 Subject: - more fixes towards crypto agility --- src/gnsrecord/gnsrecord_misc.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/gnsrecord/gnsrecord_misc.c') diff --git a/src/gnsrecord/gnsrecord_misc.c b/src/gnsrecord/gnsrecord_misc.c index baf13e963..cfe310422 100644 --- a/src/gnsrecord/gnsrecord_misc.c +++ b/src/gnsrecord/gnsrecord_misc.c @@ -325,5 +325,22 @@ GNUNET_GNSRECORD_query_from_block (const struct GNUNET_GNSRECORD_Block *block, } +enum GNUNET_GenericReturnValue +GNUNET_GNSRECORD_record_to_identity_key (const struct GNUNET_GNSRECORD_Data *rd, + struct GNUNET_IDENTITY_PublicKey *key) +{ + switch (ntohl (rd->record_type)) + { + case GNUNET_GNSRECORD_TYPE_PKEY: + key->type = htonl (rd->record_type); + memcpy (&key->ecdsa_key, rd->data, sizeof (key->ecdsa_key)); + return GNUNET_OK; + default: + return GNUNET_SYSERR; + } + return GNUNET_SYSERR; + + +} /* end of gnsrecord_misc.c */ -- cgit v1.2.3