diff options
author | Richard Levitte <levitte@openssl.org> | 2021-06-22 18:09:25 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2021-06-23 23:00:36 +0200 |
commit | 006de7670a12dff617e86a55b6db7c6e3b1f8fef (patch) | |
tree | b0492fea1e11622a05a5aaeebe195eb4f333f005 /crypto/evp/mac_lib.c | |
parent | 86ff7cf2a6cdf26f2ba7e64db6fe5c92c64bf9ac (diff) |
EVP: Change the output size type of EVP_Q_digest() and EVP_Q_mac()
This makes them more consistent with other new interfaces.
Fixes #15839
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15861)
Diffstat (limited to 'crypto/evp/mac_lib.c')
-rw-r--r-- | crypto/evp/mac_lib.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crypto/evp/mac_lib.c b/crypto/evp/mac_lib.c index 339d10919f..1a68c58919 100644 --- a/crypto/evp/mac_lib.c +++ b/crypto/evp/mac_lib.c @@ -233,16 +233,17 @@ int EVP_MAC_names_do_all(const EVP_MAC *mac, return 1; } -unsigned char *EVP_Q_mac(OSSL_LIB_CTX *libctx, const char *name, const char *propq, +unsigned char *EVP_Q_mac(OSSL_LIB_CTX *libctx, + const char *name, const char *propq, const char *subalg, const OSSL_PARAM *params, const void *key, size_t keylen, const unsigned char *data, size_t datalen, - unsigned char *out, size_t outsize, unsigned int *outlen) + unsigned char *out, size_t outsize, size_t *outlen) { EVP_MAC *mac = EVP_MAC_fetch(libctx, name, propq); OSSL_PARAM subalg_param[] = { OSSL_PARAM_END, OSSL_PARAM_END }; EVP_MAC_CTX *ctx = NULL; - size_t len; + size_t len = 0; unsigned char *res = NULL; if (outlen != NULL) @@ -286,7 +287,7 @@ unsigned char *EVP_Q_mac(OSSL_LIB_CTX *libctx, const char *name, const char *pro } res = out; if (res != NULL && outlen != NULL) - *outlen = (unsigned int)len; + *outlen = len; } err: |