• Home
  • Raw
  • Download

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()
1217 kfree(rx->skey); in tipc_crypto_key_flush()
1218 rx->skey = NULL; in tipc_crypto_key_flush()
1873 rx->nokey = !(rx->skey || in tipc_crypto_rcv()
2232 static int tipc_crypto_key_xmit(struct net *net, struct tipc_aead_key *skey, in tipc_crypto_key_xmit() argument
2242 size = tipc_aead_key_size(skey); in tipc_crypto_key_xmit()
2255 *((__be32 *)(data + TIPC_AEAD_ALG_NAME)) = htonl(skey->keylen); in tipc_crypto_key_xmit()
2256 memcpy(data, skey->alg_name, TIPC_AEAD_ALG_NAME); in tipc_crypto_key_xmit()
2257 memcpy(data + TIPC_AEAD_ALG_NAME + sizeof(__be32), skey->key, in tipc_crypto_key_xmit()
2258 skey->keylen); in tipc_crypto_key_xmit()
2284 struct tipc_aead_key *skey = NULL; in tipc_crypto_key_rcv() local
2306 if (unlikely(rx->skey || (key_gen == rx->key_gen && rx->key.keys))) { in tipc_crypto_key_rcv()
2308 rx->skey, key_gen, rx->key_gen); in tipc_crypto_key_rcv()
2313 skey = kmalloc(size, GFP_ATOMIC); in tipc_crypto_key_rcv()
2314 if (unlikely(!skey)) { in tipc_crypto_key_rcv()
2320 skey->keylen = keylen; in tipc_crypto_key_rcv()
2321 memcpy(skey->alg_name, data, TIPC_AEAD_ALG_NAME); in tipc_crypto_key_rcv()
2322 memcpy(skey->key, data + TIPC_AEAD_ALG_NAME + sizeof(__be32), in tipc_crypto_key_rcv()
2323 skey->keylen); in tipc_crypto_key_rcv()
2327 rx->skey = skey; in tipc_crypto_key_rcv()
2336 if (likely(skey && queue_delayed_work(tx->wq, &rx->work, 0))) in tipc_crypto_key_rcv()
2378 if (rx->skey) { in tipc_crypto_work_rx()
2379 rc = tipc_crypto_key_init(rx, rx->skey, rx->skey_mode, false); in tipc_crypto_work_rx()
2391 kfree(rx->skey); in tipc_crypto_work_rx()
2392 rx->skey = NULL; in tipc_crypto_work_rx()
2442 struct tipc_aead_key *skey = NULL; in tipc_crypto_work_tx() local
2460 skey = kmemdup(aead->key, tipc_aead_key_size(aead->key), GFP_ATOMIC); in tipc_crypto_work_tx()
2464 if (likely(skey)) { in tipc_crypto_work_tx()
2465 rc = tipc_aead_key_generate(skey) ?: in tipc_crypto_work_tx()
2466 tipc_crypto_key_init(tx, skey, PER_NODE_KEY, false); in tipc_crypto_work_tx()
2469 kfree_sensitive(skey); in tipc_crypto_work_tx()