Commit a100602d authored by Dr. Matthias St. Pierre's avatar Dr. Matthias St. Pierre Committed by Matt Caswell
Browse files

Fix leak of secrecy in ecdh_compute_key()



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: default avatarKurt Roeckx <kurt@openssl.org>
Reviewed-by: default avatarMatt Caswell <matt@openssl.org>
(cherry picked from commit 0e469016)
parent 9d9e0535
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -202,7 +202,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);
}