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

Fix bug in scrypt KDF provider dup method #17873

Closed
wants to merge 1 commit into from

Conversation

hlandau
Copy link
Member

@hlandau hlandau commented Mar 11, 2022

The scrypt KDF provider's dup method calls kdf_scrypt_new passing a libctx, but a provider context is expected. Since the provider context is passed as void *, this was not caught.

Discovered while refactoring libctx.

This method was not implemented for scrypt in 3.0, so not applicable to it.

The scrypt KDF provider's dup method calls kdf_scrypt_new passing a
libctx, but a provider context is expected. Since the provider context
is passed as void *, this was not caught.
@hlandau hlandau added branch: master Merge to master branch approval: review pending This pull request needs review by a committer approval: otc review pending This pull request needs review by an OTC member triaged: bug The issue/pr is/fixes a bug labels Mar 11, 2022
@hlandau hlandau self-assigned this Mar 11, 2022
@mattcaswell mattcaswell removed the approval: otc review pending This pull request needs review by an OTC member label Mar 11, 2022
Copy link
Member

@t8m t8m left a comment

Choose a reason for hiding this comment

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

Is this somehow reasonably easily testable? If not, I am ok approving it without a test.

@t8m t8m added approval: done This pull request has the required number of approvals and removed approval: review pending This pull request needs review by a committer labels Mar 11, 2022
@hlandau
Copy link
Member Author

hlandau commented Mar 11, 2022

@t8m I was just thinking about this. The dup operation is actually already exercised in test_evp and it's thanks to that that this was caught; refactoring libctx somehow caused this to be exposed in the test suite. Maybe the struct layouts of the different structures happened to align that it somehow worked. Since dup is already tested I'm not sure adding more tests for it would have helped.

@openssl-machine
Copy link
Collaborator

24 hours has passed since 'approval: done' was set, but as this PR has been updated in that time the label 'approval: ready to merge' is not being automatically set. Please review the updates and set the label manually.

@t8m t8m added approval: ready to merge The 24 hour grace period has passed, ready to merge and removed approval: done This pull request has the required number of approvals labels Mar 14, 2022
openssl-machine pushed a commit that referenced this pull request Mar 14, 2022
The scrypt KDF provider's dup method calls kdf_scrypt_new passing a
libctx, but a provider context is expected. Since the provider context
is passed as void *, this was not caught.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #17873)
@mattcaswell
Copy link
Member

It seems this has been merged, so closing.

t8m pushed a commit to t8m/openssl that referenced this pull request Nov 4, 2022
The scrypt KDF provider's dup method calls kdf_scrypt_new passing a
libctx, but a provider context is expected. Since the provider context
is passed as void *, this was not caught.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from openssl#17873)

(cherry picked from commit e04c2c0)
t8m pushed a commit to t8m/openssl that referenced this pull request Nov 4, 2022
The scrypt KDF provider's dup method calls kdf_scrypt_new passing a
libctx, but a provider context is expected. Since the provider context
is passed as void *, this was not caught.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from openssl#17873)

(cherry picked from commit e04c2c0)
t8m pushed a commit to t8m/openssl that referenced this pull request Nov 9, 2022
The scrypt KDF provider's dup method calls kdf_scrypt_new passing a
libctx, but a provider context is expected. Since the provider context
is passed as void *, this was not caught.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from openssl#17873)

(cherry picked from commit e04c2c0)
openssl-machine pushed a commit that referenced this pull request Nov 11, 2022
The scrypt KDF provider's dup method calls kdf_scrypt_new passing a
libctx, but a provider context is expected. Since the provider context
is passed as void *, this was not caught.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #17873)

(cherry picked from commit e04c2c0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approval: ready to merge The 24 hour grace period has passed, ready to merge branch: master Merge to master branch triaged: bug The issue/pr is/fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants