diff --git a/pgpainless-cert-d/src/main/java/org/pgpainless/certificate_store/KeyMaterialReader.java b/pgpainless-cert-d/src/main/java/org/pgpainless/certificate_store/KeyMaterialReader.java index 112bf18..8ba3b9d 100644 --- a/pgpainless-cert-d/src/main/java/org/pgpainless/certificate_store/KeyMaterialReader.java +++ b/pgpainless-cert-d/src/main/java/org/pgpainless/certificate_store/KeyMaterialReader.java @@ -23,8 +23,13 @@ public class KeyMaterialReader implements KeyMaterialReaderBackend { try { keyMaterial = PGPainless.readKeyRing().keyRing(data); } catch (IOException e) { - if (e.getMessage().contains("unknown object in stream") || - e.getMessage().contains("unexpected end of file in armored stream.")) { + String msg = e.getMessage(); + if (msg == null) { + throw e; + } + if (msg.contains("unknown object in stream") || + msg.contains("unexpected end of file in armored stream.") || + msg.contains("invalid header encountered")) { throw new BadDataException(); } else { throw e; diff --git a/version.gradle b/version.gradle index 024bca2..4425a52 100644 --- a/version.gradle +++ b/version.gradle @@ -12,7 +12,7 @@ allprojects { logbackVersion = '1.2.11' junitVersion = '5.8.2' mockitoVersion = '4.5.1' - pgpainlessVersion = '1.3.5' + pgpainlessVersion = '1.3.12' pgpCertDJavaVersion = '0.2.1' picocliVersion = '4.6.3' }