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

Verify success of BIO_new_file() #1488

Merged
merged 1 commit into from
Apr 6, 2023

Conversation

davidBar-On
Copy link
Contributor

Suggested fix crash when public/private key file does not exist - may not be th full fix as the issue didn't happen on my PC. However, the output of BIO_new_file() was not checked, which could lead to such crash in PEM_read_bio_xxxxKey() (depending on the library implementation).

In addition moved reading the private key file before prompting for the password, so the user will not have to enter password before the failure because file does not exist.

@bmah888
Copy link
Contributor

bmah888 commented Apr 6, 2023

Thanks for the PR! While I was setting up to test this, I realized that the original crash doesn't happen on my test setups either (FreeBSD 13 and Ubuntu 20). But I think having the added error handling is a good idea, as well as the workflow change for getting the passwd from the user.

Copy link
Contributor

@bmah888 bmah888 left a comment

Choose a reason for hiding this comment

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

This looks great, let's get this merged.

@bmah888 bmah888 merged commit 0698d85 into esnet:master Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When the file doesnt exists (--rsa-public-key-path), execution results in Segmentation fault
2 participants