From 6e10c08b4b34fd6c14ed42ef530b86e688ab3d8b Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Mon, 22 Apr 2013 08:47:49 +0200 Subject: [PATCH] actions: one more check --- src/actions.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/actions.cpp b/src/actions.cpp index 471b022..12e6d7b 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -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) ) {