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

Impossible to clear the label with EVP_PKEY_CTX_set0_rsa_oaep_label() #21288

Closed
hxtzzz opened this issue Jun 27, 2023 · 4 comments
Closed

Impossible to clear the label with EVP_PKEY_CTX_set0_rsa_oaep_label() #21288

hxtzzz opened this issue Jun 27, 2023 · 4 comments
Labels
branch: master Merge to master branch branch: 3.0 Merge to openssl-3.0 branch branch: 3.1 Merge to openssl-3.1 triaged: bug The issue/pr is/fixes a bug

Comments

@hxtzzz
Copy link

hxtzzz commented Jun 27, 2023

The version of OpenSSL is 3.0.7 and the 3.0 doc shows that
'EVP_PKEY_CTX_set0_rsa_oaep_label() sets the RSA OAEP label to binary data label and its length in bytes to len. If label is NULL or len is 0, the label is cleared. The library takes ownership of the label so the caller should not free the original memory pointed to by label. The padding mode must have been set to RSA_PKCS1_OAEP_PADDING.'
But when I use the input of NULL or 0 length, the return value is 0 and it seems that it is same as the wrong use situation.
Shoud it return 1 instead of 0 as well as the common return value?

@hxtzzz hxtzzz added the issue: question The issue was opened to ask a question label Jun 27, 2023
@t8m t8m added triaged: bug The issue/pr is/fixes a bug and removed issue: question The issue was opened to ask a question labels Jun 27, 2023
@t8m
Copy link
Member

t8m commented Jun 27, 2023

Is the return value 0 for non-NULL input label pointer but with 0 length?

@hxtzzz
Copy link
Author

hxtzzz commented Jun 28, 2023

Yes, when the input value is non-null and 0 length, the return value is still 0.

@hxtzzz
Copy link
Author

hxtzzz commented Jun 28, 2023

Is the return value 0 for non-NULL input label pointer but with 0 length?

Yes, when the input value is non-null and 0 length, the return value is still 0.

@t8m t8m added branch: master Merge to master branch branch: 3.0 Merge to openssl-3.0 branch branch: 3.1 Merge to openssl-3.1 labels Jun 28, 2023
@t8m t8m changed the title Question: the return value when the input label of EVP_PKEY_CTX_set0_rsa_oaep_label() is NULL or its length is 0 Impossible to clear the label with EVP_PKEY_CTX_set0_rsa_oaep_label() Jun 28, 2023
@t8m
Copy link
Member

t8m commented Oct 19, 2023

This should be now fixed.

@t8m t8m closed this as completed Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch: master Merge to master branch branch: 3.0 Merge to openssl-3.0 branch branch: 3.1 Merge to openssl-3.1 triaged: bug The issue/pr is/fixes a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants