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

check the return value of ossl_bio_new_from_core_bio #17154

Closed
wants to merge 2 commits into from

Conversation

x2018
Copy link
Contributor

@x2018 x2018 commented Nov 29, 2021

check the return value of ossl_bio_new_from_core_bio in 8 different spots:

​ providers/implementations/encode_decode/decode_pvk2key.c:87:15
​ providers/implementations/encode_decode/decode_epki2pki.c:70:15
​ providers/implementations/encode_decode/decode_pem2der.c:35:15
​ providers/implementations/encode_decode/decode_msblob2key.c:87:15
​ providers/implementations/encode_decode/encode_key2ms.c:41:16
​ providers/implementations/encode_decode/encode_key2ms.c:57:11
​ providers/implementations/encode_decode/encode_key2blob.c:32:16
​ providers/implementations/encode_decode/endecoder_common.c:91:15

Note: I am not very familiar with these functions, but I had tried to keep their functionalities as the original. For example, I tracked the return value of the subsequent function(such as i2b_PVK_bio_ex() in encode_key2ms.c:58, etc) when an error happens is -1, so I set the return value to -1 when the return value of ossl_bio_new_from_core_bio() in encode_key2ms.c:57 is NULL.

@t8m t8m added branch: 3.0 Merge to openssl-3.0 branch branch: master Merge to master branch triaged: bug The issue/pr is/fixes a bug labels Nov 29, 2021
@x2018
Copy link
Contributor Author

x2018 commented Nov 30, 2021

Changed them. I apologize for my negligence as I just keep the original logic but do not fix them to the correct route such as -1 is just tracked the return value in the following functions to be called.

@t8m t8m added the approval: review pending This pull request needs review by a committer label Nov 30, 2021
@x2018
Copy link
Contributor Author

x2018 commented Dec 30, 2021

This seems to have been forgotten...

Copy link
Member

@mattcaswell mattcaswell left a comment

Choose a reason for hiding this comment

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

Looks good - although there is now a conflict which needs resolving.

@x2018 x2018 force-pushed the ossl_bio_new_from_core_bio_retchk branch from 1ac9b06 to 9226cc9 Compare December 30, 2021 11:58
@mattcaswell
Copy link
Member

Ah, you used a merge commit. Unfortunately we do not accept merge commits. You need to rebase on top of the latest master instead.

@x2018 x2018 force-pushed the ossl_bio_new_from_core_bio_retchk branch from 450d3e1 to 76ed26a Compare December 30, 2021 14:39
Copy link
Member

@mattcaswell mattcaswell left a comment

Choose a reason for hiding this comment

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

LGTM

@mattcaswell mattcaswell 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 Dec 30, 2021
@openssl-machine
Copy link
Collaborator

24 hours has passed since 'approval: done' was set, but this PR has failing CI tests. Once the tests pass it will get moved to 'approval: ready to merge' automatically, alternatively please review 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 Jan 3, 2022
openssl-machine pushed a commit that referenced this pull request Jan 3, 2022
There are missing checks of its return value in 8 different spots.

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

(cherry picked from commit 352a0bc)
openssl-machine pushed a commit that referenced this pull request Jan 3, 2022
There are missing checks of its return value in 8 different spots.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #17154)
@t8m
Copy link
Member

t8m commented Jan 3, 2022

Squashed, fixed end-of-line whitespace issues, merged to master and 3.0 branches. Thank you for your contribution.

@t8m t8m closed this Jan 3, 2022
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 branch: 3.0 Merge to openssl-3.0 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

4 participants