Lines Matching refs:keypair

126 	struct noise_keypair *keypair;  in keep_key_fresh()  local
130 keypair = rcu_dereference_bh(peer->keypairs.current_keypair); in keep_key_fresh()
131 send = keypair && READ_ONCE(keypair->sending.is_valid) && in keep_key_fresh()
132 (atomic64_read(&keypair->sending_counter) > REKEY_AFTER_MESSAGES || in keep_key_fresh()
133 (keypair->i_am_the_initiator && in keep_key_fresh()
134 wg_birthdate_has_expired(keypair->sending.birthdate, REKEY_AFTER_TIME))); in keep_key_fresh()
162 static bool encrypt_packet(struct sk_buff *skb, struct noise_keypair *keypair) in encrypt_packet() argument
207 header->key_idx = keypair->remote_index; in encrypt_packet()
218 keypair->sending.key); in encrypt_packet()
265 struct noise_keypair *keypair; in wg_packet_tx_worker() local
273 keypair = PACKET_CB(first)->keypair; in wg_packet_tx_worker()
280 wg_noise_keypair_put(keypair, false); in wg_packet_tx_worker()
298 PACKET_CB(first)->keypair))) { in wg_packet_encrypt_worker()
328 wg_noise_keypair_put(PACKET_CB(first)->keypair, false); in wg_packet_create_data()
343 struct noise_keypair *keypair; in wg_packet_send_staged_packets() local
357 keypair = wg_noise_keypair_get( in wg_packet_send_staged_packets()
360 if (unlikely(!keypair)) in wg_packet_send_staged_packets()
362 if (unlikely(!READ_ONCE(keypair->sending.is_valid))) in wg_packet_send_staged_packets()
364 if (unlikely(wg_birthdate_has_expired(keypair->sending.birthdate, in wg_packet_send_staged_packets()
379 atomic64_inc_return(&keypair->sending_counter) - 1; in wg_packet_send_staged_packets()
385 wg_peer_get(keypair->entry.peer); in wg_packet_send_staged_packets()
386 PACKET_CB(packets.next)->keypair = keypair; in wg_packet_send_staged_packets()
391 WRITE_ONCE(keypair->sending.is_valid, false); in wg_packet_send_staged_packets()
393 wg_noise_keypair_put(keypair, false); in wg_packet_send_staged_packets()