correct some patterns

This commit is contained in:
Simon Wicky
2023-08-29 16:54:14 +02:00
parent 0f0f7d43c4
commit d7a290a9c9
+3 -13
View File
@@ -75,27 +75,17 @@ impl NoisePattern {
fn as_str(&self) -> &'static str {
match self {
Self::XKpsk3 => "Noise_XKpsk3_25519_AESGCM_SHA256",
Self::IKpsk2 => "Noise_IKpsk2_25519_AESGCM_SHA256",
Self::IKpsk2 => "Noise_IKpsk2_25519_ChaChaPoly_BLAKE2s", //Wireguard handshake
//DEMO MODE, TO BE DELETED
Self::NN => "Noise_NN_25519_AESGCM_SHA256",
Self::XXpsk0 => "Noise_XXpsk0_25519_AESGCM_SHA256",
Self::XKpsk3Var => "Noise_XKpsk3_25519_ChaChaPoly_Blake2b",
Self::XKpsk3Var => "Noise_XKpsk3_25519_ChaChaPoly_BLAKE2s",
}
}
fn psk_position(&self) -> u8 {
// match self {
// Self::XKpsk3 => 3,
// Self::IKpsk2 => 2,
// //DEMO MODE, TO BE DELETED
// Self::NN => 0, //psk will not be used anyway
// Self::XXpsk0 => 0,
// Self::XKpsk3Var => 3,
// }
//automatic parsing, works for correct pattern, more convenient, might be slower though
//automatic parsing, works for correct pattern, more convenient
match self.as_str().find("psk") {
Some(n) => {
let psk_index = n + 3;