Browse Source

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)
master
Shane Lontis 2 years ago
parent
commit
90a2576b9b
15 changed files with 19 additions and 20 deletions
  1. +1
    -1
      apps/fipsinstall.c
  2. +2
    -2
      crypto/evp/mac_lib.c
  3. +4
    -5
      doc/man3/EVP_MAC.pod
  4. +1
    -1
      doc/man7/EVP_MAC-BLAKE2.pod
  5. +1
    -1
      doc/man7/EVP_MAC-CMAC.pod
  6. +1
    -1
      doc/man7/EVP_MAC-GMAC.pod
  7. +1
    -1
      doc/man7/EVP_MAC-HMAC.pod
  8. +1
    -1
      doc/man7/EVP_MAC-KMAC.pod
  9. +1
    -1
      doc/man7/EVP_MAC-Poly1305.pod
  10. +1
    -1
      doc/man7/EVP_MAC-Siphash.pod
  11. +1
    -1
      include/openssl/evp.h
  12. +1
    -1
      providers/implementations/kdfs/kbkdf.c
  13. +1
    -1
      providers/implementations/kdfs/sskdf.c
  14. +1
    -1
      providers/implementations/kdfs/tls1_prf.c
  15. +1
    -1
      ssl/t1_lib.c

+ 1
- 1
apps/fipsinstall.c View File

@ -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))


+ 2
- 2
crypto/evp/mac_lib.c View File

@ -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;


+ 4
- 5
doc/man3/EVP_MAC.pod View File

@ -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.


+ 1
- 1
doc/man7/EVP_MAC-BLAKE2.pod View File

@ -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


+ 1
- 1
doc/man7/EVP_MAC-CMAC.pod View File

@ -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


+ 1
- 1
doc/man7/EVP_MAC-GMAC.pod View File

@ -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


+ 1
- 1
doc/man7/EVP_MAC-HMAC.pod View File

@ -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


+ 1
- 1
doc/man7/EVP_MAC-KMAC.pod View File

@ -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


+ 1
- 1
doc/man7/EVP_MAC-Poly1305.pod View File

@ -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


+ 1
- 1
doc/man7/EVP_MAC-Siphash.pod View File

@ -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


+ 1
- 1
include/openssl/evp.h View File

@ -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,


+ 1
- 1
providers/implementations/kdfs/kbkdf.c View File

@ -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) {


+ 1
- 1
providers/implementations/kdfs/sskdf.c View File

@ -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;


+ 1
- 1
providers/implementations/kdfs/tls1_prf.c View File

@ -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 */


+ 1
- 1
ssl/t1_lib.c View File

@ -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);


Loading…
Cancel
Save