Lines Matching refs:keypair

222 	struct noise_keypair *keypair;  in keep_key_fresh()  local
229 keypair = rcu_dereference_bh(peer->keypairs.current_keypair); in keep_key_fresh()
230 send = keypair && READ_ONCE(keypair->sending.is_valid) && in keep_key_fresh()
231 keypair->i_am_the_initiator && in keep_key_fresh()
232 wg_birthdate_has_expired(keypair->sending.birthdate, in keep_key_fresh()
242 static bool decrypt_packet(struct sk_buff *skb, struct noise_keypair *keypair) in decrypt_packet() argument
249 if (unlikely(!keypair)) in decrypt_packet()
252 if (unlikely(!READ_ONCE(keypair->receiving.is_valid) || in decrypt_packet()
253 wg_birthdate_has_expired(keypair->receiving.birthdate, REJECT_AFTER_TIME) || in decrypt_packet()
254 READ_ONCE(keypair->receiving_counter.counter) >= REJECT_AFTER_MESSAGES)) { in decrypt_packet()
255 WRITE_ONCE(keypair->receiving.is_valid, false); in decrypt_packet()
280 keypair->receiving.key)) in decrypt_packet()
346 PACKET_CB(skb)->keypair))) { in wg_packet_consume_data_done()
441 struct noise_keypair *keypair; in wg_packet_rx_poll() local
455 keypair = PACKET_CB(skb)->keypair; in wg_packet_rx_poll()
461 if (unlikely(!counter_validate(&keypair->receiving_counter, in wg_packet_rx_poll()
466 READ_ONCE(keypair->receiving_counter.counter)); in wg_packet_rx_poll()
478 wg_noise_keypair_put(keypair, false); in wg_packet_rx_poll()
501 likely(decrypt_packet(skb, PACKET_CB(skb)->keypair)) ? in wg_packet_decrypt_worker()
516 PACKET_CB(skb)->keypair = in wg_packet_consume_data()
520 if (unlikely(!wg_noise_keypair_get(PACKET_CB(skb)->keypair))) in wg_packet_consume_data()
535 wg_noise_keypair_put(PACKET_CB(skb)->keypair, false); in wg_packet_consume_data()