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()
267 struct noise_keypair *keypair; in wg_packet_tx_worker() local
277 keypair = PACKET_CB(first)->keypair; in wg_packet_tx_worker()
284 wg_noise_keypair_put(keypair, false); in wg_packet_tx_worker()
302 PACKET_CB(first)->keypair))) { in wg_packet_encrypt_worker()
337 wg_noise_keypair_put(PACKET_CB(first)->keypair, false); in wg_packet_create_data()
352 struct noise_keypair *keypair; in wg_packet_send_staged_packets() local
366 keypair = wg_noise_keypair_get( in wg_packet_send_staged_packets()
369 if (unlikely(!keypair)) in wg_packet_send_staged_packets()
371 if (unlikely(!READ_ONCE(keypair->sending.is_valid))) in wg_packet_send_staged_packets()
373 if (unlikely(wg_birthdate_has_expired(keypair->sending.birthdate, in wg_packet_send_staged_packets()
388 atomic64_inc_return(&keypair->sending_counter) - 1; in wg_packet_send_staged_packets()
394 wg_peer_get(keypair->entry.peer); in wg_packet_send_staged_packets()
395 PACKET_CB(packets.next)->keypair = keypair; in wg_packet_send_staged_packets()
400 WRITE_ONCE(keypair->sending.is_valid, false); in wg_packet_send_staged_packets()
402 wg_noise_keypair_put(keypair, false); in wg_packet_send_staged_packets()