Lines Matching refs:skey

211 	struct tipc_aead_key *skey;  member
303 static int tipc_crypto_key_xmit(struct net *net, struct tipc_aead_key *skey,
308 static int tipc_aead_key_generate(struct tipc_aead_key *skey);
368 static int tipc_aead_key_generate(struct tipc_aead_key *skey) in tipc_aead_key_generate() argument
375 rc = crypto_rng_get_bytes(crypto_default_rng, skey->key, in tipc_aead_key_generate()
376 skey->keylen); in tipc_aead_key_generate()
1224 kfree(rx->skey); in tipc_crypto_key_flush()
1225 rx->skey = NULL; in tipc_crypto_key_flush()
1880 rx->nokey = !(rx->skey || in tipc_crypto_rcv()
2236 static int tipc_crypto_key_xmit(struct net *net, struct tipc_aead_key *skey, in tipc_crypto_key_xmit() argument
2246 size = tipc_aead_key_size(skey); in tipc_crypto_key_xmit()
2259 *((__be32 *)(data + TIPC_AEAD_ALG_NAME)) = htonl(skey->keylen); in tipc_crypto_key_xmit()
2260 memcpy(data, skey->alg_name, TIPC_AEAD_ALG_NAME); in tipc_crypto_key_xmit()
2261 memcpy(data + TIPC_AEAD_ALG_NAME + sizeof(__be32), skey->key, in tipc_crypto_key_xmit()
2262 skey->keylen); in tipc_crypto_key_xmit()
2288 struct tipc_aead_key *skey = NULL; in tipc_crypto_key_rcv() local
2310 if (unlikely(rx->skey || (key_gen == rx->key_gen && rx->key.keys))) { in tipc_crypto_key_rcv()
2312 rx->skey, key_gen, rx->key_gen); in tipc_crypto_key_rcv()
2317 skey = kmalloc(size, GFP_ATOMIC); in tipc_crypto_key_rcv()
2318 if (unlikely(!skey)) { in tipc_crypto_key_rcv()
2324 skey->keylen = keylen; in tipc_crypto_key_rcv()
2325 memcpy(skey->alg_name, data, TIPC_AEAD_ALG_NAME); in tipc_crypto_key_rcv()
2326 memcpy(skey->key, data + TIPC_AEAD_ALG_NAME + sizeof(__be32), in tipc_crypto_key_rcv()
2327 skey->keylen); in tipc_crypto_key_rcv()
2331 rx->skey = skey; in tipc_crypto_key_rcv()
2340 if (likely(skey && queue_delayed_work(tx->wq, &rx->work, 0))) in tipc_crypto_key_rcv()
2382 if (rx->skey) { in tipc_crypto_work_rx()
2383 rc = tipc_crypto_key_init(rx, rx->skey, rx->skey_mode, false); in tipc_crypto_work_rx()
2395 kfree(rx->skey); in tipc_crypto_work_rx()
2396 rx->skey = NULL; in tipc_crypto_work_rx()
2446 struct tipc_aead_key *skey = NULL; in tipc_crypto_work_tx() local
2464 skey = kmemdup(aead->key, tipc_aead_key_size(aead->key), GFP_ATOMIC); in tipc_crypto_work_tx()
2468 if (likely(skey)) { in tipc_crypto_work_tx()
2469 rc = tipc_aead_key_generate(skey) ?: in tipc_crypto_work_tx()
2470 tipc_crypto_key_init(tx, skey, PER_NODE_KEY, false); in tipc_crypto_work_tx()
2473 kfree_sensitive(skey); in tipc_crypto_work_tx()