I'm sorry to bother the list again so soon, but I'm having trouble using AES
in CBC mode for decryption.  The code I'm using throws an exception, but for
some reason I can't catch the exception itself (the (...) catchall is being
activated).  The code snippet below is roughly what I'm doing, although
doesn't appear together in the actual program.  Any help would be greatly
appreciated.  (The encryption version seems to be working fine).

try {
    unsigned char work_buffer_in[max_block_size];
    CryptoPP::CBC_Mode<CryptoPP::AES>::Decryption decryptor;
    decryptor.SetKey((const byte *)key.data(), key.size());
    block_size=decryptor.MandatoryBlockSize();
    decryptor.ProcessData(work_buffer_in, (const byte *)cipherblock,
block_size);
}
 catch (const std::exception& e) {
     status().category=ReturnCode::Failure;
     status().detail=ReturnCode::Exception;
     trace.log_message(__LINE__) << e.what() << std::endl;
 }
 catch (...) {
     status().category=ReturnCode::Failure;
     status().detail=ReturnCode::Exception;
     trace.log_message(__LINE__) << "Unknown Exception" << std::endl;
 }

Reply via email to