Update the SSL_export_keying_material() documentation for TLSv1.3
[openssl.git] / ssl / ssl_ciph.c
index 0afdfdaba106aea2d7327d12610d477b2f73ec1f..64bb264b52466aae6822eeef14678206cd902eb9 100644 (file)
@@ -1933,9 +1933,8 @@ int SSL_CIPHER_get_auth_nid(const SSL_CIPHER *c)
 
 const EVP_MD *SSL_CIPHER_get_handshake_digest(const SSL_CIPHER *c)
 {
-    int idx = c->algorithm2;
+    int idx = c->algorithm2 & SSL_HANDSHAKE_MAC_MASK;
 
-    idx &= SSL_HANDSHAKE_MAC_MASK;
     if (idx < 0 || idx >= SSL_MD_NUM_IDX)
         return NULL;
     return ssl_digest_methods[idx];