Lines Matching refs:mackey
66 MAC_KEY *mackey; in ossl_mac_key_new() local
71 mackey = OPENSSL_zalloc(sizeof(*mackey)); in ossl_mac_key_new()
72 if (mackey == NULL) in ossl_mac_key_new()
75 mackey->lock = CRYPTO_THREAD_lock_new(); in ossl_mac_key_new()
76 if (mackey->lock == NULL) { in ossl_mac_key_new()
77 OPENSSL_free(mackey); in ossl_mac_key_new()
80 mackey->libctx = libctx; in ossl_mac_key_new()
81 mackey->refcnt = 1; in ossl_mac_key_new()
82 mackey->cmac = cmac; in ossl_mac_key_new()
84 return mackey; in ossl_mac_key_new()
87 void ossl_mac_key_free(MAC_KEY *mackey) in ossl_mac_key_free() argument
91 if (mackey == NULL) in ossl_mac_key_free()
94 CRYPTO_DOWN_REF(&mackey->refcnt, &ref, mackey->lock); in ossl_mac_key_free()
98 OPENSSL_secure_clear_free(mackey->priv_key, mackey->priv_key_len); in ossl_mac_key_free()
99 OPENSSL_free(mackey->properties); in ossl_mac_key_free()
100 ossl_prov_cipher_reset(&mackey->cipher); in ossl_mac_key_free()
101 CRYPTO_THREAD_lock_free(mackey->lock); in ossl_mac_key_free()
102 OPENSSL_free(mackey); in ossl_mac_key_free()
105 int ossl_mac_key_up_ref(MAC_KEY *mackey) in ossl_mac_key_up_ref() argument
119 CRYPTO_UP_REF(&mackey->refcnt, &ref, mackey->lock); in ossl_mac_key_up_ref()
133 static void mac_free(void *mackey) in mac_free() argument
135 ossl_mac_key_free(mackey); in mac_free()