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()
1213 kfree(rx->skey); in tipc_crypto_key_flush()
1214 rx->skey = NULL; in tipc_crypto_key_flush()
1869 rx->nokey = !(rx->skey || in tipc_crypto_rcv()
2229 static int tipc_crypto_key_xmit(struct net *net, struct tipc_aead_key *skey, in tipc_crypto_key_xmit() argument
2239 size = tipc_aead_key_size(skey); in tipc_crypto_key_xmit()
2252 *((__be32 *)(data + TIPC_AEAD_ALG_NAME)) = htonl(skey->keylen); in tipc_crypto_key_xmit()
2253 memcpy(data, skey->alg_name, TIPC_AEAD_ALG_NAME); in tipc_crypto_key_xmit()
2254 memcpy(data + TIPC_AEAD_ALG_NAME + sizeof(__be32), skey->key, in tipc_crypto_key_xmit()
2255 skey->keylen); in tipc_crypto_key_xmit()
2281 struct tipc_aead_key *skey = NULL; in tipc_crypto_key_rcv() local
2303 if (unlikely(rx->skey || (key_gen == rx->key_gen && rx->key.keys))) { in tipc_crypto_key_rcv()
2305 rx->skey, key_gen, rx->key_gen); in tipc_crypto_key_rcv()
2310 skey = kmalloc(size, GFP_ATOMIC); in tipc_crypto_key_rcv()
2311 if (unlikely(!skey)) { in tipc_crypto_key_rcv()
2317 skey->keylen = keylen; in tipc_crypto_key_rcv()
2318 memcpy(skey->alg_name, data, TIPC_AEAD_ALG_NAME); in tipc_crypto_key_rcv()
2319 memcpy(skey->key, data + TIPC_AEAD_ALG_NAME + sizeof(__be32), in tipc_crypto_key_rcv()
2320 skey->keylen); in tipc_crypto_key_rcv()
2324 rx->skey = skey; in tipc_crypto_key_rcv()
2333 if (likely(skey && queue_delayed_work(tx->wq, &rx->work, 0))) in tipc_crypto_key_rcv()
2375 if (rx->skey) { in tipc_crypto_work_rx()
2376 rc = tipc_crypto_key_init(rx, rx->skey, rx->skey_mode, false); in tipc_crypto_work_rx()
2388 kfree(rx->skey); in tipc_crypto_work_rx()
2389 rx->skey = NULL; in tipc_crypto_work_rx()
2439 struct tipc_aead_key *skey = NULL; in tipc_crypto_work_tx() local
2457 skey = kmemdup(aead->key, tipc_aead_key_size(aead->key), GFP_ATOMIC); in tipc_crypto_work_tx()
2461 if (likely(skey)) { in tipc_crypto_work_tx()
2462 rc = tipc_aead_key_generate(skey) ?: in tipc_crypto_work_tx()
2463 tipc_crypto_key_init(tx, skey, PER_NODE_KEY, false); in tipc_crypto_work_tx()
2466 kfree_sensitive(skey); in tipc_crypto_work_tx()