summaryrefslogtreecommitdiff
path: root/cipher/cipher-internal.h
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@iki.fi>2013-11-19 23:26:27 +0200
committerJussi Kivilinna <jussi.kivilinna@iki.fi>2013-11-20 18:39:02 +0200
commit56d352d6bdcf7abaa33c3399741f5063e2ddc32a (patch)
treef0ff0624e5e0bdec3f2054a3fc0e36d1e47fb7c9 /cipher/cipher-internal.h
parent32a2da9abc91394b23cf565c1c833fa964394083 (diff)
downloadlibgcrypt-56d352d6bdcf7abaa33c3399741f5063e2ddc32a.tar.gz
GCM: add FIPS mode restrictions
* cipher/cipher-gcm.c (_gcry_cipher_gcm_encrypt) (_gcry_cipher_gcm_get_tag): Do not allow using in FIPS mode is setiv was invocated directly. (_gcry_cipher_gcm_setiv): Rename to... (_gcry_cipher_gcm_initiv): ...this. (_gcry_cipher_gcm_setiv): New setiv function with check for FIPS mode. [TODO] (_gcry_cipher_gcm_getiv): New. * cipher/cipher-internal.h (gcry_cipher_handle): Add 'u_mode.gcm.disallow_encryption_because_of_setiv_in_fips_mode'. -- Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'cipher/cipher-internal.h')
-rw-r--r--cipher/cipher-internal.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/cipher/cipher-internal.h b/cipher/cipher-internal.h
index 9287ef59..fced20c5 100644
--- a/cipher/cipher-internal.h
+++ b/cipher/cipher-internal.h
@@ -188,6 +188,7 @@ struct gcry_cipher_handle
#endif
unsigned int datalen_over_limits:1;
+ unsigned int disallow_encryption_because_of_setiv_in_fips_mode:1;
#ifdef GCM_USE_INTEL_PCLMUL
unsigned int use_intel_pclmul:1;
#endif