Upgrade to spec compliant noise protocol (#1221)

This commit is contained in:
Pawan Dhananjay
2020-05-29 07:33:30 +05:30
committed by GitHub
parent 91a28e7438
commit d609a3f639
2 changed files with 115 additions and 2 deletions

View File

@@ -474,8 +474,8 @@ fn load_private_key(config: &NetworkConfig, log: &slog::Logger) -> Keypair {
/// Generate authenticated XX Noise config from identity keys
fn generate_noise_config(
identity_keypair: &Keypair,
) -> noise::NoiseAuthenticated<noise::XX, noise::X25519, ()> {
let static_dh_keys = noise::Keypair::<noise::X25519>::new()
) -> noise::NoiseAuthenticated<noise::XX, noise::X25519Spec, ()> {
let static_dh_keys = noise::Keypair::<noise::X25519Spec>::new()
.into_authentic(identity_keypair)
.expect("signing can fail only once during starting a node");
noise::NoiseConfig::xx(static_dh_keys).into_authenticated()