diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2020-10-13 14:22:17 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2020-10-22 20:47:02 +1000 |
commit | 90a2576b9bbb327141df0bd244830b462fcaeee6 (patch) | |
tree | 0e00ad4ca3e8d47598407a15299033a96da2b78b | |
parent | 42445046354a4ac7671143600e888c6b230e56ff (diff) |
Rename EVP_MAC_size() to EVP_MAC_CTX_get_mac_size().
Fixes #11320
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13116)
-rw-r--r-- | apps/fipsinstall.c | 2 | ||||
-rw-r--r-- | crypto/evp/mac_lib.c | 4 | ||||
-rw-r--r-- | doc/man3/EVP_MAC.pod | 9 | ||||
-rw-r--r-- | doc/man7/EVP_MAC-BLAKE2.pod | 2 | ||||
-rw-r--r-- | doc/man7/EVP_MAC-CMAC.pod | 2 | ||||
-rw-r--r-- | doc/man7/EVP_MAC-GMAC.pod | 2 | ||||
-rw-r--r-- | doc/man7/EVP_MAC-HMAC.pod | 2 | ||||
-rw-r--r-- | doc/man7/EVP_MAC-KMAC.pod | 2 | ||||
-rw-r--r-- | doc/man7/EVP_MAC-Poly1305.pod | 2 | ||||
-rw-r--r-- | doc/man7/EVP_MAC-Siphash.pod | 2 | ||||
-rw-r--r-- | include/openssl/evp.h | 2 | ||||
-rw-r--r-- | providers/implementations/kdfs/kbkdf.c | 2 | ||||
-rw-r--r-- | providers/implementations/kdfs/sskdf.c | 2 | ||||
-rw-r--r-- | providers/implementations/kdfs/tls1_prf.c | 2 | ||||
-rw-r--r-- | ssl/t1_lib.c | 2 |
15 files changed, 19 insertions, 20 deletions
diff --git a/apps/fipsinstall.c b/apps/fipsinstall.c index cb78489eef..d1cda24941 100644 --- a/apps/fipsinstall.c +++ b/apps/fipsinstall.c @@ -80,7 +80,7 @@ static int do_mac(EVP_MAC_CTX *ctx, unsigned char *tmp, BIO *in, if (!EVP_MAC_init(ctx)) goto err; - if (EVP_MAC_size(ctx) > outsz) + if (EVP_MAC_CTX_get_mac_size(ctx) > outsz) goto end; while ((i = BIO_read(in, (char *)tmp, BUFSIZE)) != 0) { if (i < 0 || !EVP_MAC_update(ctx, tmp, i)) diff --git a/crypto/evp/mac_lib.c b/crypto/evp/mac_lib.c index d76ffedcb8..ac8bfb150c 100644 --- a/crypto/evp/mac_lib.c +++ b/crypto/evp/mac_lib.c @@ -82,7 +82,7 @@ EVP_MAC *EVP_MAC_CTX_mac(EVP_MAC_CTX *ctx) return ctx->meth; } -size_t EVP_MAC_size(EVP_MAC_CTX *ctx) +size_t EVP_MAC_CTX_get_mac_size(EVP_MAC_CTX *ctx) { size_t sz = 0; @@ -124,7 +124,7 @@ int EVP_MAC_final(EVP_MAC_CTX *ctx, if (out != NULL) res = ctx->meth->final(ctx->data, out, &l, outsize); else - l = EVP_MAC_size(ctx); + l = EVP_MAC_CTX_get_mac_size(ctx); if (outl != NULL) *outl = l; return res; diff --git a/doc/man3/EVP_MAC.pod b/doc/man3/EVP_MAC.pod index 87f2518754..455d154cee 100644 --- a/doc/man3/EVP_MAC.pod +++ b/doc/man3/EVP_MAC.pod @@ -7,7 +7,7 @@ EVP_MAC_is_a, EVP_MAC_number, EVP_MAC_name, EVP_MAC_names_do_all, EVP_MAC_provider, EVP_MAC_get_params, EVP_MAC_gettable_params, EVP_MAC_CTX, EVP_MAC_CTX_new, EVP_MAC_CTX_free, EVP_MAC_CTX_dup, EVP_MAC_CTX_mac, EVP_MAC_CTX_get_params, EVP_MAC_CTX_set_params, -EVP_MAC_size, EVP_MAC_init, EVP_MAC_update, EVP_MAC_final, +EVP_MAC_CTX_get_mac_size, EVP_MAC_init, EVP_MAC_update, EVP_MAC_final, EVP_MAC_gettable_ctx_params, EVP_MAC_settable_ctx_params, EVP_MAC_do_all_provided - EVP MAC routines @@ -38,7 +38,7 @@ EVP_MAC_do_all_provided - EVP MAC routines int EVP_MAC_CTX_get_params(EVP_MAC_CTX *ctx, OSSL_PARAM params[]); int EVP_MAC_CTX_set_params(EVP_MAC_CTX *ctx, const OSSL_PARAM params[]); - size_t EVP_MAC_size(EVP_MAC_CTX *ctx); + size_t EVP_MAC_CTX_get_mac_size(EVP_MAC_CTX *ctx); int EVP_MAC_init(EVP_MAC_CTX *ctx); int EVP_MAC_update(EVP_MAC_CTX *ctx, const unsigned char *data, size_t datalen); int EVP_MAC_final(EVP_MAC_CTX *ctx, @@ -162,7 +162,7 @@ See L<OSSL_PARAM(3)> for the use of B<OSSL_PARAM> as parameter descriptor. =head2 Information functions -EVP_MAC_size() returns the MAC output size for the given context. +EVP_MAC_CTX_get_mac_size() returns the MAC output size for the given context. EVP_MAC_is_a() checks if the given I<mac> is an implementation of an algorithm that's identifiable with I<name>. @@ -303,8 +303,7 @@ success, 0 on error. EVP_MAC_init(), EVP_MAC_update(), and EVP_MAC_final() return 1 on success, 0 on error. -EVP_MAC_size() returns the expected output size, or 0 if it isn't -set. +EVP_MAC_CTX_get_mac_size() returns the expected output size, or 0 if it isn't set. If it isn't set, a call to EVP_MAC_init() should get it set. EVP_MAC_do_all_provided() returns nothing at all. diff --git a/doc/man7/EVP_MAC-BLAKE2.pod b/doc/man7/EVP_MAC-BLAKE2.pod index 90b065340d..51bac880b5 100644 --- a/doc/man7/EVP_MAC-BLAKE2.pod +++ b/doc/man7/EVP_MAC-BLAKE2.pod @@ -29,7 +29,7 @@ L<EVP_MAC(3)/PARAMETERS>. All these parameters can be set with EVP_MAC_CTX_set_params(). Furthermore, the "size" parameter can be retrieved with -EVP_MAC_CTX_get_params(), or with EVP_MAC_size(). +EVP_MAC_CTX_get_params(), or with EVP_MAC_CTX_get_mac_size(). The length of the "size" parameter should not exceed that of a B<size_t>. =over 4 diff --git a/doc/man7/EVP_MAC-CMAC.pod b/doc/man7/EVP_MAC-CMAC.pod index c210d693ce..4d05919b8f 100644 --- a/doc/man7/EVP_MAC-CMAC.pod +++ b/doc/man7/EVP_MAC-CMAC.pod @@ -45,7 +45,7 @@ EVP_MAC_CTX_get_params(): =back -The "size" parameter can also be retrieved with with EVP_MAC_size(). +The "size" parameter can also be retrieved with with EVP_MAC_CTX_get_mac_size(). The length of the "size" parameter is equal to that of an B<unsigned int>. =head1 SEE ALSO diff --git a/doc/man7/EVP_MAC-GMAC.pod b/doc/man7/EVP_MAC-GMAC.pod index 7c9477c215..d662e7d5d2 100644 --- a/doc/man7/EVP_MAC-GMAC.pod +++ b/doc/man7/EVP_MAC-GMAC.pod @@ -47,7 +47,7 @@ EVP_MAC_CTX_get_params(): =back -The "size" parameter can also be retrieved with EVP_MAC_size(). +The "size" parameter can also be retrieved with EVP_MAC_CTX_get_mac_size(). The length of the "size" parameter is equal to that of an B<unsigned int>. =head1 SEE ALSO diff --git a/doc/man7/EVP_MAC-HMAC.pod b/doc/man7/EVP_MAC-HMAC.pod index 45ccd17211..94bac8dbcf 100644 --- a/doc/man7/EVP_MAC-HMAC.pod +++ b/doc/man7/EVP_MAC-HMAC.pod @@ -51,7 +51,7 @@ EVP_MAC_CTX_get_params(): =back -The "size" parameter can also be retrieved with EVP_MAC_size(). +The "size" parameter can also be retrieved with EVP_MAC_CTX_get_mac_size(). The length of the "size" parameter is equal to that of an B<unsigned int>. =head1 SEE ALSO diff --git a/doc/man7/EVP_MAC-KMAC.pod b/doc/man7/EVP_MAC-KMAC.pod index df7ac1ddf6..245d998e4a 100644 --- a/doc/man7/EVP_MAC-KMAC.pod +++ b/doc/man7/EVP_MAC-KMAC.pod @@ -29,7 +29,7 @@ L<EVP_MAC(3)/PARAMETERS>. All these parameters can be set with EVP_MAC_CTX_set_params(). Furthermore, the "size" parameter can be retrieved with -EVP_MAC_CTX_get_params(), or with EVP_MAC_size(). +EVP_MAC_CTX_get_params(), or with EVP_MAC_CTX_get_mac_size(). The length of the "size" parameter should not exceed that of a B<size_t>. =over 4 diff --git a/doc/man7/EVP_MAC-Poly1305.pod b/doc/man7/EVP_MAC-Poly1305.pod index da9953a1d5..8a0989ab71 100644 --- a/doc/man7/EVP_MAC-Poly1305.pod +++ b/doc/man7/EVP_MAC-Poly1305.pod @@ -41,7 +41,7 @@ EVP_MAC_CTX_get_params(): =back -The "size" parameter can also be retrieved with with EVP_MAC_size(). +The "size" parameter can also be retrieved with with EVP_MAC_CTX_get_mac_size(). The length of the "size" parameter should not exceed that of an B<unsigned int>. =head1 SEE ALSO diff --git a/doc/man7/EVP_MAC-Siphash.pod b/doc/man7/EVP_MAC-Siphash.pod index 8b610c4383..d0a4226ae5 100644 --- a/doc/man7/EVP_MAC-Siphash.pod +++ b/doc/man7/EVP_MAC-Siphash.pod @@ -27,7 +27,7 @@ L<EVP_MAC(3)/PARAMETERS>. All these parameters can be set with EVP_MAC_CTX_set_params(). Furthermore, the "size" parameter can be retrieved with -EVP_MAC_CTX_get_params(), or with EVP_MAC_size(). +EVP_MAC_CTX_get_params(), or with EVP_MAC_CTX_get_mac_size(). The length of the "size" parameter should not exceed that of a B<size_t>. =over 4 diff --git a/include/openssl/evp.h b/include/openssl/evp.h index 7c36e78ce1..b2b87f2ab4 100644 --- a/include/openssl/evp.h +++ b/include/openssl/evp.h @@ -1105,7 +1105,7 @@ EVP_MAC *EVP_MAC_CTX_mac(EVP_MAC_CTX *ctx); int EVP_MAC_CTX_get_params(EVP_MAC_CTX *ctx, OSSL_PARAM params[]); int EVP_MAC_CTX_set_params(EVP_MAC_CTX *ctx, const OSSL_PARAM params[]); -size_t EVP_MAC_size(EVP_MAC_CTX *ctx); +size_t EVP_MAC_CTX_get_mac_size(EVP_MAC_CTX *ctx); int EVP_MAC_init(EVP_MAC_CTX *ctx); int EVP_MAC_update(EVP_MAC_CTX *ctx, const unsigned char *data, size_t datalen); int EVP_MAC_final(EVP_MAC_CTX *ctx, diff --git a/providers/implementations/kdfs/kbkdf.c b/providers/implementations/kdfs/kbkdf.c index cf3b90c19c..74a694e8ea 100644 --- a/providers/implementations/kdfs/kbkdf.c +++ b/providers/implementations/kdfs/kbkdf.c @@ -218,7 +218,7 @@ static int kbkdf_derive(void *vctx, unsigned char *key, size_t keylen) return 0; } - h = EVP_MAC_size(ctx->ctx_init); + h = EVP_MAC_CTX_get_mac_size(ctx->ctx_init); if (h == 0) goto done; if (ctx->iv_len != 0 && ctx->iv_len != h) { diff --git a/providers/implementations/kdfs/sskdf.c b/providers/implementations/kdfs/sskdf.c index 6cfde97842..84711dde27 100644 --- a/providers/implementations/kdfs/sskdf.c +++ b/providers/implementations/kdfs/sskdf.c @@ -246,7 +246,7 @@ static int SSKDF_mac_kdm(EVP_MAC_CTX *ctx_init, if (!EVP_MAC_init(ctx_init)) goto end; - out_len = EVP_MAC_size(ctx_init); /* output size */ + out_len = EVP_MAC_CTX_get_mac_size(ctx_init); /* output size */ if (out_len <= 0) goto end; len = derived_key_len; diff --git a/providers/implementations/kdfs/tls1_prf.c b/providers/implementations/kdfs/tls1_prf.c index 315971a96e..aba08068ca 100644 --- a/providers/implementations/kdfs/tls1_prf.c +++ b/providers/implementations/kdfs/tls1_prf.c @@ -296,7 +296,7 @@ static int tls1_prf_P_hash(EVP_MAC_CTX *ctx_init, goto err; if (!EVP_MAC_init(ctx_init)) goto err; - chunk = EVP_MAC_size(ctx_init); + chunk = EVP_MAC_CTX_get_mac_size(ctx_init); if (chunk == 0) goto err; /* A(0) = seed */ diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 1971a8e0bc..8836069097 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -3461,7 +3461,7 @@ int ssl_hmac_final(SSL_HMAC *ctx, unsigned char *md, size_t *len, size_t ssl_hmac_size(const SSL_HMAC *ctx) { if (ctx->ctx != NULL) - return EVP_MAC_size(ctx->ctx); + return EVP_MAC_CTX_get_mac_size(ctx->ctx); #ifndef OPENSSL_NO_DEPRECATED_3_0 if (ctx->old_ctx != NULL) return ssl_hmac_old_size(ctx); |