1
0
mirror of https://github.com/biergaizi/codecrypt synced 2024-06-25 00:08:20 +00:00

actions: one more check

This commit is contained in:
Mirek Kratochvil 2013-04-22 08:47:49 +02:00
parent 1880b2bb21
commit 6e10c08b4b

@ -231,6 +231,15 @@ int action_decrypt (bool armor,
return 1;
}
//and the algorithm
if ( (!AS.count (msg.alg_id) )
|| (!AS[msg.alg_id]->provides_encryption() ) ) {
err ("error: decryption algorithm unsupported");
err ("info: requires algorithm " << msg.alg_id);
return 1;
}
//actual decryption
bvector plaintext;
if (msg.decrypt (plaintext, AS, KR) ) {