rename mac_key_* to ossl_mac_key_*
authorPauli <paul.dale@oracle.com>
Mon, 16 Nov 2020 02:00:34 +0000 (12:00 +1000)
committerPauli <paul.dale@oracle.com>
Wed, 18 Nov 2020 21:38:58 +0000 (07:38 +1000)
mac_key_free(), mac_key_new(), mac_key_up_ref().

Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13417)

providers/implementations/include/prov/macsignature.h
providers/implementations/keymgmt/mac_legacy_kmgmt.c
providers/implementations/signature/mac_legacy.c

index 1e59884cbcfbbb109a450afa5965a6a86d46134d..9bfaaf9b6e6356d9e65e286f3771a2138ad314e9 100644 (file)
@@ -25,6 +25,6 @@ struct mac_key_st {
 
 typedef struct mac_key_st MAC_KEY;
 
-MAC_KEY *mac_key_new(OSSL_LIB_CTX *libctx, int cmac);
-void mac_key_free(MAC_KEY *mackey);
-int mac_key_up_ref(MAC_KEY *mackey);
+MAC_KEY *ossl_mac_key_new(OSSL_LIB_CTX *libctx, int cmac);
+void ossl_mac_key_free(MAC_KEY *mackey);
+int ossl_mac_key_up_ref(MAC_KEY *mackey);
index 196d3516ed888f9167753c2224f8802cc3e7f3cf..08de2a07ccec25d18212b80880903980c2b2168b 100644 (file)
@@ -57,7 +57,7 @@ struct mac_gen_ctx {
     PROV_CIPHER cipher;
 };
 
-MAC_KEY *mac_key_new(OSSL_LIB_CTX *libctx, int cmac)
+MAC_KEY *ossl_mac_key_new(OSSL_LIB_CTX *libctx, int cmac)
 {
     MAC_KEY *mackey;
 
@@ -80,7 +80,7 @@ MAC_KEY *mac_key_new(OSSL_LIB_CTX *libctx, int cmac)
     return mackey;
 }
 
-void mac_key_free(MAC_KEY *mackey)
+void ossl_mac_key_free(MAC_KEY *mackey)
 {
     int ref = 0;
 
@@ -98,7 +98,7 @@ void mac_key_free(MAC_KEY *mackey)
     OPENSSL_free(mackey);
 }
 
-int mac_key_up_ref(MAC_KEY *mackey)
+int ossl_mac_key_up_ref(MAC_KEY *mackey)
 {
     int ref = 0;
 
@@ -118,17 +118,17 @@ int mac_key_up_ref(MAC_KEY *mackey)
 
 static void *mac_new(void *provctx)
 {
-    return mac_key_new(PROV_LIBCTX_OF(provctx), 0);
+    return ossl_mac_key_new(PROV_LIBCTX_OF(provctx), 0);
 }
 
 static void *mac_new_cmac(void *provctx)
 {
-    return mac_key_new(PROV_LIBCTX_OF(provctx), 1);
+    return ossl_mac_key_new(PROV_LIBCTX_OF(provctx), 1);
 }
 
 static void mac_free(void *mackey)
 {
-    mac_key_free(mackey);
+    ossl_mac_key_free(mackey);
 }
 
 static int mac_has(const void *keydata, int selection)
@@ -454,7 +454,7 @@ static void *mac_gen(void *genctx, OSSL_CALLBACK *cb, void *cbarg)
     if (!ossl_prov_is_running() || gctx == NULL)
         return NULL;
 
-    if ((key = mac_key_new(gctx->libctx, 0)) == NULL) {
+    if ((key = ossl_mac_key_new(gctx->libctx, 0)) == NULL) {
         ERR_raise(ERR_LIB_PROV, ERR_R_MALLOC_FAILURE);
         return NULL;
     }
@@ -465,7 +465,7 @@ static void *mac_gen(void *genctx, OSSL_CALLBACK *cb, void *cbarg)
 
     if (gctx->priv_key == NULL) {
         ERR_raise(ERR_LIB_PROV, EVP_R_INVALID_KEY);
-        mac_key_free(key);
+        ossl_mac_key_free(key);
         return NULL;
     }
 
index 12a78b7ea4350a3c90efb150f74f2e474c5953a3..b92dabde3cc486f547b5df0566ec09b9916228f9 100644 (file)
@@ -98,10 +98,10 @@ static int mac_digest_sign_init(void *vpmacctx, const char *mdname, void *vkey)
     if (!ossl_prov_is_running()
             || pmacctx == NULL
             || vkey == NULL
-            || !mac_key_up_ref(vkey))
+            || !ossl_mac_key_up_ref(vkey))
         return 0;
 
-    mac_key_free(pmacctx->key);
+    ossl_mac_key_free(pmacctx->key);
     pmacctx->key = vkey;
 
     if (pmacctx->key->cipher.cipher != NULL)
@@ -154,7 +154,7 @@ static void mac_freectx(void *vpmacctx)
 
     OPENSSL_free(ctx->propq);
     EVP_MAC_CTX_free(ctx->macctx);
-    mac_key_free(ctx->key);
+    ossl_mac_key_free(ctx->key);
     OPENSSL_free(ctx);
 }
 
@@ -174,7 +174,7 @@ static void *mac_dupctx(void *vpmacctx)
     dstctx->key = NULL;
     dstctx->macctx = NULL;
 
-    if (srcctx->key != NULL && !mac_key_up_ref(srcctx->key))
+    if (srcctx->key != NULL && !ossl_mac_key_up_ref(srcctx->key))
         goto err;
     dstctx->key = srcctx->key;