Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Runtime check for EC keys in Secure Session #693
Runtime check for EC keys in Secure Session #693
Changes from 4 commits
2406fe2
ffd3ae5
b8cf3af
668db5e
2222185
b39cdfd
4e2d4e5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It guess it's not necessary to include this any more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remember: using
memcpy
is ok only for tests / non-sensitive dataThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's test public key and make sure that tests are passing and write comment why is that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, it's would be better to split this into separate tests: RSA private keys, RSA public keys, EC public keys.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this a weird way to setup a Secure Session – with global variables and memcpy() – but I'll let it pass given that all tests here are like that. It's not nice coding practice because it makes impossible to run the tests in parallel. However, refactoring this is a topic for another day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the easiest way to refactor this is to mark those glogal vars as thread local and then create as many threads as we like, so they will run in parallel. Another question is whether the test framework is ready for such changes. And these tests are really fast, like almost instant, and the only computation-heavy check is
soter rand: NIST STS
, which, btw, only uses one CPU core.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also just create a new client context and callbacks for each test :) Which is arguably more readable and obvious than thread-local variables. It's more verbose, yeah, but dumb test code is better than smart one, IMO.