Skip to content

Commit

Permalink
key::start_pake(): fix the argument order, closing a security bug
Browse files Browse the repository at this point in the history
See https://github.com/warner/magic-wormhole.rs/issues/32 for details. This
would have enabled a cheap online man-in-the-middle attack. The buggy version
would interoperate silently with itself (although it wouldn't have spoken to
the Python version, so we probably would have caught it pretty quickly).
  • Loading branch information
warner committed May 27, 2018
1 parent fb595ac commit 3bde52c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl KeyMachine {
}
}

fn start_pake(appid: &str, code: &str) -> (SPAKE2<Ed25519Group>, Vec<u8>) {
fn start_pake(code: &Code, appid: &str) -> (SPAKE2<Ed25519Group>, Vec<u8>) {
let (pake_state, msg1) = SPAKE2::<Ed25519Group>::start_symmetric(
code.as_bytes(),
appid.as_bytes(),
Expand Down

0 comments on commit 3bde52c

Please sign in to comment.