View Issue Details

IDProjectCategoryView StatusLast Update
0006783GNUnetutil librarypublic2023-02-06 05:20
Reporterthejackimonster Assigned Toschanzen  
PrioritylowSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.14.0 
Target Version0.19.3Fixed in Version0.19.3 
Summary0006783: anonymous key fails at ECDHE
DescriptionThe ECDHE fails using the anonymous key pair even if all tests with randomly generated ECDSA key pairs succeed. This could be an issue caused by the util library in GNUnet, a mixture of using gcrypt and libsodium together or even an issue inside of libsodium.
Steps To Reproduce// Get the anonymous ECDSA key pair
const struct GNUNET_CRYPTO_EcdsaPrivateKey* ecdsa_priv = GNUNET_CRYPTO_ecdsa_key_get_anonymous();
struct GNUNET_CRYPTO_EcdsaPublicKey ecdsa_pub;
GNUNET_CRYPTO_ecdsa_key_get_public(ecdsa_priv, &ecdsa_pub);

// Generate a random ECDHE key pair
struct GNUNET_CRYPTO_EcdhePrivateKey ecdhe_priv;
struct GNUNET_CRYPTO_EcdhePublicKey ecdhe_pub;
GNUNET_CRYPTO_ecdhe_key_create(&ecdhe_priv);
GNUNET_CRYPTO_ecdhe_key_get_public(&ecdhe_priv, &ecdhe_pub);

// Derive hashes from the keys
struct GNUNET_HashCode h1;
struct GNUNET_HashCode h2;
GNUNET_CRYPTO_ecdh_ecdsa(&ecdhe_priv, &ecdsa_pub, &h1);
GNUNET_CRYPTO_ecdsa_ecdh(ecdsa_priv, &ecdhe_pub, &h2);

// The hashes don't match..!
GNUNET_assert(GNUNET_CRYPTO_hash_cmp(&h1, &h2) == 0);
Additional InformationCurrently this is not a huge issue because ECDHE gets used only in the identity API to encrypt and decrypt data for a specific ego. So the result is that encrypting data for the anonymous ego will fail.

The functionality gets used by the messenger service but the service itself restricts encrypting messages to individually used egos (excluding the anonymous ego) in current state of development anyway.
Tagsbug

Activities

schanzen

2023-01-09 10:01

administrator   ~0019617

Is this still an issue?

thejackimonster

2023-01-09 20:27

developer   ~0019620

Seems to be fixed by now. I just tested it with the code to reproduce it but the hashes match.

schanzen

2023-02-06 05:20

administrator   ~0019754

v0.19.3 released

Issue History

Date Modified Username Field Change
2021-03-03 21:51 thejackimonster New Issue
2021-03-03 21:51 thejackimonster Tag Attached: bug
2023-01-09 10:01 schanzen Assigned To => schanzen
2023-01-09 10:01 schanzen Status new => feedback
2023-01-09 10:01 schanzen Note Added: 0019617
2023-01-09 10:02 schanzen Target Version => 0.19.3
2023-01-09 20:27 thejackimonster Note Added: 0019620
2023-01-09 20:27 thejackimonster Status feedback => assigned
2023-01-10 15:30 schanzen Status assigned => resolved
2023-01-10 15:30 schanzen Resolution open => fixed
2023-01-10 15:30 schanzen Fixed in Version => 0.19.3
2023-02-06 05:20 schanzen Note Added: 0019754
2023-02-06 05:20 schanzen Status resolved => closed