diff options
author | Kai Michaelis <kai@sequoia-pgp.org> | 2018-04-23 18:29:30 +0200 |
---|---|---|
committer | Kai Michaelis <kai@sequoia-pgp.org> | 2018-04-23 18:32:22 +0200 |
commit | d1345c3ffbf460f3007f063a989c795cdb50318b (patch) | |
tree | 2fedaabe45e4bf1c4e384aeeb2b65509dcd3d258 /tool | |
parent | d6918cb480869e8ef911cf57dec63edbacf2ca94 (diff) |
openpgp: Enums for various alogrithms
Adds enums for cryptographic and compression algorithms. Functions that
operate on algo identifiers are now member functions (hash_context ->
HashAlgo::context()).
The identifiers support convertions from and to u8 as well as Display.
Diffstat (limited to 'tool')
-rw-r--r-- | tool/src/main.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tool/src/main.rs b/tool/src/main.rs index 0f9af6d6..6c7f725e 100644 --- a/tool/src/main.rs +++ b/tool/src/main.rs @@ -75,7 +75,7 @@ fn decrypt(input: &mut io::Read, output: &mut io::Write, dump: bool) let pass = rpassword::prompt_password_stderr( "Enter passphrase to decrypt message: ")?; match skesk.decrypt(pass.into_bytes().as_ref()) { - Ok((algo, key)) => State::Decrypted(algo, key), + Ok((algo, key)) => State::Decrypted(algo.into(), key), Err(e) => { eprintln!("Decryption failed: {}", e); State::Start @@ -88,7 +88,7 @@ fn decrypt(input: &mut io::Read, output: &mut io::Write, dump: bool) // Look for an SEIP packet. State::Decrypted(algo, key) => if let Packet::SEIP(_) = pp.packet { - pp.decrypt(algo, &key[..])?; + pp.decrypt(algo.into(), &key[..])?; State::Deciphered } else { State::Decrypted(algo, key) |