diff options
author | Matt Caswell <matt@openssl.org> | 2020-03-12 14:46:30 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2020-04-01 17:28:56 +0100 |
commit | fc69f32cd6852e60627969138be80cc665a573dd (patch) | |
tree | 4459f5382fafbd15741fa037d3b83944ac76c01c /ssl/statem/extensions_srvr.c | |
parent | fe56d5951f0b42fd3ff1cf42a96d07f06f9692bc (diff) | |
download | openssl-new-fc69f32cd6852e60627969138be80cc665a573dd.tar.gz |
Use EVP_DigestSignInit_ex and EVP_DigestVerifyInit_ex in libssl
We need to make sure we use the correct libctx for all operations in
libssl.
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/11401)
Diffstat (limited to 'ssl/statem/extensions_srvr.c')
-rw-r--r-- | ssl/statem/extensions_srvr.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ssl/statem/extensions_srvr.c b/ssl/statem/extensions_srvr.c index 9649420012..549a207430 100644 --- a/ssl/statem/extensions_srvr.c +++ b/ssl/statem/extensions_srvr.c @@ -780,7 +780,8 @@ int tls_parse_ctos_cookie(SSL *s, PACKET *pkt, unsigned int context, X509 *x, } hmaclen = SHA256_DIGEST_LENGTH; - if (EVP_DigestSignInit(hctx, NULL, EVP_sha256(), NULL, pkey) <= 0 + if (EVP_DigestSignInit_ex(hctx, NULL, "SHA2-256", s->ctx->propq, pkey, + s->ctx->libctx) <= 0 || EVP_DigestSign(hctx, hmac, &hmaclen, data, rawlen - SHA256_DIGEST_LENGTH) <= 0 || hmaclen != SHA256_DIGEST_LENGTH) { @@ -1864,7 +1865,8 @@ EXT_RETURN tls_construct_stoc_cookie(SSL *s, WPACKET *pkt, unsigned int context, goto err; } - if (EVP_DigestSignInit(hctx, NULL, EVP_sha256(), NULL, pkey) <= 0 + if (EVP_DigestSignInit_ex(hctx, NULL, "SHA2-256", s->ctx->propq, pkey, + s->ctx->libctx) <= 0 || EVP_DigestSign(hctx, hmac, &hmaclen, cookie, totcookielen) <= 0) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_STOC_COOKIE, |