mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-22 14:57:02 +01:00
gpg: Emit STATUS_FAILURE for --require-compliance errors
* g10/misc.c (compliance_failure): Do not fallback to CO_GNUPG. Print compliance failure error and status for CO_DE_VS. * g10/mainproc.c (proc_encrypted): Call compliance_failure in the require-compliance error case. * g10/encrypt.c (check_encryption_compliance): Ditto.
This commit is contained in:
parent
e1169e8f8a
commit
e05fb5ca37
@ -567,10 +567,8 @@ check_encryption_compliance (DEK *dek, pk_list_t pk_list)
|
|||||||
&& opt.compliance == CO_DE_VS
|
&& opt.compliance == CO_DE_VS
|
||||||
&& !compliant)
|
&& !compliant)
|
||||||
{
|
{
|
||||||
log_error (_("operation forced to fail due to"
|
compliance_failure ();
|
||||||
" unfulfilled compliance rules\n"));
|
|
||||||
err = gpg_error (GPG_ERR_FORBIDDEN);
|
err = gpg_error (GPG_ERR_FORBIDDEN);
|
||||||
g10_errors_seen = 1;
|
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -944,9 +944,7 @@ proc_encrypted (CTX c, PACKET *pkt)
|
|||||||
&& opt.compliance == CO_DE_VS
|
&& opt.compliance == CO_DE_VS
|
||||||
&& compliance_de_vs != (4|2|1))
|
&& compliance_de_vs != (4|2|1))
|
||||||
{
|
{
|
||||||
log_error (_("operation forced to fail due to"
|
compliance_failure ();
|
||||||
" unfulfilled compliance rules\n"));
|
|
||||||
g10_errors_seen = 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2625,8 +2623,7 @@ check_sig_and_print (CTX c, kbnode_t node)
|
|||||||
else if (opt.flags.require_compliance
|
else if (opt.flags.require_compliance
|
||||||
&& opt.compliance == CO_DE_VS)
|
&& opt.compliance == CO_DE_VS)
|
||||||
{
|
{
|
||||||
log_error (_("operation forced to fail due to"
|
compliance_failure ();
|
||||||
" unfulfilled compliance rules\n"));
|
|
||||||
if (!rc)
|
if (!rc)
|
||||||
rc = gpg_error (GPG_ERR_FORBIDDEN);
|
rc = gpg_error (GPG_ERR_FORBIDDEN);
|
||||||
}
|
}
|
||||||
|
@ -1405,8 +1405,12 @@ compliance_failure(void)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CO_DE_VS:
|
case CO_DE_VS:
|
||||||
ver="DE-VS applications";
|
/* For de-vs we do not allow any kind of fallback. */
|
||||||
break;
|
write_status_failure ("compliance-check", gpg_error (GPG_ERR_FORBIDDEN));
|
||||||
|
log_error (_("operation forced to fail due to"
|
||||||
|
" unfulfilled compliance rules\n"));
|
||||||
|
g10_errors_seen = 1;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_info(_("this message may not be usable by %s\n"),ver);
|
log_info(_("this message may not be usable by %s\n"),ver);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user