diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2017-09-17 11:23:40 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2017-09-17 11:23:40 +0700 |
commit | 73f71ddda7ebd2b57281c7c546138408c8a289ee (patch) | |
tree | 6769b27dfa623edf4346dc3cf52e4c16f9e9afd2 /crypto/src | |
parent | Fix previous commit for .NET 1.1 (diff) | |
download | BouncyCastle.NET-ed25519-73f71ddda7ebd2b57281c7c546138408c8a289ee.tar.xz |
Check final padding character in Base64 data.
Diffstat (limited to 'crypto/src')
-rw-r--r-- | crypto/src/util/encoders/Base64Encoder.cs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/src/util/encoders/Base64Encoder.cs b/crypto/src/util/encoders/Base64Encoder.cs index 7b53df25a..07294c9a6 100644 --- a/crypto/src/util/encoders/Base64Encoder.cs +++ b/crypto/src/util/encoders/Base64Encoder.cs @@ -269,6 +269,9 @@ namespace Org.BouncyCastle.Utilities.Encoders { if (c3 == padding) { + if (c4 != padding) + throw new IOException("invalid characters encountered at end of base64 data"); + byte b1 = decodingTable[c1]; byte b2 = decodingTable[c2]; |