]> git.ipfire.org Git - thirdparty/openssl.git/commit
EVP fetching: make operation_id part of the method identity
authorRichard Levitte <levitte@openssl.org>
Fri, 7 Jun 2019 09:44:08 +0000 (11:44 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 10 Jun 2019 06:01:19 +0000 (08:01 +0200)
commit2ccb1b4ecab2c3ac1dc2ff81a48869a79afa7839
tree6099885735867271e674fb4108203b084280dbc1
parenta08714e18131b1998faa0113e5bd4024044654ac
EVP fetching: make operation_id part of the method identity

Because the operation identity wasn't integrated with the created
methods, the following code would give unexpected results:

    EVP_MD *md = EVP_MD_fetch(NULL, "MD5", NULL);
    EVP_CIPHER *cipher = EVP_CIPHER_fetch(NULL, "MD5", NULL);

    if (md != NULL)
        printf("MD5 is a digest\n");
    if (cipher != NULL)
        printf("MD5 is a cipher\n");

The message is that MD5 is both a digest and a cipher.

Partially fixes #9106

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/9109)
crypto/core_fetch.c
crypto/evp/evp_fetch.c
doc/internal/man3/ossl_method_construct.pod
include/internal/core.h