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

Implement OpenSSL secure memory for Windows #13172

Closed
wants to merge 5 commits into from

Conversation

jgowdy
Copy link
Contributor

@jgowdy jgowdy commented Oct 18, 2020

Hello, please review this pull request implementing CRYPTO_secure_malloc and the associated functions for the Windows platform using equivalent functions such as VirtualAlloc for mmap, etc. Thank you.

Checklist

Documentation for CRYPTO_secure_malloc(3) doesn't seem to mention which platforms are and are not supported, so I do not believe any update is required.

Existing secmemtest should cover Windows implementation

Copy link
Contributor

@paulidale paulidale 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 good, I'm not Windows savvy though. Just a few style nitpicks.

crypto/mem_sec.c Outdated Show resolved Hide resolved
crypto/mem_sec.c Outdated Show resolved Hide resolved
e_os.h Outdated
&& ( (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L) \
|| defined(__sun) || defined(__hpux) || defined(__sgi) \
|| defined(__osf__) )
|| defined(__osf__) )) || defined(_WIN32)
Copy link
Contributor

Choose a reason for hiding this comment

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

Break the || defined(_WIN32) onto the next line. The indentation is also off with the addition of the initial (.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm hoping I got this right now, can you double check me please?

crypto/mem_sec.c Show resolved Hide resolved
@jgowdy
Copy link
Contributor Author

jgowdy commented Oct 19, 2020

Great, happy to fix up those nits! Any other feedback is welcome.

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.

I'm not really a Windows guy either, but from my reading of the API docs this looks good aside from the couple of comments below.

crypto/mem_sec.c Outdated Show resolved Hide resolved
crypto/mem_sec.c Show resolved Hide resolved
@jgowdy
Copy link
Contributor Author

jgowdy commented Oct 19, 2020

If you don't mind, could you possibly label this PR as 'hacktoberfest-accepted'? I did not make this pull request for the purpose of hacktoberfest, but I am participating. Thanks!

@mattcaswell
Copy link
Member

If you don't mind, could you possibly label this PR as 'hacktoberfest-accepted'?

Could you explain what the label actually means? I'm not familiar with it.

@paulidale
Copy link
Contributor

And how to add it...

@jgowdy
Copy link
Contributor Author

jgowdy commented Oct 20, 2020

It's just a label on the PR that allows the PR to count towards the goals of https://hacktoberfest.digitalocean.com which is a challenge for people to contribute towards open source projects in October.

It's not a big deal, but if you would set a label field on the PR to that string I would get credit for it.

The itself PR is what matters though. I didn't make the PR for the sake of Hacktoberfest.

@t8m
Copy link
Member

t8m commented Oct 20, 2020

I am not sure we want to add such label to our already quite long list of labels. They suggest that making a PR on your own repository fork will be also counted.

@mspncp
Copy link
Contributor

mspncp commented Oct 20, 2020

According to https://hacktoberfest.digitalocean.com

image

it needs to be a GitHub topic not a label.

@mspncp
Copy link
Contributor

mspncp commented Oct 20, 2020

C'mon @openssl/omc, why not add it? It might attract lotsofpullrequests ;-)

@mspncp
Copy link
Contributor

mspncp commented Oct 20, 2020

@openssl/omc talking about topics: maybe we should also consider adding also other more serious topics to our repo?

@mspncp
Copy link
Contributor

mspncp commented Oct 20, 2020

If you don't mind, could you possibly label this PR as 'hacktoberfest-accepted'?

Could you explain what the label actually means? I'm not familiar with it.

Ok, so there is also a label for explicit opt-in: https://hacktoberfest.digitalocean.com/hacktoberfest-update

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. Needs second review.

@mattcaswell mattcaswell added approval: review pending This pull request needs review by a committer branch: master Merge to master branch labels Oct 20, 2020
@mspncp
Copy link
Contributor

mspncp commented Oct 20, 2020

@mattcaswell @paulidale I think this deserves a hacktoberfest-accepted label when it gets the necessary approvals, what do you think?

@mattcaswell
Copy link
Member

I'm ok with that.

@paulidale
Copy link
Contributor

paulidale commented Oct 20, 2020

I'm fine with the label for this or for the project to participate (although I worry about attracting lots of extra work right now).

@mspncp
Copy link
Contributor

mspncp commented Oct 21, 2020

Don’t worry @paulidale, only ten days to go ;-)

@paulidale paulidale 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 Oct 21, 2020
@paulidale
Copy link
Contributor

paulidale commented Oct 21, 2020

I've posited the hacktoberfest question to the project list.

@mspncp
Copy link
Contributor

mspncp commented Oct 21, 2020

I've posited the hacktoberfest question to the project list.

@jgowdy thank you for your contribution! Your pull request has reached the required number of approvals and will be merged after the 24 hour grace period. @mattcaswell and @paulidale already indicated consent to your request for a Hacktoberfest badge, but I'll wait another day or so to add it, in order not to preempt the discussion on the mailing list.

@jgowdy
Copy link
Contributor Author

jgowdy commented Oct 21, 2020

Excellent, thank you all!

@jgowdy
Copy link
Contributor Author

jgowdy commented Oct 21, 2020

I've actually completed the Hacktoberfest challenge already, so we can skip the label. I don't want to pollute the label list for no reason. I appreciate the consideration.

@mspncp
Copy link
Contributor

mspncp commented Oct 21, 2020

I've actually completed the Hacktoberfest challenge already, so we can skip the label. I don't want to pollute the label list for no reason. I appreciate the consideration.

Ok, thanks to you for pointing us to the Hacktoberfest challenge. At the least, we will take a look and consider whether it makes sense to add the Hacktoberfest topic to the repo next year.

@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.

openssl-machine pushed a commit that referenced this pull request Oct 22, 2020
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from #13172)
@paulidale paulidale 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 Oct 22, 2020
@paulidale
Copy link
Contributor

Merged to master. Thanks.

@paulidale paulidale closed this Oct 22, 2020
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants