mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-27 06:42:05 +01:00
Prevent IllegalArgumentException for non-v4 issuer fingerprints
This commit is contained in:
parent
b674a412b5
commit
99ff6d537b
1 changed files with 7 additions and 3 deletions
|
@ -78,7 +78,7 @@ public class SignatureSubpacketsUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the {@link IssuerFingerprint} subpacket of the signature into a {@link OpenPgpV4Fingerprint}.
|
* Return the {@link IssuerFingerprint} subpacket of the signature into a {@link OpenPgpV4Fingerprint}.
|
||||||
* If no issuer fingerprint is present in the signature, return null.
|
* If no v4 issuer fingerprint is present in the signature, return null.
|
||||||
*
|
*
|
||||||
* @param signature signature
|
* @param signature signature
|
||||||
* @return v4 fingerprint of the issuer, or null
|
* @return v4 fingerprint of the issuer, or null
|
||||||
|
@ -88,9 +88,13 @@ public class SignatureSubpacketsUtil {
|
||||||
if (subpacket == null) {
|
if (subpacket == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (subpacket.getKeyVersion() == 4) {
|
||||||
OpenPgpV4Fingerprint fingerprint = new OpenPgpV4Fingerprint(Hex.encode(subpacket.getFingerprint()));
|
OpenPgpV4Fingerprint fingerprint = new OpenPgpV4Fingerprint(Hex.encode(subpacket.getFingerprint()));
|
||||||
return fingerprint;
|
return fingerprint;
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the issuer key-id subpacket of the signature.
|
* Return the issuer key-id subpacket of the signature.
|
||||||
|
|
Loading…
Reference in a new issue