summary refs log tree commit diff
path: root/crypto/src/openpgp/PgpObjectFactory.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/openpgp/PgpObjectFactory.cs')
-rw-r--r--crypto/src/openpgp/PgpObjectFactory.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/crypto/src/openpgp/PgpObjectFactory.cs b/crypto/src/openpgp/PgpObjectFactory.cs
index 1f1c32c83..c67c7ccd1 100644
--- a/crypto/src/openpgp/PgpObjectFactory.cs
+++ b/crypto/src/openpgp/PgpObjectFactory.cs
@@ -50,6 +50,12 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp
                         {
                             l.Add(new PgpSignature(bcpgIn));
                         }
+                        catch (UnsupportedPacketVersionException e)
+                        {
+                            // Signatures of unsupported version MUST BE ignored
+                            // see: https://tests.sequoia-pgp.org/#Detached_signatures_with_unknown_packets
+                            continue;
+                        }
                         catch (PgpException e)
                         {
                             throw new IOException("can't create signature object: " + e);
@@ -61,7 +67,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp
                     {
                         sigs[i] = (PgpSignature)l[i];
                     }
-					return new PgpSignatureList(sigs);
+                    return new PgpSignatureList(sigs);
                 }
                 case PacketTag.SecretKey:
                     try