+18
-8
lines changedFilter options
+18
-8
lines changed Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
+
The :mod:`hashlib` now compiles with OpenSSL 3.0.0-alpha2.
Original file line number Diff line number Diff line change
@@ -1109,19 +1109,25 @@ _hashlib.get_fips_mode -> int
1109
1109
1110
1110
Determine the OpenSSL FIPS mode of operation.
1111
1111
1112
+
For OpenSSL 3.0.0 and newer it returns the state of the default provider
1113
+
in the default OSSL context. It's not quite the same as FIPS_mode() but good
1114
+
enough for unittests.
1115
+
1112
1116
Effectively any non-zero return value indicates FIPS mode;
1113
1117
values other than 1 may have additional significance.
1114
-
1115
-
See OpenSSL documentation for the FIPS_mode() function for details.
1116
1118
[clinic start generated code]*/
1117
1119
1118
1120
static int
1119
1121
_hashlib_get_fips_mode_impl(PyObject *module)
1120
-
/*[clinic end generated code: output=87eece1bab4d3fa9 input=c2799c3132a36d6c]*/
1122
+
/*[clinic end generated code: output=87eece1bab4d3fa9 input=2db61538c41c6fef]*/
1121
1123
1122
1124
{
1125
+
int result;
1126
+
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
1127
+
result = EVP_default_properties_is_fips_enabled(NULL);
1128
+
#else
1123
1129
ERR_clear_error();
1124
-
int result = FIPS_mode();
1130
+
result = FIPS_mode();
1125
1131
if (result == 0) {
1126
1132
// "If the library was built without support of the FIPS Object Module,
1127
1133
// then the function will return 0 with an error code of
@@ -1134,6 +1140,7 @@ _hashlib_get_fips_mode_impl(PyObject *module)
1134
1140
}
1135
1141
}
1136
1142
return result;
1143
+
#endif
1137
1144
}
1138
1145
#endif // !LIBRESSL_VERSION_NUMBER
1139
1146
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4