summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-11-04 23:18:30 +0000
committerCarl Hetherington <cth@carlh.net>2015-11-04 23:18:30 +0000
commit6c1fa17bf69041cf58083afd5c26d36c39050157 (patch)
tree443cc9d7b5e97d76b13054417218a843d32d139b /src
parentc7cbd39720b2b3149bff4851dc680a0fc6f4eaba (diff)
Debug.
Diffstat (limited to 'src')
-rw-r--r--src/decrypted_kdm.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/decrypted_kdm.cc b/src/decrypted_kdm.cc
index 3e48e23f..517ae9be 100644
--- a/src/decrypted_kdm.cc
+++ b/src/decrypted_kdm.cc
@@ -105,6 +105,8 @@ DecryptedKDM::DecryptedKDM (EncryptedKDM const & kdm, string private_key)
{
/* Read the private key */
+ std::cout << "private key is " << private_key << "\n";
+
BIO* bio = BIO_new_mem_buf (const_cast<char *> (private_key.c_str ()), -1);
if (!bio) {
throw MiscError ("could not create memory BIO");
@@ -120,8 +122,13 @@ DecryptedKDM::DecryptedKDM (EncryptedKDM const & kdm, string private_key)
BOOST_FOREACH (string const & i, kdm.keys ()) {
/* Decode the base-64-encoded cipher value from the KDM */
unsigned char cipher_value[256];
+
+ std::cout << "decoding base64 " << i << "\n";
+
int const cipher_value_len = base64_decode (i, cipher_value, sizeof (cipher_value));
+ std::cout << "decoded cipher to " << cipher_value_len << "\n";
+
/* Decrypt it */
unsigned char * decrypted = new unsigned char[RSA_size(rsa)];
int const decrypted_len = RSA_private_decrypt (cipher_value_len, cipher_value, decrypted, rsa, RSA_PKCS1_OAEP_PADDING);