summaryrefslogtreecommitdiff
path: root/sm/encrypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'sm/encrypt.c')
-rw-r--r--sm/encrypt.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sm/encrypt.c b/sm/encrypt.c
index 37cfe92..587b568 100644
--- a/sm/encrypt.c
+++ b/sm/encrypt.c
@@ -535,6 +535,15 @@ gpgsm_encrypt (ctrl_t ctrl, certlist_t recplist, int data_fd, estream_t out_fp)
if (compliant && gnupg_gcrypt_is_compliant (CO_DE_VS))
gpgsm_status (ctrl, STATUS_ENCRYPTION_COMPLIANCE_MODE,
gnupg_status_compliance_flag (CO_DE_VS));
+ else if (opt.require_compliance
+ && opt.compliance == CO_DE_VS)
+ {
+ log_error (_("operation forced to fail due to"
+ " unfulfilled compliance rules\n"));
+ gpgsm_errors_seen = 1;
+ rc = gpg_error (GPG_ERR_FORBIDDEN);
+ goto leave;
+ }
/* Main control loop for encryption. */
recpno = 0;