]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
CORE & PROV: clean away OSSL_FUNC_mac_size()
authorRichard Levitte <levitte@openssl.org>
Tue, 2 Feb 2021 12:42:55 +0000 (13:42 +0100)
committerRichard Levitte <levitte@openssl.org>
Wed, 3 Feb 2021 16:17:53 +0000 (17:17 +0100)
There was a remaining function signature declaration, but no
OSSL_DISPATCH number for it nor any way it's ever used.  It did exist
once, but was replaced with an OSSL_PARAM item to retrieve.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14048)

include/crypto/evp.h
include/openssl/core_dispatch.h
providers/implementations/macs/blake2_mac_impl.c
providers/implementations/macs/gmac_prov.c
providers/implementations/macs/hmac_prov.c
providers/implementations/macs/kmac_prov.c
providers/implementations/macs/poly1305_prov.c
providers/implementations/macs/siphash_prov.c

index bed75f406cce4df10c470d119fd46d3224457bae..8e86bb94dfb33a961d9c16b91c95c263d61db123 100644 (file)
@@ -196,7 +196,6 @@ struct evp_mac_st {
     OSSL_FUNC_mac_newctx_fn *newctx;
     OSSL_FUNC_mac_dupctx_fn *dupctx;
     OSSL_FUNC_mac_freectx_fn *freectx;
-    OSSL_FUNC_mac_size_fn *size;
     OSSL_FUNC_mac_init_fn *init;
     OSSL_FUNC_mac_update_fn *update;
     OSSL_FUNC_mac_final_fn *final;
index bbd04297188e4fed0aaeef26d861920d5f3a1b8c..a8e9e521512e7580cbaf48eb829ef9001ad01013 100644 (file)
@@ -331,7 +331,6 @@ OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, cipher_gettable_ctx_params,
 OSSL_CORE_MAKE_FUNC(void *, mac_newctx, (void *provctx))
 OSSL_CORE_MAKE_FUNC(void *, mac_dupctx, (void *src))
 OSSL_CORE_MAKE_FUNC(void, mac_freectx, (void *mctx))
-OSSL_CORE_MAKE_FUNC(size_t, mac_size, (void *mctx))
 OSSL_CORE_MAKE_FUNC(int, mac_init, (void *mctx))
 OSSL_CORE_MAKE_FUNC(int, mac_update,
                     (void *mctx, const unsigned char *in, size_t inl))
index f7b6bd3e4f0bf834336de16ef365ab1e41f61e78..542595efa1f340c5daa6ae551f89dfbd9bfea2c0 100644 (file)
@@ -39,8 +39,6 @@ struct blake2_mac_data_st {
     unsigned char key[BLAKE2_KEYBYTES];
 };
 
-static size_t blake2_mac_size(void *vmacctx);
-
 static void *blake2_mac_new(void *unused_provctx)
 {
     struct blake2_mac_data_st *macctx;
@@ -82,6 +80,13 @@ static void blake2_mac_free(void *vmacctx)
     }
 }
 
+static size_t blake2_mac_size(void *vmacctx)
+{
+    struct blake2_mac_data_st *macctx = vmacctx;
+
+    return macctx->params.digest_length;
+}
+
 static int blake2_mac_init(void *vmacctx)
 {
     struct blake2_mac_data_st *macctx = vmacctx;
@@ -214,13 +219,6 @@ static int blake2_mac_set_ctx_params(void *vmacctx, const OSSL_PARAM params[])
     return 1;
 }
 
