summaryrefslogtreecommitdiff
path: root/lib/nettle
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2012-01-11 03:01:43 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2012-01-11 03:02:07 +0100
commit388524a37dbc278a697e543bd24260679ff3858f (patch)
tree95b46881588cd28dce8f7c2c601da497bdb1ab84 /lib/nettle
parent0fa6db2e68e1e0141d727cf57e9a0f9d2e56f8bd (diff)
downloadgnutls-388524a37dbc278a697e543bd24260679ff3858f.tar.gz
corrected issue in ECDH key generation.
This issue prevented an ECDH key that was smaller than the prime from being correctly aligned.
Diffstat (limited to 'lib/nettle')
-rw-r--r--lib/nettle/ecc_shared_secret.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/nettle/ecc_shared_secret.c b/lib/nettle/ecc_shared_secret.c
index 46a0793bc8..4e3ef358e1 100644
--- a/lib/nettle/ecc_shared_secret.c
+++ b/lib/nettle/ecc_shared_secret.c
@@ -76,8 +76,7 @@ ecc_shared_secret (ecc_key * private_key, ecc_key * public_key,
err = -1;
goto done;
}
- memset (out, 0, x);
- nettle_mpz_get_str_256(x, out + (x - nettle_mpz_sizeinbase_256_u (result->x)), result->x);
+ nettle_mpz_get_str_256(x, out, result->x);
err = 0;
*outlen = x;