diff options
author | Niels Möller <nisse@lysator.liu.se> | 2015-03-25 22:26:24 +0100 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2015-03-25 22:26:24 +0100 |
commit | c0ea0a1f957c14bee8469b71db6e12e6f505caaf (patch) | |
tree | d89d53b76c1120bc6635024e36c7cdb58bfefda3 | |
parent | 9234e66264cc2da3f8fbd5a0832b89c020008ae8 (diff) | |
download | nettle-c0ea0a1f957c14bee8469b71db6e12e6f505caaf.tar.gz |
Fixed allocation bug and overwrite in ed25519_sha512_public_key.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ed25519-sha512-pubkey.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2015-03-25 Niels Möller <nisse@diamant.hack.org> + + * ed25519-sha512-pubkey.c: Fix stack overwrite. The digest array + must have room for a complete sha512 digest. + 2015-03-19 Niels Möller <nisse@diamant.hack.org> * Makefile.in (OPT_HOGWEED_SOURCES): Deleted make variable. diff --git a/ed25519-sha512-pubkey.c b/ed25519-sha512-pubkey.c index 677759c3..438446e2 100644 --- a/ed25519-sha512-pubkey.c +++ b/ed25519-sha512-pubkey.c @@ -43,7 +43,7 @@ ed25519_sha512_public_key (uint8_t *pub, const uint8_t *priv) { const struct ecc_curve *ecc = &_nettle_curve25519; struct sha512_ctx ctx; - uint8_t digest[ED25519_KEY_SIZE]; + uint8_t digest[SHA512_DIGEST_SIZE]; mp_size_t itch = ecc->q.size + _eddsa_public_key_itch (ecc); mp_limb_t *scratch = gmp_alloc_limbs (itch); |