diff options
author | Tomas Mraz <tmraz@fedoraproject.org> | 2012-04-04 14:17:09 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2012-04-04 16:11:37 +0200 |
commit | 90e49a11733bfba9c3c505ac487282d35757f682 (patch) | |
tree | 7c4696e2ced4e66469095885bef94bef23efd112 /src/global.c | |
parent | 70cca617ed75ea292e1fed769114dda5cc1d76f1 (diff) | |
download | libgcrypt-90e49a11733bfba9c3c505ac487282d35757f682.tar.gz |
Add GCRYCTL_SET_ENFORCED_FIPS_FLAG command.
* doc/gcrypt.texi: Add documentation of the new command.
* src/fips.c (_gcry_enforced_fips_mode): Report the enforced fips mode
only when fips mode is enabled.
(_gcry_set_enforced_fips_mode): New function.
* src/g10lib.h: Add the _gcry_set_enforced_fips_mode prototype.
* src/gcrypt.h.in: Add the GCRYCTL_SET_ENFORCED_FIPS_FLAG.
* src/global.c (_gcry_vcontrol): Handle the new command.
Diffstat (limited to 'src/global.c')
-rw-r--r-- | src/global.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/global.c b/src/global.c index bde8791c..4ce869a6 100644 --- a/src/global.c +++ b/src/global.c @@ -599,6 +599,16 @@ _gcry_vcontrol (enum gcry_ctl_cmds cmd, va_list arg_ptr) } break; + case GCRYCTL_SET_ENFORCED_FIPS_FLAG: + if (!any_init_done) + { + /* Not yet intialized at all. Set the enforced fips mode flag */ + _gcry_set_enforced_fips_mode (); + } + else + err = GPG_ERR_GENERAL; + break; + default: /* A call to make sure that the dummy code is linked in. */ _gcry_compat_identification (); |