@@ -112,10 +112,10 @@ public static SecurityStatusPal InitializeSecurityContext(ref SafeFreeCredential
112
112
return SecurityStatusAdapterPal . GetSecurityStatusPalFromNativeInt ( errorCode ) ;
113
113
}
114
114
115
- public static SecurityStatusPal Renegotiate ( ref SafeFreeCredentials ? credentialsHandle , ref SafeDeleteSslContext ? context , SslAuthenticationOptions sslAuthenticationOptions , out byte [ ] ? outputBuffer )
115
+ public static SecurityStatusPal Renegotiate ( ref SafeFreeCredentials ? credentialsHandle , ref SafeDeleteSslContext ? context , SslAuthenticationOptions sslAuthenticationOptions , out byte [ ] ? outputBuffer )
116
116
{
117
117
byte [ ] ? output = Array . Empty < byte > ( ) ;
118
- SecurityStatusPal status = AcceptSecurityContext ( ref credentialsHandle , ref context , Span < byte > . Empty , ref output , sslAuthenticationOptions ) ;
118
+ SecurityStatusPal status = AcceptSecurityContext ( ref credentialsHandle , ref context , Span < byte > . Empty , ref output , sslAuthenticationOptions ) ;
119
119
outputBuffer = output ;
120
120
return status ;
121
121
}
@@ -139,8 +139,7 @@ public static SafeFreeCredentials AcquireCredentialsHandle(SslStreamCertificateC
139
139
if ( newCredentialsRequested && certificateContext != null )
140
140
{
141
141
SafeFreeCredential_SECURITY handle = ( SafeFreeCredential_SECURITY ) cred ;
142
- // We need to create copy to avoid Disposal issue.
143
- handle . LocalCertificate = new X509Certificate2 ( certificateContext . Certificate ) ;
142
+ handle . HasLocalCertificate = true ;
144
143
}
145
144
146
145
return cred ;
@@ -270,11 +269,11 @@ public static unsafe SafeFreeCredentials AcquireCredentialsHandleSchCredentials(
270
269
Interop . SspiCli . SCH_CREDENTIALS credential = default ;
271
270
credential . dwVersion = Interop . SspiCli . SCH_CREDENTIALS . CurrentVersion ;
272
271
credential . dwFlags = flags ;
273
- Interop . Crypt32 . CERT_CONTEXT * certificateHandle = null ;
272
+ Interop . Crypt32 . CERT_CONTEXT * certificateHandle = null ;
274
273
if ( certificate != null )
275
274
{
276
275
credential . cCreds = 1 ;
277
- certificateHandle = ( Interop . Crypt32 . CERT_CONTEXT * ) certificate . Handle ;
276
+ certificateHandle = ( Interop . Crypt32 . CERT_CONTEXT * ) certificate . Handle ;
278
277
credential . paCred = & certificateHandle ;
279
278
}
280
279
0 commit comments