summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2020-04-05 18:39:00 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2020-04-05 18:39:00 +0700
commitb3f95f64e8d46210990505a62f14434559bc7f62 (patch)
tree4942c2f6aa9c60e5076219f630c6f48eea449545
parentSupport headers with multiple values (diff)
downloadBouncyCastle.NET-ed25519-b3f95f64e8d46210990505a62f14434559bc7f62.tar.xz
Add guard in OID parsing
-rw-r--r--crypto/src/bcpg/ECPublicBCPGKey.cs2
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/src/bcpg/ECPublicBCPGKey.cs b/crypto/src/bcpg/ECPublicBCPGKey.cs
index df19caac3..4733ee6c9 100644
--- a/crypto/src/bcpg/ECPublicBCPGKey.cs
+++ b/crypto/src/bcpg/ECPublicBCPGKey.cs
@@ -85,6 +85,8 @@ namespace Org.BouncyCastle.Bcpg
                 throw new EndOfStreamException();
             if (length == 0 || length == 0xFF)
                 throw new IOException("future extensions not yet implemented");
+            if (length > 127)
+                throw new IOException("unsupported OID");
 
             byte[] buffer = new byte[length + 2];
             bcpgIn.ReadFully(buffer, 2, buffer.Length - 2);