summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-01-21 15:32:00 +0100
committerJustus Winter <justus@sequoia-pgp.org>2020-01-21 15:32:00 +0100
commit1b82b84298cedc59e0d66e1a6b549854efd924f0 (patch)
tree9b2f6e9954ffa752cf0b2331f488daee30edba19
parent25636524f825634dea803b35e0dba91d84750bd5 (diff)
openpgp: Avoid trivial uses of Cert::primary_key.
-rw-r--r--openpgp/src/autocrypt.rs2
-rw-r--r--openpgp/src/cert/mod.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/openpgp/src/autocrypt.rs b/openpgp/src/autocrypt.rs
index 4993d028..20c91524 100644
--- a/openpgp/src/autocrypt.rs
+++ b/openpgp/src/autocrypt.rs
@@ -952,7 +952,7 @@ In the light of the Efail vulnerability I am asking myself if it's
let cert = ac.headers[0].key.as_ref()
.expect("Failed to parse key material.");
- assert_eq!(cert.primary_key().fingerprint(),
+ assert_eq!(cert.fingerprint(),
Fingerprint::from_hex(
&"4F9F89F5505AC1D1A260631CDB1187B9DD5F693B"[..]).unwrap());
assert_eq!(cert.userids().next().unwrap().value(),
diff --git a/openpgp/src/cert/mod.rs b/openpgp/src/cert/mod.rs
index 0af68787..3f702e0f 100644
--- a/openpgp/src/cert/mod.rs
+++ b/openpgp/src/cert/mod.rs
@@ -1118,7 +1118,7 @@ impl Cert {
if self.bad.len() > 0 {
t!("{}: ignoring {} bad self-signatures",
- self.primary_key().keyid(), self.bad.len());
+ self.keyid(), self.bad.len());
}
// Only keep user ids / user attributes / subkeys with at
@@ -2050,7 +2050,7 @@ mod test {
.build(&mut keypair, &cert, None)
.unwrap();
assert_eq!(sig.typ(), SignatureType::KeyRevocation);
- assert_eq!(sig.issuer(), Some(&cert.primary_key().keyid()));
+ assert_eq!(sig.issuer(), Some(&cert.keyid()));
assert_eq!(sig.issuer_fingerprint(),
Some(&cert.fingerprint()));