diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-11-29 00:58:55 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-11-29 00:58:55 +0000 |
| commit | 0fee90e0af6fc8dec76450b75d1648d325cc57ca (patch) | |
| tree | f51be1db6e13deeee6623cf43b944b46d4319aff /src | |
| parent | 71f5d09991c8c6362484075f9317e5cb9efd8e4c (diff) | |
Fix build.
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 |
