diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2023-06-28 22:43:49 +0200 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2023-06-28 22:43:49 +0200 |
commit | 40b9351a334b6f1ef0a9d088394c278ea4908c96 (patch) | |
tree | e0880c73f59c141a907b0293e9a18f03525d5a6b /src/gnsrecord | |
parent | 7011143dc4a04272c8d7a7744e8e674509b1c727 (diff) | |
download | gnunet-40b9351a334b6f1ef0a9d088394c278ea4908c96.tar.gz gnunet-40b9351a334b6f1ef0a9d088394c278ea4908c96.zip |
GNS: Fix hash for storage key to include zone type as specified in
LSD0001.
Diffstat (limited to 'src/gnsrecord')
-rw-r--r-- | src/gnsrecord/gnsrecord_crypto.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gnsrecord/gnsrecord_crypto.c b/src/gnsrecord/gnsrecord_crypto.c index e6036b72b..eaa36426c 100644 --- a/src/gnsrecord/gnsrecord_crypto.c +++ b/src/gnsrecord/gnsrecord_crypto.c | |||
@@ -195,6 +195,7 @@ block_get_size_ecdsa (const struct GNUNET_GNSRECORD_Data *rd, | |||
195 | return len; | 195 | return len; |
196 | } | 196 | } |
197 | 197 | ||
198 | |||
198 | enum GNUNET_GenericReturnValue | 199 | enum GNUNET_GenericReturnValue |
199 | block_sign_ecdsa (const struct | 200 | block_sign_ecdsa (const struct |
200 | GNUNET_CRYPTO_EcdsaPrivateKey *key, | 201 | GNUNET_CRYPTO_EcdsaPrivateKey *key, |
@@ -400,6 +401,7 @@ block_create_ecdsa (const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, | |||
400 | return GNUNET_OK; | 401 | return GNUNET_OK; |
401 | } | 402 | } |
402 | 403 | ||
404 | |||
403 | static ssize_t | 405 | static ssize_t |
404 | block_get_size_eddsa (const struct GNUNET_GNSRECORD_Data *rd, | 406 | block_get_size_eddsa (const struct GNUNET_GNSRECORD_Data *rd, |
405 | unsigned int rd_count) | 407 | unsigned int rd_count) |
@@ -505,6 +507,7 @@ block_create_eddsa (const struct GNUNET_CRYPTO_EddsaPrivateKey *key, | |||
505 | return GNUNET_OK; | 507 | return GNUNET_OK; |
506 | } | 508 | } |
507 | 509 | ||
510 | |||
508 | ssize_t | 511 | ssize_t |
509 | GNUNET_GNSRECORD_block_calculate_size (const struct | 512 | GNUNET_GNSRECORD_block_calculate_size (const struct |
510 | GNUNET_IDENTITY_PrivateKey *key, | 513 | GNUNET_IDENTITY_PrivateKey *key, |
@@ -531,6 +534,7 @@ GNUNET_GNSRECORD_block_calculate_size (const struct | |||
531 | 534 | ||
532 | } | 535 | } |
533 | 536 | ||
537 | |||
534 | enum GNUNET_GenericReturnValue | 538 | enum GNUNET_GenericReturnValue |
535 | GNUNET_GNSRECORD_block_create (const struct GNUNET_IDENTITY_PrivateKey *key, | 539 | GNUNET_GNSRECORD_block_create (const struct GNUNET_IDENTITY_PrivateKey *key, |
536 | struct GNUNET_TIME_Absolute expire, | 540 | struct GNUNET_TIME_Absolute expire, |
@@ -655,7 +659,6 @@ block_create2 (const struct GNUNET_IDENTITY_PrivateKey *pkey, | |||
655 | } | 659 | } |
656 | 660 | ||
657 | 661 | ||
658 | |||
659 | enum GNUNET_GenericReturnValue | 662 | enum GNUNET_GenericReturnValue |
660 | GNUNET_GNSRECORD_block_create_unsigned (const struct | 663 | GNUNET_GNSRECORD_block_create_unsigned (const struct |
661 | GNUNET_IDENTITY_PrivateKey *pkey, | 664 | GNUNET_IDENTITY_PrivateKey *pkey, |
@@ -669,7 +672,6 @@ GNUNET_GNSRECORD_block_create_unsigned (const struct | |||
669 | } | 672 | } |
670 | 673 | ||
671 | 674 | ||
672 | |||
673 | enum GNUNET_GenericReturnValue | 675 | enum GNUNET_GenericReturnValue |
674 | GNUNET_GNSRECORD_block_create2 (const struct GNUNET_IDENTITY_PrivateKey *pkey, | 676 | GNUNET_GNSRECORD_block_create2 (const struct GNUNET_IDENTITY_PrivateKey *pkey, |
675 | struct GNUNET_TIME_Absolute expire, | 677 | struct GNUNET_TIME_Absolute expire, |
@@ -681,6 +683,7 @@ GNUNET_GNSRECORD_block_create2 (const struct GNUNET_IDENTITY_PrivateKey *pkey, | |||
681 | return block_create2 (pkey, expire, label, rd, rd_count, result, GNUNET_YES); | 683 | return block_create2 (pkey, expire, label, rd, rd_count, result, GNUNET_YES); |
682 | } | 684 | } |
683 | 685 | ||
686 | |||
684 | /** | 687 | /** |
685 | * Check if a signature is valid. This API is used by the GNS Block | 688 | * Check if a signature is valid. This API is used by the GNS Block |
686 | * to validate signatures received from the network. | 689 | * to validate signatures received from the network. |
@@ -1064,8 +1067,8 @@ GNUNET_GNSRECORD_query_from_public_key (const struct | |||
1064 | norm_label, | 1067 | norm_label, |
1065 | "gns", | 1068 | "gns", |
1066 | &pd.ecdsa_key); | 1069 | &pd.ecdsa_key); |
1067 | GNUNET_CRYPTO_hash (&pd.ecdsa_key, | 1070 | GNUNET_CRYPTO_hash (&pd, |
1068 | sizeof (pd.ecdsa_key), | 1071 | GNUNET_IDENTITY_public_key_get_length (&pd), |
1069 | query); | 1072 | query); |
1070 | break; | 1073 | break; |
1071 | case GNUNET_GNSRECORD_TYPE_EDKEY: | 1074 | case GNUNET_GNSRECORD_TYPE_EDKEY: |
@@ -1075,7 +1078,7 @@ GNUNET_GNSRECORD_query_from_public_key (const struct | |||
1075 | "gns", | 1078 | "gns", |
1076 | &(pd.eddsa_key)); | 1079 | &(pd.eddsa_key)); |
1077 | GNUNET_CRYPTO_hash (&pd.eddsa_key, | 1080 | GNUNET_CRYPTO_hash (&pd.eddsa_key, |
1078 | sizeof (pd.eddsa_key), | 1081 | GNUNET_IDENTITY_public_key_get_length (&pd), |
1079 | query); | 1082 | query); |
1080 | break; | 1083 | break; |
1081 | default: | 1084 | default: |