Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CryptoLib ApplySecurity with Libgcrypt Fails on FIPS Mode Enabled Environment #72

Open
IbraheemYSaleh opened this issue Feb 7, 2022 · 2 comments
Assignees
Labels
kmc NASA JPL KMC

Comments

@IbraheemYSaleh
Copy link
Contributor

The CryptoLib Crypto_TC_ApplySecurity function fails when using the libgcrypt cryptography interface on FIPS mode enabled environments with the following error:
ERROR: gcry_cipher_encrypt error code 156
Failure: gcrypt/Invalid state

It turns out this is because AES-GCM is not FIPS certified when manually setting the IV, like we do since the IV & Sequence Number are the same.

To get around this, we need to manually modify CryptoLib to not fail due to invalid state when FIPS mode is enabled. How exactly this should be implemented is TBD, but CryptoLib with libgcrypt should function in FIPS mode hosts.

@IbraheemYSaleh
Copy link
Contributor Author

@jlucas9 jlucas9 moved this to In Progress in CryptoLib Path Forward Aug 23, 2022
@jlucas9 jlucas9 self-assigned this Mar 29, 2023
@jlucas9 jlucas9 moved this from In Progress to Planned Next Release in CryptoLib Path Forward Apr 5, 2023
@jlucas9 jlucas9 added the kmc NASA JPL KMC label Jun 21, 2023
@dccutrig
Copy link
Contributor

Long story short: This is in testing.
https://dev.gnupg.org/T4873

Additionally, while we allow KMC to generate IVs externally if they are Null and pass them back to CryptoLib, this isn't considered FIPS compliant based on discussions in the above link. Specifically they refer to notes within OpenSSL code, but this is the reference:

#ifdef FIPS_MODULE
/*
* FIPS requires generation of AES-GCM IV's inside the FIPS module.
* The IV can still be set externally (the security policy will state that
* this is not FIPS compliant). There are some applications
* where setting the IV externally is the only option available.
*/

@jlucas9 jlucas9 moved this from Planned Next Release to Backlog in CryptoLib Path Forward Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kmc NASA JPL KMC
Projects
Status: Backlog
Development

No branches or pull requests

3 participants