Allow use of OpenSSL 1.1.1, fix compile errors

This commit is contained in:
Sil3ntStorm 2019-10-19 16:40:06 +02:00
parent bcf0c32245
commit 98d16eb836

View file

@ -1696,7 +1696,7 @@ inline std::string decode_url(const std::string &s) {
int val = 0;
if (from_hex_to_i(s, i + 1, 2, val)) {
// 2 digits hex codes
result += val;
result += static_cast<char>(val);
i += 2; // '00'
} else {
result += s[i];
@ -1847,7 +1847,7 @@ inline std::string to_lower(const char *beg, const char *end) {
std::string out;
auto it = beg;
while (it != end) {
out += ::tolower(*it);
out += static_cast<char>(::tolower(*it));
it++;
}
return out;
@ -3382,11 +3382,19 @@ private:
class SSLInit {
public:
SSLInit() {
#if OPENSSL_VERSION_NUMBER >= 0x1010001fL
OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
#else
SSL_load_error_strings();
SSL_library_init();
#endif
}
~SSLInit() { ERR_free_strings(); }
~SSLInit() {
#if OPENSSL_VERSION_NUMBER < 0x1010001fL
ERR_free_strings();
#endif
}
private:
#if OPENSSL_VERSION_NUMBER < 0x10100000L