Skip to content

Commit e9efcaa

Browse files
authored
Remove OpenSSL 1.0.2 and 1.1.0 support
This removes all logic from our native shim required to support less than OpenSSL 1.1.1. This makes our OpenSSL floor 1.1.1. The general changes are: 1. `apibridge.c` is about creating OpenSSL 1.1.x-like functions from the non-opaque structs. We don't need to shim those anymore, so the file is gone. 3. `LEGACY_FUNCTION`s went away. 4. `FALLBACK_FUNCTION` and `REQUIRED_FUNCTION_110` are now `REQUIRED_FUNCTION`s. 5. Any code paths were for older OpenSSLs have been removed. 6. OpenSSL 1.0 initialization has been removed. The portable build will no longer look for 1.0 versions.
1 parent 2daa4bc commit e9efcaa

File tree

14 files changed

+93
-1985
lines changed

14 files changed

+93
-1985
lines changed

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.X509.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -343,14 +343,6 @@ internal enum X509VerifyStatusCodeUniversal
343343
X509_V_ERR_EMAIL_MISMATCH = 63,
344344
X509_V_ERR_IP_ADDRESS_MISMATCH = 64,
345345
}
346-
internal enum X509VerifyStatusCode102
347-
{
348-
X509_V_ERR_INVALID_CA = 24,
349-
350-
X509_V_ERR_INVALID_CALL = 65,
351-
X509_V_ERR_STORE_LOOKUP = 66,
352-
X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION = 67,
353-
}
354346

355347
internal enum X509VerifyStatusCode111
356348
{
@@ -421,7 +413,6 @@ internal X509VerifyStatusCode(int code)
421413
}
422414

423415
public X509VerifyStatusCodeUniversal UniversalCode => (X509VerifyStatusCodeUniversal)Code;
424-
public X509VerifyStatusCode102 Code102 => (X509VerifyStatusCode102)Code;
425416
public X509VerifyStatusCode111 Code111 => (X509VerifyStatusCode111)Code;
426417
public X509VerifyStatusCode30 Code30 => (X509VerifyStatusCode30)Code;
427418

src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/OpenSslX509ChainProcessor.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,18 +1172,6 @@ private static X509ChainStatusFlags MapOpenSsl30Code(Interop.Crypto.X509VerifySt
11721172
}
11731173
}
11741174

1175-
private static X509ChainStatusFlags MapOpenSsl102Code(Interop.Crypto.X509VerifyStatusCode code)
1176-
{
1177-
switch (code.Code102)
1178-
{
1179-
case Interop.Crypto.X509VerifyStatusCode102.X509_V_ERR_INVALID_CA:
1180-
return X509ChainStatusFlags.InvalidBasicConstraints;
1181-
default:
1182-
Debug.Fail("Unrecognized X509VerifyStatusCode:" + code.Code102);
1183-
throw GetUnmappedCodeException(nameof(MapOpenSsl102Code), (int)code.Code102);
1184-
}
1185-
}
1186-
11871175
private static X509ChainStatusFlags MapOpenSsl111Code(Interop.Crypto.X509VerifyStatusCode code)
11881176
{
11891177
switch (code.Code111)
@@ -1417,7 +1405,7 @@ private static MapVersionSpecificCode GetVersionLookup()
14171405
return MapOpenSsl111Code;
14181406
}
14191407

1420-
return MapOpenSsl102Code;
1408+
throw new CryptographicException();
14211409
}
14221410

14231411
private static CryptographicException GetUnmappedCodeException(string functionName, int code)

src/native/libs/System.Security.Cryptography.Native/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ append_extra_cryptography_libs(NATIVE_LIBS_EXTRA)
2323
include_directories(${OPENSSL_INCLUDE_DIR})
2424

2525
set(NATIVECRYPTO_SOURCES
26-
apibridge.c
2726
apibridge_30.c
2827
memory_debug.c
2928
openssl.c

0 commit comments

Comments
 (0)