summaryrefslogtreecommitdiff
path: root/src/global.c
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2021-11-26 11:45:19 +0100
committerNIIBE Yutaka <gniibe@fsij.org>2021-11-30 18:52:50 +0900
commit3d38968f4b751c5561679040c055c34a690bed75 (patch)
treedad7c5aebfccfcca873601c001cd8571a8fb60d3 /src/global.c
parent40ab39966650489449bee3e2a68f43a9d38c4dd4 (diff)
downloadlibgcrypt-3d38968f4b751c5561679040c055c34a690bed75.tar.gz
Implement explicit FIPS indicators for cipher modes
* src/fips.c (_gcry_fips_indicator): New. * src/g10lib.h (_gcry_fips_indicator): New declaration. * src/gcrypt.h.in (gcry_ctl_cmds): New GCRYCTL_FIPS_SERVICE_INDICATOR * src/global.c (_gcry_vcontrol): Handle GCRYCTL_FIPS_SERVICE_INDICATOR * tests/basic.c (do_check_ocb_cipher): Check excplicit FIPS indicator (check_ocb_cipher_largebuf_split): Ditto. (check_ocb_cipher_checksum): Ditto. (check_ocb_cipher_splitaad): Ditto. (check_bulk_cipher_modes): Ditto. -- Add GCRYCTL_FIPS_SERVICE_INDICATOR to handle explicit FIPS indicators for cipher modes. GnuPG-bug-id: 5512 Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Diffstat (limited to 'src/global.c')
-rw-r--r--src/global.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/global.c b/src/global.c
index 1a6daef6..1ff736d7 100644
--- a/src/global.c
+++ b/src/global.c
@@ -747,6 +747,13 @@ _gcry_vcontrol (enum gcry_ctl_cmds cmd, va_list arg_ptr)
rc = _gcry_fips_run_selftests (1);
break;
+ case GCRYCTL_FIPS_SERVICE_INDICATOR:
+ /* Get FIPS Service Indicator for a given algorithm and optional mode.
+ * Returns GPG_ERR_NO_ERROR if algorithm is allowed or
+ * GPG_ERR_NOT_SUPPORTED otherwise */
+ rc = _gcry_fips_indicator (arg_ptr);
+ break;
+
case PRIV_CTL_INIT_EXTRNG_TEST: /* Init external random test. */
rc = GPG_ERR_NOT_SUPPORTED;
break;