diff options
| -rw-r--r-- | src/decrypted_kdm.cc | 7 |
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); |
