projects
/
platform
/
upstream
/
dotnet
/
runtime.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5487473
)
prevent use of null when processing alpn list (#81629)
author
Tomas Weinfurt
<tweinfurt@yahoo.com>
Mon, 6 Feb 2023 19:32:59 +0000
(11:32 -0800)
committer
GitHub
<noreply@github.com>
Mon, 6 Feb 2023 19:32:59 +0000
(11:32 -0800)
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs
patch
|
blob
|
history
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs
patch
|
blob
|
history
diff --git
a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs
b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs
index
1bfaff2
..
e485326
100644
(file)
--- a/
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs
+++ b/
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs
@@
-683,6
+683,11
@@
internal static partial class Interop
*outlen = 0;
IntPtr sslData = Ssl.SslGetData(ssl);
+ if (sslData == IntPtr.Zero)
+ {
+ return Ssl.SSL_TLSEXT_ERR_ALERT_FATAL;
+ }
+
// reset application data to avoid dangling pointer.
Ssl.SslSetData(ssl, IntPtr.Zero);
diff --git
a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs
b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs
index
986754d
..
d5788bb
100644
(file)
--- a/
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs
+++ b/
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs
@@
-421,6
+421,7
@@
namespace Microsoft.Win32.SafeHandles
if (AlpnHandle.IsAllocated)
{
+ Interop.Ssl.SslSetData(handle, IntPtr.Zero);
AlpnHandle.Free();
}