Fix build.
authorCarl Hetherington <cth@carlh.net>
Tue, 29 Nov 2016 00:58:55 +0000 (00:58 +0000)
committerCarl Hetherington <cth@carlh.net>
Tue, 29 Nov 2016 00:58:55 +0000 (00:58 +0000)
src/decrypted_kdm.cc
src/exceptions.cc
src/exceptions.h

index c9c5895174e9455dbcc5400c162c2ae91bc4be6a..96049aa2871100a133e983868a30f716a13d2860 100644 (file)
@@ -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;
index 42c3ab19861a85841eec3261151a0e6593bbda09..b541beda1d546f2a1e854678bbe15f7d8db21b37 100644 (file)
@@ -90,3 +90,9 @@ MismatchedStandardError::MismatchedStandardError ()
 {
 
 }
+
+KDMDecryptionError::KDMDecryptionError (std::string message)
+       : runtime_error (String::compose ("Could not decrypt KDM (%1)", message))
+{
+
+}
index 851e6a943b0f86eb180a4e8ae3068fbf221354b9..2688ee86000666ee419580a61fc44feacd888a9e 100644 (file)
@@ -173,6 +173,12 @@ public:
        MismatchedStandardError ();
 };
 
+class KDMDecryptionError : public std::runtime_error
+{
+public:
+       KDMDecryptionError (std::string message);
+};
+
 }
 
 #endif