aboutsummaryrefslogtreecommitdiffstats
path: root/g10/decrypt-data.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/decrypt-data.c')
-rw-r--r--g10/decrypt-data.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/g10/decrypt-data.c b/g10/decrypt-data.c
index 96e2487ec..702330185 100644
--- a/g10/decrypt-data.c
+++ b/g10/decrypt-data.c
@@ -29,6 +29,7 @@
#include "options.h"
#include "../common/i18n.h"
#include "../common/status.h"
+#include "../common/compliance.h"
static int mdc_decode_filter ( void *opaque, int control, IOBUF a,
@@ -97,6 +98,17 @@ decrypt_data (ctrl_t ctrl, void *procctx, PKT_encrypted *ed, DEK *dek)
dek->algo_info_printed = 1;
}
+ /* Check compliance. */
+ if (! gnupg_cipher_is_allowed (opt.compliance, 0, dek->algo, GCRY_CIPHER_MODE_CFB))
+ {
+ log_error (_ ("you may not use cipher algorithm '%s'"
+ " while in %s mode\n"),
+ openpgp_cipher_algo_name (dek->algo),
+ gnupg_compliance_option_string (opt.compliance));
+ rc = gpg_error (GPG_ERR_CIPHER_ALGO);
+ goto leave;
+ }
+
{
char buf[20];