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

[1.1.1][test][15-test_genec] Improve EC tests with genpkey #12308

Conversation

@romen
Copy link
Member

@romen romen commented Jun 28, 2020

Test separately EC parameters and EC key generation.

For some curves we have had cases in which generating the parameters
under certain conditions failed, while generating and serializing a key
under the same conditions did not.
See #12306 for more details.

This is related to #12307 (does the same thing for master) but is opened against 1.1.1 because the backport is not trivial due to the need for TODO: {} annotations until #12102 is fixed.

Checklist
  • tests are added or updated
  • #12312 is approved
  • #12305 is approved
romen added 7 commits Jun 28, 2020
…ters and keys

The following built-in curves do not have an assigned OID:

- Oakley-EC2N-3
- Oakley-EC2N-4

In general we shouldn't assume that an OID is always available.

This commit detects such cases, raises an error and returns appropriate
return values so that the condition can be detected and correctly
handled by the callers, when serializing EC parameters or EC keys with
the default `ec_param_enc:named_curve`.

Fixes #12306

(cherry picked from commit e810483)
… parameters and keys

make update

(cherry picked from commit 342e858)
If the key is to be serialized or printed as text and the framework
returns an error, the app should signal the failure to the user using
a non-zero exit status.

(cherry picked from commit a2bce31)
Test separately EC parameters and EC key generation.

For some curves we have had cases in which generating the parameters
under certain conditions failed, while generating and serializing a key
under the same conditions did not.
See <#12306> for more details.
[test][15-test_genec] Some curves only support explicit params encoding
@romen romen force-pushed the romen:backports/1.1.1/improve_test_genec branch to bd189f9 Jun 29, 2020
@romen
Copy link
Member Author

@romen romen commented Jun 29, 2020

Rebased on top of #12312 , #12305 .

#12312 and #12305 fail the tests (intentionally) if the changes from this PR are not merged on top.

@romen
Copy link
Member Author

@romen romen commented Jul 3, 2020

@mattcaswell can you spare some time to look at this as well?

@romen
Copy link
Member Author

@romen romen commented Jul 4, 2020

This was approved at

  • Fri, 3 Jul 2020 13:51:00 +0000

It will be ready to merge at
Fri, 4 Jul 2020 13:51:01 +0000

romen added a commit to romen/openssl that referenced this pull request Jul 4, 2020
Test separately EC parameters and EC key generation.

Some curves only support explicit params encoding.

For some curves we have had cases in which generating the parameters
under certain conditions failed, while generating and serializing a key
under the same conditions did not.
See <openssl#12306> for more details.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from openssl#12308)
@openssl-machine
Copy link

@openssl-machine openssl-machine commented Jul 5, 2020

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 Jul 7, 2020
Test separately EC parameters and EC key generation.

Some curves only support explicit params encoding.

For some curves we have had cases in which generating the parameters
under certain conditions failed, while generating and serializing a key
under the same conditions did not.
See <#12306> for more details.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from #12308)
@romen
Copy link
Member Author

@romen romen commented Jul 7, 2020

Merged to 1.1.1 as:

  • e1c246b [test][15-test_genec] Improve EC tests with genpkey

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants