int const decrypted_len = RSA_private_decrypt (cipher_value_len, cipher_value, decrypted, rsa, RSA_PKCS1_OAEP_PADDING);
if (decrypted_len == -1) {
delete[] decrypted;
- throw KDMDecryptionError (ERR_error_string (ERR_get_error(), 0));
+ throw KDMDecryptionError (ERR_error_string (ERR_get_error(), 0), cipher_value_len, rsa->n->dmax);
}
unsigned char* p = decrypted;
}
-KDMDecryptionError::KDMDecryptionError (std::string message)
- : runtime_error (String::compose ("Could not decrypt KDM (%1)", message))
+KDMDecryptionError::KDMDecryptionError (std::string message, int cipher_length, int modulus_dmax)
+ : runtime_error (String::compose ("Could not decrypt KDM (%1) (%2/%3)", message, cipher_length, modulus_dmax))
{
}
class KDMDecryptionError : public std::runtime_error
{
public:
- KDMDecryptionError (std::string message);
+ KDMDecryptionError (std::string message, int cipher_length, int modulus_dmax);
};
class KDMFormatError : public std::runtime_error