diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/decrypted_kdm.cc | 2 | ||||
| -rw-r--r-- | src/exceptions.cc | 6 | ||||
| -rw-r--r-- | src/exceptions.h | 6 |
3 files changed, 13 insertions, 1 deletions
diff --git a/src/decrypted_kdm.cc b/src/decrypted_kdm.cc index c9c58951..96049aa2 100644 --- a/src/decrypted_kdm.cc +++ b/src/decrypted_kdm.cc @@ -144,7 +144,7 @@ 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; - throw MiscError (String::compose ("Could not decrypt KDM (%1)", ERR_error_string (ERR_get_error(), 0))); + throw KDMDecryptionError (ERR_error_string (ERR_get_error(), 0)); } unsigned char* p = decrypted; diff --git a/src/exceptions.cc b/src/exceptions.cc index 42c3ab19..b541beda 100644 --- a/src/exceptions.cc +++ b/src/exceptions.cc @@ -90,3 +90,9 @@ MismatchedStandardError::MismatchedStandardError () { } + +KDMDecryptionError::KDMDecryptionError (std::string message) + : runtime_error (String::compose ("Could not decrypt KDM (%1)", message)) +{ + +} diff --git a/src/exceptions.h b/src/exceptions.h index 851e6a94..2688ee86 100644 --- a/src/exceptions.h +++ b/src/exceptions.h @@ -173,6 +173,12 @@ public: MismatchedStandardError (); }; +class KDMDecryptionError : public std::runtime_error +{ +public: + KDMDecryptionError (std::string message); +}; + } #endif |
