summary refs log tree commit diff
path: root/crypto
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2015-11-13 22:11:34 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2015-11-13 22:11:34 +0700
commitb90c58ee419838514e615180216408ced07a2121 (patch)
treea51ff5daa5eee27dbe42d30255658d8fb6244797 /crypto
parentInclude basic encode/parse test (diff)
downloadBouncyCastle.NET-ed25519-b90c58ee419838514e615180216408ced07a2121.tar.xz
Use portable methods for ASCII conversion
Diffstat (limited to 'crypto')
-rw-r--r--crypto/src/crypto/tls/ServerName.cs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crypto/src/crypto/tls/ServerName.cs b/crypto/src/crypto/tls/ServerName.cs
index d42055b78..508c2ddbc 100644
--- a/crypto/src/crypto/tls/ServerName.cs
+++ b/crypto/src/crypto/tls/ServerName.cs
@@ -1,6 +1,5 @@
 using System;
 using System.IO;
-using System.Text;
 
 using Org.BouncyCastle.Utilities;
 
@@ -52,7 +51,7 @@ namespace Org.BouncyCastle.Crypto.Tls
             switch (mNameType)
             {
             case Tls.NameType.host_name:
-                byte[] asciiEncoding = Encoding.ASCII.GetBytes((string)mName);
+                byte[] asciiEncoding = Strings.ToAsciiByteArray((string)mName);
                 if (asciiEncoding.Length < 1)
                     throw new TlsFatalAlert(AlertDescription.internal_error);
                 TlsUtilities.WriteOpaque16(asciiEncoding, output);
@@ -82,7 +81,7 @@ namespace Org.BouncyCastle.Crypto.Tls
                 byte[] asciiEncoding = TlsUtilities.ReadOpaque16(input);
                 if (asciiEncoding.Length < 1)
                     throw new TlsFatalAlert(AlertDescription.decode_error);
-                name = Encoding.ASCII.GetString(asciiEncoding);
+                name = Strings.FromAsciiByteArray(asciiEncoding);
                 break;
             }
             default: