diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-04-05 18:39:00 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-04-05 18:39:00 +0700 |
commit | b3f95f64e8d46210990505a62f14434559bc7f62 (patch) | |
tree | 4942c2f6aa9c60e5076219f630c6f48eea449545 /crypto/src/bcpg/ECPublicBCPGKey.cs | |
parent | Support headers with multiple values (diff) | |
download | BouncyCastle.NET-ed25519-b3f95f64e8d46210990505a62f14434559bc7f62.tar.xz |
Add guard in OID parsing
Diffstat (limited to '')
-rw-r--r-- | crypto/src/bcpg/ECPublicBCPGKey.cs | 2 |
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); |