Lines Matching refs:skey

207 	struct tipc_aead_key *skey;  member
299 static int tipc_crypto_key_xmit(struct net *net, struct tipc_aead_key *skey,
304 static int tipc_aead_key_generate(struct tipc_aead_key *skey);
362 static int tipc_aead_key_generate(struct tipc_aead_key *skey) in tipc_aead_key_generate() argument
369 rc = crypto_rng_get_bytes(crypto_default_rng, skey->key, in tipc_aead_key_generate()
370 skey->keylen); in tipc_aead_key_generate()
1219 kfree(rx->skey); in tipc_crypto_key_flush()
1220 rx->skey = NULL; in tipc_crypto_key_flush()
1873 rx->nokey = !(rx->skey || in tipc_crypto_rcv()
2228 static int tipc_crypto_key_xmit(struct net *net, struct tipc_aead_key *skey, in tipc_crypto_key_xmit() argument
2238 size = tipc_aead_key_size(skey); in tipc_crypto_key_xmit()
2251 *((__be32 *)(data + TIPC_AEAD_ALG_NAME)) = htonl(skey->keylen); in tipc_crypto_key_xmit()
2252 memcpy(data, skey->alg_name, TIPC_AEAD_ALG_NAME); in tipc_crypto_key_xmit()
2253 memcpy(data + TIPC_AEAD_ALG_NAME + sizeof(__be32), skey->key, in tipc_crypto_key_xmit()
2254 skey->keylen); in tipc_crypto_key_xmit()
2280 struct tipc_aead_key *skey = NULL; in tipc_crypto_key_rcv() local
2286 if (unlikely(rx->skey || (key_gen == rx->key_gen && rx->key.keys))) { in tipc_crypto_key_rcv()
2288 rx->skey, key_gen, rx->key_gen); in tipc_crypto_key_rcv()
2293 skey = kmalloc(size, GFP_ATOMIC); in tipc_crypto_key_rcv()
2294 if (unlikely(!skey)) { in tipc_crypto_key_rcv()
2300 skey->keylen = ntohl(*((__be32 *)(data + TIPC_AEAD_ALG_NAME))); in tipc_crypto_key_rcv()
2301 memcpy(skey->alg_name, data, TIPC_AEAD_ALG_NAME); in tipc_crypto_key_rcv()
2302 memcpy(skey->key, data + TIPC_AEAD_ALG_NAME + sizeof(__be32), in tipc_crypto_key_rcv()
2303 skey->keylen); in tipc_crypto_key_rcv()
2306 if (unlikely(size != tipc_aead_key_size(skey))) { in tipc_crypto_key_rcv()
2307 kfree(skey); in tipc_crypto_key_rcv()
2308 skey = NULL; in tipc_crypto_key_rcv()
2314 rx->skey = skey; in tipc_crypto_key_rcv()
2322 if (likely(skey && queue_delayed_work(tx->wq, &rx->work, 0))) in tipc_crypto_key_rcv()
2364 if (rx->skey) { in tipc_crypto_work_rx()
2365 rc = tipc_crypto_key_init(rx, rx->skey, rx->skey_mode, false); in tipc_crypto_work_rx()
2377 kfree(rx->skey); in tipc_crypto_work_rx()
2378 rx->skey = NULL; in tipc_crypto_work_rx()
2428 struct tipc_aead_key *skey = NULL; in tipc_crypto_work_tx() local
2446 skey = kmemdup(aead->key, tipc_aead_key_size(aead->key), GFP_ATOMIC); in tipc_crypto_work_tx()
2450 if (likely(skey)) { in tipc_crypto_work_tx()
2451 rc = tipc_aead_key_generate(skey) ?: in tipc_crypto_work_tx()
2452 tipc_crypto_key_init(tx, skey, PER_NODE_KEY, false); in tipc_crypto_work_tx()
2455 kfree_sensitive(skey); in tipc_crypto_work_tx()