diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2018-08-13 15:12:05 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2018-08-13 15:15:47 +0200 |
commit | 93264c6d4a171920ba496c9ac5d2ce5d91b31052 (patch) | |
tree | 356cdeabb893b5abb0ca221eb8fc74fc63deb577 /net | |
parent | 5d7320392a0ae925414fe17d2dc0fc9d01fd67af (diff) |
openpgp: Rework armor kind handling.
- Instead of having Kind::Any, use an Option<Kind> where
appropriate.
Diffstat (limited to 'net')
-rw-r--r-- | net/src/async.rs | 2 | ||||
-rw-r--r-- | net/tests/hkp.rs | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/net/src/async.rs b/net/src/async.rs index 7af6f2ae..77ec00bc 100644 --- a/net/src/async.rs +++ b/net/src/async.rs @@ -130,7 +130,7 @@ impl KeyServer { StatusCode::OK => { let c = Cursor::new(body.as_ref()); let r = armor::Reader::new( - c, armor::Kind::PublicKey); + c, Some(armor::Kind::PublicKey)); future::done(TPK::from_reader(r)) }, StatusCode::NOT_FOUND => diff --git a/net/tests/hkp.rs b/net/tests/hkp.rs index 4acbf56d..cbb86532 100644 --- a/net/tests/hkp.rs +++ b/net/tests/hkp.rs @@ -22,7 +22,7 @@ extern crate openpgp; extern crate sequoia_core; extern crate sequoia_net; -use openpgp::armor::{Reader, Kind}; +use openpgp::armor::Reader; use openpgp::TPK; use openpgp::{Fingerprint, KeyID}; use sequoia_core::{Context, NetworkPolicy}; @@ -92,7 +92,7 @@ fn service(req: Request<Body>) "keytext" => { let key = TPK::from_reader( Reader::new(Cursor::new(value.into_owned()), - Kind::Any)).unwrap(); + None)).unwrap(); assert_eq!( key.fingerprint(), Fingerprint::from_hex(FP) @@ -171,6 +171,6 @@ fn send() { let mut keyserver = KeyServer::new(&ctx, &format!("hkp://{}", addr)).unwrap(); let key = TPK::from_reader(Reader::new(Cursor::new(RESPONSE), - Kind::Any)).unwrap(); + None)).unwrap(); keyserver.send(&key).unwrap(); } |