summary refs log tree commit diff
path: root/crypto/src
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-03-16 11:31:21 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-03-16 11:31:21 +0700
commit32ada34bce57d83a54d65c27561a5a39d0302992 (patch)
treeba930d408794632fa9395dfb065bc94339c621b6 /crypto/src
parentRefactor EdDsaSigner (diff)
downloadBouncyCastle.NET-ed25519-32ada34bce57d83a54d65c27561a5a39d0302992.tar.xz
Fix non-8-aligned IPv4 netmask parsing
- see https://github.com/bcgit/bc-csharp/issues/426
Diffstat (limited to 'crypto/src')
-rw-r--r--crypto/src/asn1/x509/GeneralName.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/src/asn1/x509/GeneralName.cs b/crypto/src/asn1/x509/GeneralName.cs
index 62d650df0..3f5a35d37 100644
--- a/crypto/src/asn1/x509/GeneralName.cs
+++ b/crypto/src/asn1/x509/GeneralName.cs
@@ -337,7 +337,7 @@ namespace Org.BouncyCastle.Asn1.X509
             }
             if (bits > 0)
             {
-                addr[offset] = (byte)(byte.MaxValue >> (8 - bits));
+                addr[offset] = (byte)(0xFF00 >> bits);
             }
         }