projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3ade92e
)
Fix leak of secrecy in ecdh_compute_key()
author
Dr. Matthias St. Pierre
<Matthias.St.Pierre@ncp-e.com>
Sat, 15 Oct 2016 22:53:33 +0000
(
00:53
+0200)
committer
Matt Caswell
<matt@openssl.org>
Tue, 25 Oct 2016 21:04:36 +0000
(22:04 +0100)
A temporary buffer containing g^xy was not cleared in ecdh_compute_key()
before freeing it, so the shared secret was leaked in memory.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
crypto/ecdh/ech_ossl.c
patch
|
blob
|
history
diff --git
a/crypto/ecdh/ech_ossl.c
b/crypto/ecdh/ech_ossl.c
index df115cc262e51947602b26913b81d70f4c5b0a7d..d3b05247fe37d068d259702d09a422646fd2764f 100644
(file)
--- a/
crypto/ecdh/ech_ossl.c
+++ b/
crypto/ecdh/ech_ossl.c
@@
-212,7
+212,9
@@
static int ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key,
BN_CTX_end(ctx);
if (ctx)
BN_CTX_free(ctx);
- if (buf)
+ if (buf) {
+ OPENSSL_cleanse(buf, buflen);
OPENSSL_free(buf);
+ }
return (ret);
}