diff options
Diffstat (limited to 'crypto/src/tls/TlsClientProtocol.cs')
-rw-r--r-- | crypto/src/tls/TlsClientProtocol.cs | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/crypto/src/tls/TlsClientProtocol.cs b/crypto/src/tls/TlsClientProtocol.cs index 6968e5e55..5f60c784c 100644 --- a/crypto/src/tls/TlsClientProtocol.cs +++ b/crypto/src/tls/TlsClientProtocol.cs @@ -1321,6 +1321,11 @@ namespace Org.BouncyCastle.Tls securityParameters.m_statusRequestVersion = 1; } + securityParameters.m_clientCertificateType = TlsUtilities.ProcessClientCertificateTypeExtension( + sessionClientExtensions, sessionServerExtensions, AlertDescription.illegal_parameter); + securityParameters.m_serverCertificateType = TlsUtilities.ProcessServerCertificateTypeExtension( + sessionClientExtensions, sessionServerExtensions, AlertDescription.illegal_parameter); + this.m_expectSessionTicket = TlsUtilities.HasExpectedEmptyExtensionData(sessionServerExtensions, ExtensionType.session_ticket, AlertDescription.illegal_parameter); } @@ -1369,10 +1374,6 @@ namespace Org.BouncyCastle.Tls this.m_certificateRequest = certificateRequest; - m_tlsClientContext.SecurityParameters.m_clientCertificateType = - TlsExtensionsUtilities.GetClientCertificateTypeExtensionServer(m_serverExtensions, - CertificateType.X509); - TlsUtilities.EstablishServerSigAlgs(m_tlsClientContext.SecurityParameters, certificateRequest); } @@ -1423,13 +1424,21 @@ namespace Org.BouncyCastle.Tls securityParameters.m_encryptThenMac = false; securityParameters.m_truncatedHmac = false; - /* - * TODO[tls13] RFC 8446 4.4.2.1. OCSP Status and SCT Extensions. - * - * OCSP information is carried in an extension for a CertificateEntry. - */ - securityParameters.m_statusRequestVersion = - m_clientExtensions.ContainsKey(ExtensionType.status_request) ? 1 : 0; + if (!securityParameters.IsResumedSession) + { + /* + * TODO[tls13] RFC 8446 4.4.2.1. OCSP Status and SCT Extensions. + * + * OCSP information is carried in an extension for a CertificateEntry. + */ + securityParameters.m_statusRequestVersion = m_clientExtensions.ContainsKey(ExtensionType.status_request) + ? 1 : 0; + + securityParameters.m_clientCertificateType = TlsUtilities.ProcessClientCertificateTypeExtension13( + sessionClientExtensions, sessionServerExtensions, AlertDescription.illegal_parameter); + securityParameters.m_serverCertificateType = TlsUtilities.ProcessServerCertificateTypeExtension13( + sessionClientExtensions, sessionServerExtensions, AlertDescription.illegal_parameter); + } this.m_expectSessionTicket = false; @@ -1515,10 +1524,6 @@ namespace Org.BouncyCastle.Tls AssertEmpty(buf); m_certificateRequest = TlsUtilities.ValidateCertificateRequest(certificateRequest, m_keyExchange); - - m_tlsClientContext.SecurityParameters.m_clientCertificateType = - TlsExtensionsUtilities.GetClientCertificateTypeExtensionServer(m_serverExtensions, - CertificateType.X509); } /// <exception cref="IOException"/> |