diff options
author | Richard Levitte <levitte@openssl.org> | 2019-06-07 11:44:08 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-06-10 08:01:19 +0200 |
commit | 2ccb1b4ecab2c3ac1dc2ff81a48869a79afa7839 (patch) | |
tree | 6099885735867271e674fb4108203b084280dbc1 /include | |
parent | a08714e18131b1998faa0113e5bd4024044654ac (diff) |
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)
Diffstat (limited to 'include')
-rw-r--r-- | include/internal/core.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/internal/core.h b/include/internal/core.h index 64547dca40..3f0cdfaeff 100644 --- a/include/internal/core.h +++ b/include/internal/core.h @@ -32,11 +32,13 @@ typedef struct ossl_method_construct_method_st { /* Remove a store */ void (*dealloc_tmp_store)(void *store); /* Get an already existing method from a store */ - void *(*get)(OPENSSL_CTX *libctx, void *store, const char *name, - const char *propquery, void *data); + void *(*get)(OPENSSL_CTX *libctx, void *store, + int operation_id, const char *name, const char *propquery, + void *data); /* Store a method in a store */ int (*put)(OPENSSL_CTX *libctx, void *store, void *method, - const char *name, const char *propdef, void *data); + int operation_id, const char *name, const char *propdef, + void *data); /* Construct a new method */ void *(*construct)(const char *name, const OSSL_DISPATCH *fns, OSSL_PROVIDER *prov, void *data); |