1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

Require openssl >= 1.1.1

Versions older this are sufficiently old that we don't want to support
them, and they require extra support code.
This commit is contained in:
Robert Hensing 2023-02-03 18:07:47 +01:00
parent 2196fd1146
commit 2445afd92c
4 changed files with 1 additions and 27 deletions

View file

@ -17,29 +17,6 @@
namespace nix {
#if OPENSSL_VERSION_NUMBER < 0x10101000L
/* OpenSSL is not thread-safe by default - it will randomly crash
unless the user supplies a mutex locking function. So let's do
that. */
static std::vector<std::mutex> opensslLocks;
static void opensslLockCallback(int mode, int type, const char * file, int line)
{
if (mode & CRYPTO_LOCK)
opensslLocks[type].lock();
else
opensslLocks[type].unlock();
}
#endif
void initOpenSSL() {
#if OPENSSL_VERSION_NUMBER < 0x10101000L
/* Initialise OpenSSL locking. */
opensslLocks = std::vector<std::mutex>(CRYPTO_num_locks());
CRYPTO_set_locking_callback(opensslLockCallback);
#endif
}
static size_t regularHashSize(HashType type) {
switch (type) {
case htMD5: return md5HashSize;