Skip to content

hkdf: Replace nil salt with a slice of a preallocated all zeros buffer #260

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

Merged

Conversation

samiponkanenssh
Copy link
Contributor

hkdf: Replace nil salt with a slice of a preallocated all zeros buffer. This fixes HKDF when using KeyPair FIPS Provider for OpenSSL 3

Fixes #253

…r. This fixes HKDF when using KeyPair FIPS Provider for OpenSSL 3
@samiponkanenssh samiponkanenssh requested a review from qmuntal March 3, 2025 08:18
Copy link
Collaborator

@qmuntal qmuntal left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

@qmuntal qmuntal requested review from derekparker and dagood March 3, 2025 08:38
@samiponkanenssh samiponkanenssh requested a review from dagood March 6, 2025 10:20
Copy link
Collaborator

@dagood dagood left a comment

Choose a reason for hiding this comment

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

Thanks!

@qmuntal qmuntal merged commit 7fa651e into golang-fips:v2 Mar 7, 2025
25 checks passed
nicholasberlin pushed a commit to nicholasberlin/openssl that referenced this pull request May 2, 2025
golang-fips#260)

* hkdf: Replace nil salt with a slice of a preallocated all zeros buffer. This fixes HKDF when using KeyPair FIPS Provider for OpenSSL 3

* hkdf: fixed PR review comments

* hkdf: second round of PR comment fixes

* hkdf: third round of PR comment fixes
nicholasberlin pushed a commit to nicholasberlin/openssl that referenced this pull request May 5, 2025
golang-fips#260)

* hkdf: Replace nil salt with a slice of a preallocated all zeros buffer. This fixes HKDF when using KeyPair FIPS Provider for OpenSSL 3

* hkdf: fixed PR review comments

* hkdf: second round of PR comment fixes

* hkdf: third round of PR comment fixes
nicholasberlin pushed a commit to nicholasberlin/openssl that referenced this pull request May 5, 2025
golang-fips#260)

* hkdf: Replace nil salt with a slice of a preallocated all zeros buffer. This fixes HKDF when using KeyPair FIPS Provider for OpenSSL 3

* hkdf: fixed PR review comments

* hkdf: second round of PR comment fixes

* hkdf: third round of PR comment fixes
qmuntal added a commit that referenced this pull request May 5, 2025
* Add support for the TLS13-KDF algorithm (#272)

* Add support for the TLS13-KDF algorithm

* Change to opt-in

* Code review suggestions

- Don't panic if there's no support
- Don't export the parse function
  - Move unit tests to hkdf_interal_test.go which use the same package
- Rework the parse function to return a boolean at the end

* Purge parsing

Reduce to only an Expand function based on TLS13-KDF
Remove associated cruft
Add new unit tests

* Update hkdf.go

Co-authored-by: Quim Muntal <quimmuntal@gmail.com>

* Update hkdf.go

Co-authored-by: Quim Muntal <quimmuntal@gmail.com>

* Be explicit, not clever.

* Do not ignore testdata/

* panic for unknown openssl versions

---------

Co-authored-by: Quim Muntal <quimmuntal@gmail.com>

* Fix up cherry-pick

* hkdf: Replace nil salt with a slice of a preallocated all zeros buffer (#260)

* hkdf: Replace nil salt with a slice of a preallocated all zeros buffer. This fixes HKDF when using KeyPair FIPS Provider for OpenSSL 3

* hkdf: fixed PR review comments

* hkdf: second round of PR comment fixes

* hkdf: third round of PR comment fixes

---------

Co-authored-by: Quim Muntal <quimmuntal@gmail.com>
Co-authored-by: samiponkanenssh <112563010+samiponkanenssh@users.noreply.github.com>
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.

TLS 1.3 HKDF-Extract with empty salt fails when using the KeyPair FIPS Provider
3 participants