Skip to content

Commit 3ab7caf

Browse files
authored
Merge pull request #14 from xnox/cmvp-5132
cmvp 5132
2 parents fa08f09 + 5c71eea commit 3ab7caf

File tree

2 files changed

+67
-42
lines changed

2 files changed

+67
-42
lines changed

README.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,34 @@ to use its FIPS module.
66
## Caveats
77

88
This tool can only detect whether or not OpenSSL is properly configured:
9-
applications and languages must be built to make use of shared linked libcrypto
10-
in order for the OpenSSL FIPS configuration to actually be useful.
9+
applications and languages must be built to make use of shared linked system
10+
libcrypto in order for the OpenSSL FIPS configuration to be used.
1111

1212
This tool does not validate whether any other element in an overall delivered
13-
configuration is, or is not, FIPS 140-3 compliant. It only tests whether
14-
OpenSSL is properly configured and making use of the FIPS module correctly.
13+
configuration is, or is not, FIPS 140-3 compliant. It only tests whether
14+
OpenSSL is properly configured and is making use of the FIPS module correctly.
1515

1616
## Usage
1717

1818
All Chainguard FIPS images ship `openssl-fips-test` preinstalled.
1919

20-
On other systems, run `make` and `make install` as usual with whatever
21-
escalation tool you normally use. You must have the OpenSSL development
22-
headers installed in order to build this tool, as well as a C compiler.
20+
On other systems, run `make` and `make install`. You must have the OpenSSL
21+
development headers installed in order to build this tool, as well as a C
22+
compiler.
2323

2424
## About this tool
2525

2626
Prior to loading any providers, a callback is added to capture output of KAT
2727
(known answer tests) selftests.
2828

29-
It then loads default OpenSSL library contects, and verifies that a FIPS
30-
provider is loaded. And checks that by default FIPS variants of algorithms are
31-
used.
29+
It then loads default OpenSSL library context, and verifies that a FIPS
30+
provider is loaded. It checks that by default the FIPS variants of algorithms
31+
are used.
3232

33-
It also retrieves FIPS module information and returns CMVP search URL where one
34-
should be able to find applicable certificates.
33+
It also retrieves FIPS module information and returns CMVP & ESV certificates
34+
where known, or a CMVP search URL where one should be able to find applicable
35+
certificates. If certificates cannot be located with matching versions, one is
36+
using non-validated module.
3537

