Lines Matching refs:mackey
67 MAC_KEY *mackey; in ossl_mac_key_new() local
72 mackey = OPENSSL_zalloc(sizeof(*mackey)); in ossl_mac_key_new()
73 if (mackey == NULL) in ossl_mac_key_new()
76 mackey->lock = CRYPTO_THREAD_lock_new(); in ossl_mac_key_new()
77 if (mackey->lock == NULL) { in ossl_mac_key_new()
78 OPENSSL_free(mackey); in ossl_mac_key_new()
81 mackey->libctx = libctx; in ossl_mac_key_new()
82 mackey->refcnt = 1; in ossl_mac_key_new()
83 mackey->cmac = cmac; in ossl_mac_key_new()
85 return mackey; in ossl_mac_key_new()
88 void ossl_mac_key_free(MAC_KEY *mackey) in ossl_mac_key_free() argument
92 if (mackey == NULL) in ossl_mac_key_free()
95 CRYPTO_DOWN_REF(&mackey->refcnt, &ref, mackey->lock); in ossl_mac_key_free()
99 OPENSSL_secure_clear_free(mackey->priv_key, mackey->priv_key_len); in ossl_mac_key_free()
100 OPENSSL_free(mackey->properties); in ossl_mac_key_free()
101 ossl_prov_cipher_reset(&mackey->cipher); in ossl_mac_key_free()
102 CRYPTO_THREAD_lock_free(mackey->lock); in ossl_mac_key_free()
103 OPENSSL_free(mackey); in ossl_mac_key_free()
106 int ossl_mac_key_up_ref(MAC_KEY *mackey) in ossl_mac_key_up_ref() argument
120 CRYPTO_UP_REF(&mackey->refcnt, &ref, mackey->lock); in ossl_mac_key_up_ref()
134 static void mac_free(void *mackey) in mac_free() argument
136 ossl_mac_key_free(mackey); in mac_free()