Skip to content

Fix test_kdf.rb in FIPS.#1054

Merged
rhenium merged 1 commit into
ruby:masterfrom
junaruga:wip/fips-test-kdf
May 29, 2026
Merged

Fix test_kdf.rb in FIPS.#1054
rhenium merged 1 commit into
ruby:masterfrom
junaruga:wip/fips-test-kdf

Conversation

@junaruga
Copy link
Copy Markdown
Member

I fixed test_kdf.rb in FIPS.


This was referenced May 20, 2026
Comment thread test/openssl/test_kdf.rb Outdated
Comment thread test/openssl/test_kdf.rb Outdated
Comment thread test/openssl/test_kdf.rb Outdated
@junaruga junaruga force-pushed the wip/fips-test-kdf branch from 6c82315 to ffc54e8 Compare May 25, 2026 14:27
@junaruga
Copy link
Copy Markdown
Member Author

junaruga commented May 25, 2026

@rhenium I fixed the things reviewed by you on the latest rebase, updating the commit message. Could you review again? Thank you.

Comment thread test/openssl/test_kdf.rb Outdated
@junaruga junaruga force-pushed the wip/fips-test-kdf branch 2 times, most recently from cb23294 to 4b5eba5 Compare May 25, 2026 15:32
Comment thread test/openssl/test_kdf.rb Outdated
* PBKDF2 salt >= 16 bytes (128 bits) and iterations >= 1000 are required in
  FIPS.
  SP 800-132: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf
  * 5.1 The Salt (S)
    https://github.com/openssl/openssl/blob/71943544885ff364a10bcc5ffc62d0e651c9a021/providers/implementations/kdfs/pbkdf2.c#L235-L240
  * 5.2 The Iteration Count (C)
    https://github.com/openssl/openssl/blob/71943544885ff364a10bcc5ffc62d0e651c9a021/providers/implementations/kdfs/pbkdf2.c#L247-L252
* scrypt (RFC 7914) is not available in FIPS.
  EVP_KDF_fetch(ctx, OSSL_KDF_NAME_SCRYPT, propq) returns NULL in FIPS.
  https://github.com/openssl/openssl/blob/71943544885ff364a10bcc5ffc62d0e651c9a021/crypto/evp/pbe_scrypt.c#L67-L71
* Keep only one RFC 6070 test (test_pbkdf2_hmac_sha1_rfc6070_c_4096_len_25).
  Remove other RFC 6070 tests (test_*_rfc6070_*) don't work in FIPS.
  Keeping one RFC 6070 test is good enough.
* Remove test_hkdf_rfc5869_test_case_4 in favor of the new
  test_hkdf_rfc5869_test_case_5.
* We want to avoid conditional tests that don't work in FIPS as much as possible.
@junaruga junaruga force-pushed the wip/fips-test-kdf branch from 4b5eba5 to 450721c Compare May 25, 2026 18:11
@junaruga
Copy link
Copy Markdown
Member Author

@rhenium I fixed the things reviewed by you on the latest rebase, updating the commit message again. Could you review again? Thank you.

Copy link
Copy Markdown
Member

@rhenium rhenium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@rhenium rhenium merged commit 3b00e98 into ruby:master May 29, 2026
47 checks passed
@junaruga junaruga deleted the wip/fips-test-kdf branch May 29, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants