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);
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;
return mackey;
}
-void mac_key_free(MAC_KEY *mackey)
+void ossl_mac_key_free(MAC_KEY *mackey)
{
int ref = 0;
OPENSSL_free(mackey);
}
-int mac_key_up_ref(MAC_KEY *mackey)
+int ossl_mac_key_up_ref(MAC_KEY *mackey)
{
int ref = 0;
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)
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;
}
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;
}
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)
OPENSSL_free(ctx->propq);
EVP_MAC_CTX_free(ctx->macctx);
- mac_key_free(ctx->key);
+ ossl_mac_key_free(ctx->key);
OPENSSL_free(ctx);
}
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;