projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
In provider implemented methods, save the name number, not the name string
[openssl.git]
/
crypto
/
evp
/
mac_meth.c
diff --git
a/crypto/evp/mac_meth.c
b/crypto/evp/mac_meth.c
index a317127e157867e887bf494afc87af2d7a78aca4..3dc58c1f3be896f612020e8dbd8e9efcdbf2da0c 100644
(file)
--- a/
crypto/evp/mac_meth.c
+++ b/
crypto/evp/mac_meth.c
@@
-27,7
+27,6
@@
static void evp_mac_free(void *vmac)
if (ref > 0)
return;
ossl_provider_free(mac->prov);
if (ref > 0)
return;
ossl_provider_free(mac->prov);
- OPENSSL_free(mac->name);
CRYPTO_THREAD_lock_free(mac->lock);
OPENSSL_free(mac);
}
CRYPTO_THREAD_lock_free(mac->lock);
OPENSSL_free(mac);
}
@@
-47,18
+46,19
@@
static void *evp_mac_new(void)
return mac;
}
return mac;
}
-static void *evp_mac_from_dispatch(const char *name, const OSSL_DISPATCH *fns,
- OSSL_PROVIDER *prov, void *unused)
+static void *evp_mac_from_dispatch(int name_id,
+ const OSSL_DISPATCH *fns,
+ OSSL_PROVIDER *prov,
+ void *unused)
{
EVP_MAC *mac = NULL;
int fnmaccnt = 0, fnctxcnt = 0;
{
EVP_MAC *mac = NULL;
int fnmaccnt = 0, fnctxcnt = 0;
- if ((mac = evp_mac_new()) == NULL
- || (mac->name = OPENSSL_strdup(name)) == NULL) {
- EVP_MAC_free(mac);
+ if ((mac = evp_mac_new()) == NULL) {
EVPerr(0, ERR_R_MALLOC_FAILURE);
return NULL;
}
EVPerr(0, ERR_R_MALLOC_FAILURE);
return NULL;
}
+ mac->name_id = name_id;
for (; fns->function_id != 0; fns++) {
switch (fns->function_id) {
for (; fns->function_id != 0; fns++) {
switch (fns->function_id) {
@@
-170,7
+170,7
@@
void EVP_MAC_free(EVP_MAC *mac)
const char *EVP_MAC_name(const EVP_MAC *mac)
{
const char *EVP_MAC_name(const EVP_MAC *mac)
{
- return
mac->name
;
+ return
evp_first_name(mac->prov, mac->name_id)
;
}
const OSSL_PROVIDER *EVP_MAC_provider(const EVP_MAC *mac)
}
const OSSL_PROVIDER *EVP_MAC_provider(const EVP_MAC *mac)