diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-10-12 17:27:28 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-10-12 17:27:28 +0700 |
commit | c5065a21286ce0755cee38118b1e288898456f7e (patch) | |
tree | e641ffbe5f561c130c39231dd5ee7f4351e03d35 /crypto/src/openpgp/PgpSecretKeyRingBundle.cs | |
parent | completed copy constructor in SignerInformation, fixed mutable issue for SET ... (diff) | |
download | BouncyCastle.NET-ed25519-c5065a21286ce0755cee38118b1e288898456f7e.tar.xz |
Marker packet skipping
Diffstat (limited to 'crypto/src/openpgp/PgpSecretKeyRingBundle.cs')
-rw-r--r-- | crypto/src/openpgp/PgpSecretKeyRingBundle.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/src/openpgp/PgpSecretKeyRingBundle.cs b/crypto/src/openpgp/PgpSecretKeyRingBundle.cs index c9f4d3959..26be9c10b 100644 --- a/crypto/src/openpgp/PgpSecretKeyRingBundle.cs +++ b/crypto/src/openpgp/PgpSecretKeyRingBundle.cs @@ -48,12 +48,13 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp foreach (object obj in e) { - PgpSecretKeyRing pgpSecret = obj as PgpSecretKeyRing; + // Marker packets must be ignored + if (obj is PgpMarker) + continue; + PgpSecretKeyRing pgpSecret = obj as PgpSecretKeyRing; if (pgpSecret == null) - { throw new PgpException(Platform.GetTypeName(obj) + " found where PgpSecretKeyRing expected"); - } long key = pgpSecret.GetPublicKey().KeyId; secretRings.Add(key, pgpSecret); |