diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-08-28 12:14:32 +0200 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-08-28 12:14:32 +0200 |
commit | 8e1a2cabd355245daa2578d2c934e955a4e2d866 (patch) | |
tree | 200c447b83c5c5af0d94ef571da386fa8c2f401c /src/handshake | |
parent | Start worker threads for device (diff) | |
download | wireguard-rs-8e1a2cabd355245daa2578d2c934e955a4e2d866.tar.xz wireguard-rs-8e1a2cabd355245daa2578d2c934e955a4e2d866.zip |
Renamed confirmed -> initator on keypair
Done to reflect that the property is immutable,
unlike the "confirmed" field on the decryption state.
Diffstat (limited to 'src/handshake')
-rw-r--r-- | src/handshake/device.rs | 10 | ||||
-rw-r--r-- | src/handshake/noise.rs | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/handshake/device.rs b/src/handshake/device.rs index f439414..cf88303 100644 --- a/src/handshake/device.rs +++ b/src/handshake/device.rs @@ -442,7 +442,7 @@ mod tests { // 4. device-2 : responds with noise response let msg_response = match dev2.process(&mut rng, &msg_init, Some(&src1)).unwrap() { (Some(_), Some(msg), Some(kp)) => { - assert_eq!(kp.confirmed, false); + assert_eq!(kp.initiator, false); msg } _ => panic!("unexpected response"), @@ -469,7 +469,7 @@ mod tests { // 7. device-2 : responds with noise response let (msg_response, kp1) = match dev2.process(&mut rng, &msg_init, Some(&src1)).unwrap() { (Some(_), Some(msg), Some(kp)) => { - assert_eq!(kp.confirmed, false); + assert_eq!(kp.initiator, false); (msg, kp) } _ => panic!("unexpected response"), @@ -478,7 +478,7 @@ mod tests { // device-1 : process noise response let kp2 = match dev1.process(&mut rng, &msg_response, Some(&src2)).unwrap() { (Some(_), None, Some(kp)) => { - assert_eq!(kp.confirmed, true); + assert_eq!(kp.initiator, true); kp } _ => panic!("unexpected response"), @@ -515,7 +515,7 @@ mod tests { println!("msg2 = {} : {} bytes", hex::encode(&msg2[..]), msg2.len()); println!("msg2 = {:?}", Response::parse(&msg2[..]).unwrap()); - assert!(!ks_r.confirmed, "Responders key-pair is confirmed"); + assert!(!ks_r.initiator, "Responders key-pair is confirmed"); // process response and obtain confirmed key-pair @@ -523,7 +523,7 @@ mod tests { let ks_i = ks_i.unwrap(); assert!(msg3.is_none(), "Returned message after response"); - assert!(ks_i.confirmed, "Initiators key-pair is not confirmed"); + assert!(ks_i.initiator, "Initiators key-pair is not confirmed"); assert_eq!(ks_i.send, ks_r.recv, "KeyI.send != KeyR.recv"); assert_eq!(ks_i.recv, ks_r.send, "KeyI.recv != KeyR.send"); diff --git a/src/handshake/noise.rs b/src/handshake/noise.rs index 2f8f67e..8e8f517 100644 --- a/src/handshake/noise.rs +++ b/src/handshake/noise.rs @@ -457,7 +457,7 @@ pub fn create_response<T: Copy, R: RngCore + CryptoRng>( Ok(KeyPair { birth: Instant::now(), - confirmed: false, + initiator: false, send: Key { id: sender, key: key_send.into(), @@ -532,7 +532,7 @@ pub fn consume_response<T: Copy>( None, // no response message Some(KeyPair { birth: Instant::now(), - confirmed: true, + initiator: true, send: Key { id: sender, key: key_send.into(), |