diff options
author | Matt Caswell <matt@openssl.org> | 2017-06-12 16:56:15 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2017-06-21 14:45:35 +0100 |
commit | ba4df6828620acddab3c2bf3b99a2b4a838c61de (patch) | |
tree | 4a82dc12c8fef26deee808a7b0ae8f643c2cb92f /ssl | |
parent | f46184bd90aea1d71e46a598038215a7fcb359c6 (diff) |
Add a function to get the handshake digest for an SSL_CIPHER
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3670)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/ssl_ciph.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c index f048b34afd..0afdfdaba1 100644 --- a/ssl/ssl_ciph.c +++ b/ssl/ssl_ciph.c @@ -1931,6 +1931,16 @@ int SSL_CIPHER_get_auth_nid(const SSL_CIPHER *c) return ssl_cipher_table_auth[i].nid; } +const EVP_MD *SSL_CIPHER_get_handshake_digest(const SSL_CIPHER *c) +{ + int idx = c->algorithm2; + + idx &= SSL_HANDSHAKE_MAC_MASK; + if (idx < 0 || idx >= SSL_MD_NUM_IDX) + return NULL; + return ssl_digest_methods[idx]; +} + int SSL_CIPHER_is_aead(const SSL_CIPHER *c) { return (c->algorithm_mac & SSL_AEAD) ? 1 : 0; |