Try to fix build with new-ish OpenSSL. 1.0
authorCarl Hetherington <cth@carlh.net>
Sun, 17 Dec 2017 02:17:27 +0000 (02:17 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 17 Dec 2017 02:17:27 +0000 (02:17 +0000)
src/decrypted_kdm.cc

index 6147439ad2045cd94bb54d32729d25887c56893e..895c6144c04c20b74eb2fe8a4a616b2cb007bc04 100644 (file)
@@ -153,7 +153,11 @@ DecryptedKDM::DecryptedKDM (EncryptedKDM const & kdm, string private_key)
                int const decrypted_len = RSA_private_decrypt (cipher_value_len, cipher_value, decrypted, rsa, RSA_PKCS1_OAEP_PADDING);
                if (decrypted_len == -1) {
                        delete[] decrypted;
+#if OPENSSL_VERSION_NUMBER > 0x10100000L
+                       throw KDMDecryptionError (ERR_error_string (ERR_get_error(), 0), cipher_value_len, RSA_bits(rsa));
+#else
                        throw KDMDecryptionError (ERR_error_string (ERR_get_error(), 0), cipher_value_len, rsa->n->dmax);
+#endif
                }
 
                unsigned char* p = decrypted;