diff options
Diffstat (limited to 'crypto/src/tls/TlsExtensionsUtilities.cs')
-rw-r--r-- | crypto/src/tls/TlsExtensionsUtilities.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/crypto/src/tls/TlsExtensionsUtilities.cs b/crypto/src/tls/TlsExtensionsUtilities.cs index 5a97e1efc..46d42417c 100644 --- a/crypto/src/tls/TlsExtensionsUtilities.cs +++ b/crypto/src/tls/TlsExtensionsUtilities.cs @@ -302,10 +302,11 @@ namespace Org.BouncyCastle.Tls } /// <exception cref="IOException"/> - public static short GetClientCertificateTypeExtensionServer(IDictionary<int, byte[]> extensions) + public static short GetClientCertificateTypeExtensionServer(IDictionary<int, byte[]> extensions, + short defaultValue) { byte[] extensionData = TlsUtilities.GetExtensionData(extensions, ExtensionType.client_certificate_type); - return extensionData == null ? (short)-1 : ReadCertificateTypeExtensionServer(extensionData); + return extensionData == null ? defaultValue : ReadCertificateTypeExtensionServer(extensionData); } /// <exception cref="IOException"/> @@ -415,10 +416,11 @@ namespace Org.BouncyCastle.Tls } /// <exception cref="IOException"/> - public static short GetServerCertificateTypeExtensionServer(IDictionary<int, byte[]> extensions) + public static short GetServerCertificateTypeExtensionServer(IDictionary<int, byte[]> extensions, + short defaultValue) { byte[] extensionData = TlsUtilities.GetExtensionData(extensions, ExtensionType.server_certificate_type); - return extensionData == null ? (short)-1 : ReadCertificateTypeExtensionServer(extensionData); + return extensionData == null ? defaultValue : ReadCertificateTypeExtensionServer(extensionData); } /// <exception cref="IOException"/> |