1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-26 22:32:07 +01:00

Merge nested if-statements

This commit is contained in:
Paul Schaub 2021-08-15 15:43:19 +02:00
parent 28f6664b29
commit dd941fb293
2 changed files with 6 additions and 12 deletions

View file

@ -149,11 +149,9 @@ public class KeyRingInfo {
} }
if (publicKey == getPublicKey()) { if (publicKey == getPublicKey()) {
if (signatures.primaryKeyRevocation != null) { if (signatures.primaryKeyRevocation != null && SignatureUtils.isHardRevocation(signatures.primaryKeyRevocation)) {
if (SignatureUtils.isHardRevocation(signatures.primaryKeyRevocation)) {
return false; return false;
} }
}
return signatures.primaryKeyRevocation == null; return signatures.primaryKeyRevocation == null;
} }
@ -825,10 +823,8 @@ public class KeyRingInfo {
* @return encryption subkeys * @return encryption subkeys
*/ */
public @Nonnull List<PGPPublicKey> getEncryptionSubkeys(String userId, EncryptionPurpose purpose) { public @Nonnull List<PGPPublicKey> getEncryptionSubkeys(String userId, EncryptionPurpose purpose) {
if (userId != null) { if (userId != null && !isUserIdValid(userId)) {
if (!isUserIdValid(userId)) { throw new KeyValidationError(userId, getLatestUserIdCertification(userId), getUserIdRevocation(userId));
throw new KeyValidationException(userId, getLatestUserIdCertification(userId), getUserIdRevocation(userId));
}
} }
return getEncryptionSubkeys(purpose); return getEncryptionSubkeys(purpose);

View file

@ -308,11 +308,9 @@ public final class SignatureUtils {
if (issuerKeyId != null && issuerKeyId.getKeyID() != 0) { if (issuerKeyId != null && issuerKeyId.getKeyID() != 0) {
return issuerKeyId.getKeyID(); return issuerKeyId.getKeyID();
} }
if (issuerKeyId == null) { if (issuerKeyId == null && fingerprint != null) {
if (fingerprint != null) {
return fingerprint.getKeyId(); return fingerprint.getKeyId();
} }
}
return 0; return 0;
} }