3638
It also provides a summary of available algorithms, which is useful to compare
3739
different CMVP modules and the algorithms they offer.
@@ -59,21 +61,20 @@ Checking OpenSSL lifecycle assurance.
5961
6062
✓ Self-test KAT_Integrity HMAC ... passed.
6163
✓ Self-test Module_Integrity HMAC ... passed.
62-
✓ Self-test KAT_Digest SHA1 ... passed.
6364
✓ Self-test KAT_Digest SHA2 ... passed.
6465
✓ Self-test KAT_Digest SHA3 ... passed.
6566
✓ Self-test KAT_Cipher AES_GCM ... passed.
6667
✓ Self-test KAT_Cipher AES_ECB_Decrypt ... passed.
67-
✓ Self-test Continuous_RNG_Test RNG ... passed.
6868
✓ Self-test KAT_Signature RSA ... passed.
6969
✓ Self-test KAT_Signature ECDSA ... passed.
70-
✓ Self-test KAT_Signature DSA ... passed.
70+
✓ Self-test KAT_Signature EDDSA ... passed.
71+
✓ Self-test KAT_Signature EDDSA ... passed.
7172
✓ Self-test KAT_KDF TLS13_KDF_EXTRACT ... passed.
7273
✓ Self-test KAT_KDF TLS13_KDF_EXPAND ... passed.
7374
✓ Self-test KAT_KDF TLS12_PRF ... passed.
7475
✓ Self-test KAT_KDF PBKDF2 ... passed.
75-
✓ Self-test KAT_KDF SSHKDF ... passed.
7676
✓ Self-test KAT_KDF KBKDF ... passed.
77+
✓ Self-test KAT_KDF KBKDF_KMAC ... passed.
7778
✓ Self-test KAT_KDF HKDF ... passed.
7879
✓ Self-test KAT_KDF SSKDF ... passed.
7980
✓ Self-test KAT_KDF X963KDF ... passed.
@@ -83,11 +84,8 @@ Checking OpenSSL lifecycle assurance.
8384
✓ Self-test DRBG HMAC ... passed.
8485
✓ Self-test KAT_KA DH ... passed.
8586
✓ Self-test KAT_KA ECDH ... passed.
86-
✓ Self-test KAT_AsymmetricCipher RSA_Encrypt ... passed.
87-
✓ Self-test KAT_AsymmetricCipher RSA_Decrypt ... passed.
88-
✓ Self-test KAT_AsymmetricCipher RSA_Decrypt ... passed.
8987
90-
29 out of 29 self-tests passed.
88+
25 out of 25 self-tests passed.
9189
✓ Check FIPS cryptographic module is available... passed.
9290
✓ Check FIPS approved only mode (EVP_default_properties_is_fips_enabled)... passed.
9391
✓ Check non-approved algorithm blocked (HMAC-MD5)... passed.
@@ -101,11 +99,11 @@ Available approved algorithms for security purposes (fips=yes):
10199
✓ SHA-1
102100
✓ SHA-2
103101
✓ SHA-3
104-
DSA
102+
DSA
105103
✓ RSA
106104
✓ ECDSA
105+
✓ Ed25519
107106
✗ DetECDSA
108-
✗ Ed25519
109107
✗ ML-DSA
110108
✗ SLH-DSA
111109
✗ ML-KEM
@@ -117,9 +115,11 @@ Public OpenSSL API (libssl.so & libcrypto.so):
117115
version: 3.6.0
118116
119117
FIPS cryptographic module provider details (fips.so):
120-
name: OpenSSL FIPS Provider
121-
version: 3.1.2
122-
build: 3.1.2
118+
name: Chainguard FIPS Provider for OpenSSL
119+
version: 3.4.0
120+
build: 3.4.0-r4
123121
124-
Locate applicable CMVP certificate(s) at: CMVP #4985
122+
Locate applicable certificate(s) at: CMVP #5132 (with entropy #E191)
123+
124+
Lifecycle assurance satisfied.
125125
```

openssl-fips-test.c

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,13 @@ static void print_non_security_digests(void) {
267267
if (digest != NULL) {
268268

269269
fprintf(stderr, GREEN_CHECK);
270-
fprintf(stderr, " %s", non_approved_digests[i].name);
270+
fprintf(stderr, "%s", non_approved_digests[i].name);
271271
EVP_MD_free(digest);
272272
digest = NULL;
273273
} else {
274274
fprintf(stderr, "\t");
275275
fprintf(stderr, RED_CROSS);
276-
fprintf(stderr, " %s", non_approved_digests[i].name);
276+
fprintf(stderr, "%s", non_approved_digests[i].name);
277277
fprintf(stderr, "- expect failures with all public cloud SDKs");
278278
}
279279
fprintf(stderr, "\n");
@@ -372,20 +372,42 @@ static void print_module_version(void) {
372372
if (OSSL_PARAM_modified(params + 2))
373373
fprintf(stderr, "\t%-10s\t%s\n", "build:", build);
374374

375-
fprintf(stderr, "\nLocate applicable CMVP certificate(s) at: ");
375+
fprintf(stderr, "\nLocate applicable certificate(s) at: ");
376376
/* NIST CMVP search still does not have a version search working */
377-
if (strcmp(name, "Chainguard FIPS Provider for OpenSSL") == 0
378-
&& strncmp(vers, "3.1.2", 5) == 0) {
379-
fprintf(stderr, "%s%s%s%s%s%s%s\n",
380-
OSC_8_START,
381-
"https://csrc.nist.gov/projects/cryptographic-module-validation-program/certificate/5102",
382-
OSC_8_END,
383-
"CMVP #5102",
384-
OSC_8_START,
385-
"",
386-
OSC_8_END
387-
);
388-
return;
377+
if (strcmp(name, "Chainguard FIPS Provider for OpenSSL") == 0) {
378+
if (strncmp(vers, "3.1.2", 5) == 0) {
379+
fprintf(stderr, "%s%s%s%s%s%s%s\n",
380+
OSC_8_START,
381+
"https://csrc.nist.gov/projects/cryptographic-module-validation-program/certificate/5102",
382+
OSC_8_END,
383+
"CMVP #5102",
384+
OSC_8_START,
385+
"",
386+
OSC_8_END
387+
);
388+
return;
389+
}
390+
if (strncmp(vers, "3.4.0", 5) == 0) {
391+
fprintf(stderr, "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
392+
OSC_8_START,
393+
"https://csrc.nist.gov/projects/cryptographic-module-validation-program/certificate/5132",
394+
OSC_8_END,
395+
"CMVP #5132",
396+
OSC_8_START,
397+
"",
398+
OSC_8_END,
399+
" (with ",
400+
OSC_8_START,
401+
"https://csrc.nist.gov/projects/cryptographic-module-validation-program/entropy-validations/certificate/191",
402+
OSC_8_END,
403+
"entropy #E191",
404+
OSC_8_START,
405+
"",
406+
OSC_8_END,
407+
")"
408+
);
409+
return;
410+
}
389411
}
390412
if (strcmp(name, "OpenSSL FIPS Provider") == 0
391413
&& strncmp(vers, "3.1.2", 5) == 0) {
@@ -450,9 +472,12 @@ main(int argc, const char *argv[])
450472
if (rc == EXIT_SUCCESS) {
451473
print_non_security_digests();
452474
//print_security_digests();
453-
print_security_features();
475+
print_security_features();
454476
print_base_version();
455477
print_module_version();
478+
fprintf(stderr, BOLD_GREEN);
479+
fprintf(stderr, "\nLifecycle assurance satisfied.");
480+
fprintf(stderr, RESET);
456481
fprintf(stderr, "\n");
457482
} else {
458483
fprintf(stderr, BOLD_RED);

0 commit comments

Comments
 (0)