-static size_t blake2_mac_size(void *vmacctx)
-{
-    struct blake2_mac_data_st *macctx = vmacctx;
-
-    return macctx->params.digest_length;
-}
-
 const OSSL_DISPATCH BLAKE2_FUNCTIONS[] = {
     { OSSL_FUNC_MAC_NEWCTX, (void (*)(void))blake2_mac_new },
     { OSSL_FUNC_MAC_DUPCTX, (void (*)(void))blake2_mac_dup },
index d9790dcd6ce4d0a010462342e54480c7eec5970c..fe4d2c3c8a1e18ccb7d15f58ad36ddbc28cfa823 100644 (file)
@@ -45,8 +45,6 @@ struct gmac_data_st {
     PROV_CIPHER cipher;
 };
 
-static size_t gmac_size(void);
-
 static void gmac_free(void *vmacctx)
 {
     struct gmac_data_st *macctx = vmacctx;
@@ -95,6 +93,11 @@ static void *gmac_dup(void *vsrc)
     return dst;
 }
 
+static size_t gmac_size(void)
+{
+    return EVP_GCM_TLS_TAG_LEN;
+}
+
 static int gmac_init(void *vmacctx)
 {
     return ossl_prov_is_running();
@@ -141,11 +144,6 @@ static int gmac_final(void *vmacctx, unsigned char *out, size_t *outl,
     return 1;
 }
 
-static size_t gmac_size(void)
-{
-    return EVP_GCM_TLS_TAG_LEN;
-}
-
 static const OSSL_PARAM known_gettable_params[] = {
     OSSL_PARAM_size_t(OSSL_MAC_PARAM_SIZE, NULL),
     OSSL_PARAM_END
index b5d3f110f4176d96ea08bd16dce6d8ec19e23c0f..993e36ae3432645abae5dde373cfdd1d6d213be8 100644 (file)
@@ -71,8 +71,6 @@ int ssl3_cbc_digest_record(const EVP_MD *md,
                            const unsigned char *mac_secret,
                            size_t mac_secret_length, char is_sslv3);
 
-static size_t hmac_size(void *vmacctx);
-
 static void *hmac_new(void *provctx)
 {
     struct hmac_data_st *macctx;
index 940fe7eb3d1568ec507e2ca960efcd1702afdb4f..b9a6318e122c379d8cef326a5910f704ba2ad816 100644 (file)
@@ -73,7 +73,6 @@ static OSSL_FUNC_mac_gettable_ctx_params_fn kmac_gettable_ctx_params;
 static OSSL_FUNC_mac_get_ctx_params_fn kmac_get_ctx_params;
 static OSSL_FUNC_mac_settable_ctx_params_fn kmac_settable_ctx_params;
 static OSSL_FUNC_mac_set_ctx_params_fn kmac_set_ctx_params;
-static OSSL_FUNC_mac_size_fn kmac_size;
 static OSSL_FUNC_mac_init_fn kmac_init;
 static OSSL_FUNC_mac_update_fn kmac_update;
 static OSSL_FUNC_mac_final_fn kmac_final;
@@ -235,6 +234,13 @@ static void *kmac_dup(void *vsrc)
     return dst;
 }
 
+static size_t kmac_size(void *vmacctx)
+{
+    struct kmac_data_st *kctx = vmacctx;
+
+    return kctx->out_len;
+}
+
 /*
  * The init() assumes that any ctrl methods are set beforehand for
  * md, key and custom. Setting the fields afterwards will have no
@@ -278,13 +284,6 @@ static int kmac_init(void *vmacctx)
            && EVP_DigestUpdate(ctx, kctx->key, kctx->key_len);
 }
 
-static size_t kmac_size(void *vmacctx)
-{
-    struct kmac_data_st *kctx = vmacctx;
-
-    return kctx->out_len;
-}
-
 static int kmac_update(void *vmacctx, const unsigned char *data,
                        size_t datalen)
 {
index 1b248f141e1f6a62b8df092bf2f4022e7b3e4746..a3bc47253cfb8b0f9dfd11112748a86547f2d8e8 100644 (file)
@@ -40,8 +40,6 @@ struct poly1305_data_st {
     POLY1305 poly1305;           /* Poly1305 data */
 };
 
-static size_t poly1305_size(void);
-
 static void *poly1305_new(void *provctx)
 {
     struct poly1305_data_st *ctx;
index 01100b51d6c10e3ad501def9ab22f430d9bd507b..1a79ae0c6a32cb9fb0d3ba98e8857b88106736e2 100644 (file)
@@ -38,7 +38,6 @@ static OSSL_FUNC_mac_gettable_ctx_params_fn siphash_gettable_ctx_params;
 static OSSL_FUNC_mac_get_ctx_params_fn siphash_get_ctx_params;
 static OSSL_FUNC_mac_settable_ctx_params_fn siphash_settable_params;
 static OSSL_FUNC_mac_set_ctx_params_fn siphash_set_params;
-static OSSL_FUNC_mac_size_fn siphash_size;
 static OSSL_FUNC_mac_init_fn siphash_init;
 static OSSL_FUNC_mac_update_fn siphash_update;
 static OSSL_FUNC_mac_final_fn siphash_final;
@@ -94,7 +93,7 @@ static int siphash_init(void *vmacctx)
 }
 
 static int siphash_update(void *vmacctx, const unsigned char *data,
-                       size_t datalen)
+                          size_t datalen)
 {
     struct siphash_data_st *ctx = vmacctx;