summaryrefslogtreecommitdiffstats
path: root/openpgp/src/parse
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-11-26 17:54:04 +0100
committerJustus Winter <justus@sequoia-pgp.org>2019-11-27 14:09:26 +0100
commit6fa1c0c42d21c7876c594f9c658742f6639f86b9 (patch)
treee38d797dbbf38c7ce5a1c8ca45a04a7ecbe316b6 /openpgp/src/parse
parenta52f66d26bdef3ce9c8948aa058dff39048e16c3 (diff)
openpgp: Fix Signature::get_issuer to return set of issuers.
- A signature can contain multiple hints as to who created the signature. Return all those hints to the caller. - Adapt all callers accordingly. - Fixes #264.
Diffstat (limited to 'openpgp/src/parse')
-rw-r--r--openpgp/src/parse/stream.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/openpgp/src/parse/stream.rs b/openpgp/src/parse/stream.rs
index cca238dc..43120f87 100644
--- a/openpgp/src/parse/stream.rs
+++ b/openpgp/src/parse/stream.rs
@@ -606,8 +606,8 @@ impl<'a, H: VerificationHelper> Verifier<'a, H> {
//
// In this case, we get the issuer from the
// signature itself.
- if let Some(issuer) = sig.get_issuer() {
- issuers.push(issuer);
+ if let Some(issuer) = sig.get_issuers().iter().next() {
+ issuers.push(issuer.clone().into());
} else {
issuers.push(KeyID::wildcard());
}
@@ -656,9 +656,9 @@ impl<'a, H: VerificationHelper> Verifier<'a, H> {
IMessageLayer::SignatureGroup { sigs, .. } => {
results.new_signature_group();
for sig in sigs.into_iter() {
- if let Some(issuer) = sig.get_issuer() {
+ if let Some(issuer) = sig.get_issuers().iter().next() {
let r = if let Some((i, j)) =
- self.keys.get(&issuer)
+ self.keys.get(&issuer.clone().into())
{
let tpk = &self.tpks[*i];
let (binding, revoked, key)
@@ -1421,8 +1421,8 @@ impl<'a, H: VerificationHelper + DecryptionHelper> Decryptor<'a, H> {
//
// In this case, we get the issuer from the
// signature itself.
- if let Some(issuer) = sig.get_issuer() {
- issuers.push(issuer);
+ if let Some(issuer) = sig.get_issuers().iter().next() {
+ issuers.push(issuer.clone().into());
} else {
issuers.push(KeyID::wildcard());
}
@@ -1518,9 +1518,9 @@ impl<'a, H: VerificationHelper + DecryptionHelper> Decryptor<'a, H> {
IMessageLayer::SignatureGroup { sigs, .. } => {
results.new_signature_group();
for sig in sigs.into_iter() {
- if let Some(issuer) = sig.get_issuer() {
+ if let Some(issuer) = sig.get_issuers().iter().next() {
results.push_verification_result(
- if let Some((i, j)) = self.keys.get(&issuer) {
+ if let Some((i, j)) = self.keys.get(&issuer.clone().into()) {
let tpk = &self.tpks[*i];
let (binding, revoked, key)
= tpk.keys_all().nth(*j).unwrap();