unsigned long flags;
struct crypto_blkcipher *tfm_aes;
+ struct crypto_hash *tfm_cmac;
};
static inline void swap_buf(const u8 *src, u8 *dst, size_t len)
kfree(smp->slave_csrk);
crypto_free_blkcipher(smp->tfm_aes);
+ crypto_free_hash(smp->tfm_cmac);
/* If pairing failed clean up any keys we might have */
if (!complete) {
return NULL;
}
+ smp->tfm_cmac = crypto_alloc_hash("cmac(aes)", 0, CRYPTO_ALG_ASYNC);
+ if (IS_ERR(smp->tfm_cmac)) {
+ BT_ERR("Unable to create CMAC crypto context");
+ crypto_free_blkcipher(smp->tfm_aes);
+ kfree(smp);
+ return NULL;
+ }
+
smp->conn = conn;
chan->data = smp;