Lines Matching defs:keypair
126 struct noise_keypair *keypair;
130 keypair = rcu_dereference_bh(peer->keypairs.current_keypair);
131 send = keypair && READ_ONCE(keypair->sending.is_valid) &&
132 (atomic64_read(&keypair->sending_counter) > REKEY_AFTER_MESSAGES ||
133 (keypair->i_am_the_initiator &&
134 wg_birthdate_has_expired(keypair->sending.birthdate, REKEY_AFTER_TIME)));
162 static bool encrypt_packet(struct sk_buff *skb, struct noise_keypair *keypair)
207 header->key_idx = keypair->remote_index;
218 keypair->sending.key);
265 struct noise_keypair *keypair;
273 keypair = PACKET_CB(first)->keypair;
280 wg_noise_keypair_put(keypair, false);
298 PACKET_CB(first)->keypair))) {
328 wg_noise_keypair_put(PACKET_CB(first)->keypair, false);
344 struct noise_keypair *keypair;
358 keypair = wg_noise_keypair_get(
361 if (unlikely(!keypair))
363 if (unlikely(!READ_ONCE(keypair->sending.is_valid)))
365 if (unlikely(wg_birthdate_has_expired(keypair->sending.birthdate,
380 atomic64_inc_return(&keypair->sending_counter) - 1;
386 wg_peer_get(keypair->entry.peer);
387 PACKET_CB(packets.next)->keypair = keypair;
392 WRITE_ONCE(keypair->sending.is_valid, false);
394 wg_noise_keypair_put(keypair, false);