gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated: GNS: preparing protocol cha


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: GNS: preparing protocol change in GNS for v12
Date: Thu, 03 Oct 2019 18:58:01 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 8988b34f6 GNS: preparing protocol change in GNS for v12
8988b34f6 is described below

commit 8988b34f6df3e8e4f374b36d05c68272cdc2f504
Author: Schanzenbach, Martin <address@hidden>
AuthorDate: Thu Oct 3 18:55:47 2019 +0200

    GNS: preparing protocol change in GNS for v12
---
 src/gnsrecord/gnsrecord_crypto.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/gnsrecord/gnsrecord_crypto.c b/src/gnsrecord/gnsrecord_crypto.c
index 6eda1e962..d34be30c4 100644
--- a/src/gnsrecord/gnsrecord_crypto.c
+++ b/src/gnsrecord/gnsrecord_crypto.c
@@ -54,7 +54,23 @@ derive_block_aes_key(struct 
GNUNET_CRYPTO_SymmetricInitializationVector *iv,
 {
   static const char ctx_key[] = "gns-aes-ctx-key";
   static const char ctx_iv[] = "gns-aes-ctx-iv";
-
+/**
+ * Next time we break protocol (v12) we harmonize the KDF usage in GNS:
+ * We use the strings above as salt and the public key as IKM similar to
+ * how derive_h is done in crypto_ecc.c.
+ */
+#ifdef GNUNET_PROTOCOL_V12
+  GNUNET_CRYPTO_kdf(skey, sizeof(struct GNUNET_CRYPTO_SymmetricSessionKey),
+                    ctx_key, strlen(ctx_key),
+                    pub, sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey),
+                    label, strlen(label),
+                    NULL, 0);
+  GNUNET_CRYPTO_kdf(iv, sizeof(struct 
GNUNET_CRYPTO_SymmetricInitializationVector),
+                    ctx_iv, strlen(ctx_iv),
+                    pub, sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey),
+                    label, strlen(label),
+                    NULL, 0);
+#else
   GNUNET_CRYPTO_kdf(skey, sizeof(struct GNUNET_CRYPTO_SymmetricSessionKey),
                     pub, sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey),
                     label, strlen(label),
@@ -65,6 +81,7 @@ derive_block_aes_key(struct 
GNUNET_CRYPTO_SymmetricInitializationVector *iv,
                     label, strlen(label),
                     ctx_iv, strlen(ctx_iv),
                     NULL, 0);
+#endif
 }
 
 
@@ -454,7 +471,6 @@ GNUNET_GNSRECORD_query_from_public_key(const struct 
GNUNET_CRYPTO_EcdsaPublicKey
                                        struct GNUNET_HashCode *query)
 {
   struct GNUNET_CRYPTO_EcdsaPublicKey pd;
-
   GNUNET_CRYPTO_ecdsa_public_key_derive(pub,
                                         label,
                                         "gns",

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]