Skip to content

Commit 15d285f

Browse files
authored
[release/6.0] Clear OpenSSL error queues before reading/writing SSL data (#77772)
1 parent 46d3beb commit 15d285f

File tree

1 file changed

+4
-0
lines changed
  • src/libraries/Native/Unix/System.Security.Cryptography.Native

1 file changed

+4
-0
lines changed

src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ssl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,11 +406,15 @@ int32_t CryptoNative_SslSessionReused(SSL* ssl)
406406

407407
int32_t CryptoNative_SslWrite(SSL* ssl, const void* buf, int32_t num)
408408
{
409+
ERR_clear_error();
410+
409411
return SSL_write(ssl, buf, num);
410412
}
411413

412414
int32_t CryptoNative_SslRead(SSL* ssl, void* buf, int32_t num)
413415
{
416+
ERR_clear_error();
417+
414418
return SSL_read(ssl, buf, num);
415419
}
416420

0 commit comments

Comments
 (0)