Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
address feedback from 36775 (#36839)
Browse files Browse the repository at this point in the history
  • Loading branch information
krwq authored Apr 13, 2019
1 parent f5e2679 commit c3981ca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,13 @@ internal static SafeSslHandle AllocateSslContext(SslProtocols protocols, SafeX50
byte[] cipherList =
CipherSuitesPolicyPal.GetOpenSslCipherList(sslAuthenticationOptions.CipherSuitesPolicy, protocols, policy);

Debug.Assert(cipherList == null || (cipherList.Length >= 1 && cipherList[cipherList.Length - 1] == 0));

byte[] cipherSuites =
CipherSuitesPolicyPal.GetOpenSslCipherSuites(sslAuthenticationOptions.CipherSuitesPolicy, protocols, policy);

Debug.Assert(cipherSuites == null || (cipherSuites.Length >= 1 && cipherSuites[cipherSuites.Length - 1] == 0));

unsafe
{
fixed (byte* cipherListStr = cipherList)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,13 @@ int32_t AppleCryptoNative_SslSetEnabledCipherSuites(SSLContextRef sslContext, co
else
{
// iOS, tvOS, watchOS
SSLCipherSuite* cipherSuites16 = (SSLCipherSuite*)malloc(sizeof(SSLCipherSuite) * (size_t)numCipherSuites);
SSLCipherSuite* cipherSuites16 = (SSLCipherSuite*)calloc((size_t)numCipherSuites, sizeof(SSLCipherSuite));

if (cipherSuites16 == NULL)
{
return errSSLInternal;
}

for (int i = 0; i < numCipherSuites; i++)
{
cipherSuites16[i] = (SSLCipherSuite)cipherSuites[i];
Expand Down

0 comments on commit c3981ca

Please sign in to comment.