aboutsummaryrefslogtreecommitdiff
path: root/providers/implementations/macs
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2021-02-02 13:42:55 +0100
committerRichard Levitte <levitte@openssl.org>2021-02-03 17:17:53 +0100
commit8ce04db808dd1799a4051d938112b7d591fc5fc2 (patch)
tree384d5c514ad89f5568c70a0991d78e9f6d45d7ba /providers/implementations/macs
parent28e1904250183c25faad1744fead96f205559270 (diff)
downloadopenssl-8ce04db808dd1799a4051d938112b7d591fc5fc2.zip
openssl-8ce04db808dd1799a4051d938112b7d591fc5fc2.tar.gz
openssl-8ce04db808dd1799a4051d938112b7d591fc5fc2.tar.bz2
CORE & PROV: clean away OSSL_FUNC_mac_size()
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)
Diffstat (limited to 'providers/implementations/macs')
-rw-r--r--providers/implementations/macs/blake2_mac_impl.c16
-rw-r--r--providers/implementations/macs/gmac_prov.c12
-rw-r--r--providers/implementations/macs/hmac_prov.c2
-rw-r--r--providers/implementations/macs/kmac_prov.c15
-rw-r--r--providers/implementations/macs/poly1305_prov.c2
-rw-r--r--providers/implementations/macs/siphash_prov.c3
6 files changed, 20 insertions, 30 deletions
diff --git a/providers/implementations/macs/blake2_mac_impl.c b/providers/implementations/macs/blake2_mac_impl.c
index f7b6bd3..542595e 100644
--- a/providers/implementations/macs/blake2_mac_impl.c
+++ b/providers/implementations/macs/blake2_mac_impl.c
@@ -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 },
diff --git a/providers/implementations/macs/gmac_prov.c b/providers/implementations/macs/gmac_prov.c
index d9790dc..fe4d2c3 100644
--- a/providers/implementations/macs/gmac_prov.c
+++ b/providers/implementations/macs/gmac_prov.c
@@ -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
diff --git a/providers/implementations/macs/hmac_prov.c b/providers/implementations/macs/hmac_prov.c
index b5d3f11..993e36a 100644
--- a/providers/implementations/macs/hmac_prov.c
+++ b/providers/implementations/macs/hmac_prov.c
@@ -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;
diff --git a/providers/implementations/macs/kmac_prov.c b/providers/implementations/macs/kmac_prov.c
index 940fe7e..b9a6318 100644
--- a/providers/implementations/macs/kmac_prov.c
+++ b/providers/implementations/macs/kmac_prov.c
@@ -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)
{
diff --git a/providers/implementations/macs/poly1305_prov.c b/providers/implementations/macs/poly1305_prov.c
index 1b248f1..a3bc472 100644
--- a/providers/implementations/macs/poly1305_prov.c
+++ b/providers/implementations/macs/poly1305_prov.c
@@ -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;
diff --git a/providers/implementations/macs/siphash_prov.c b/providers/implementations/macs/siphash_prov.c
index 01100b5..1a79ae0 100644
--- a/providers/implementations/macs/siphash_prov.c
+++ b/providers/implementations/macs/siphash_prov.c
@@ -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;