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

Fix dh_rfc5114 option in genpkey. #14883

Closed
wants to merge 8 commits into from
Closed

Conversation

slontis
Copy link
Member

@slontis slontis commented Apr 15, 2021

Updated documentation for app to indicate what options are available for
DH and DHX keys. Added CHANGES entry to indicate the breaking change.

Checklist
  • documentation is added or updated
  • tests are added or updated

@slontis slontis added approval: review pending This pull request needs review by a committer branch: master Merge to master branch labels Apr 15, 2021
@slontis slontis force-pushed the dh_rfc5114_fix branch 2 times, most recently from 285657e to 31df095 Compare April 20, 2021 03:59
Copy link
Member

@t8m t8m left a comment

Choose a reason for hiding this comment

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

Just minor nits, otherwise I like this very much.

CHANGES.md Outdated Show resolved Hide resolved
CHANGES.md Outdated Show resolved Hide resolved
crypto/dh/dh_pmeth.c Outdated Show resolved Hide resolved
doc/man1/openssl-genpkey.pod.in Outdated Show resolved Hide resolved
Fixes openssl#14145
Fixes openssl#13956
Fixes openssl#13952
Fixes openssl#13871
Fixes openssl#14054
Fixes openssl#14444

Updated documentation for app to indicate what options are available for
DH and DHX keys.

DH and DHX now have different keymanager gen_set_params() methods.

Added CHANGES entry to indicate the breaking change.
@slontis
Copy link
Member Author

slontis commented Apr 21, 2021

Quite a few changes in the last 3 commits - had to rebase to update the commit message..

@slontis
Copy link
Member Author

slontis commented Apr 21, 2021

This errors in the setparams if bad parameters are passed in. If we dont do this then potentially it would do something different from what was expected.

@t8m
Copy link
Member

t8m commented Apr 21, 2021

The CI failures are relevatnt.

@t8m
Copy link
Member

t8m commented Apr 21, 2021

(Except for the external-tests, that is a different thing)

@@ -113,9 +113,7 @@ const DH_NAMED_GROUP *ossl_ffc_numbers_to_dh_named_group(const BIGNUM *p,
if (BN_cmp(p, dh_named_groups[i].p) == 0
&& BN_cmp(g, dh_named_groups[i].g) == 0
/* Verify q is correct if it exists */
&& ((q != NULL && BN_cmp(q, dh_named_groups[i].q) == 0)
/* Do not match RFC 5114 groups without q */
|| (q == NULL && dh_named_groups[i].uid > 3)))
Copy link
Member Author

Choose a reason for hiding this comment

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

NOTE - this line was a hack to fix a decoder test issue - the root cause was fixed so this is no longer needed. This allows RFC5114 to be able to be loaded correctly as a named group. (The original problem was that the DH asn1 callback was not setting the nid - but it was for DHX asn1)

Copy link
Member

@t8m t8m left a comment

Choose a reason for hiding this comment

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

A few more minor nits otherwise LGTM

doc/man7/EVP_PKEY-DH.pod Outdated Show resolved Hide resolved
doc/man7/EVP_PKEY-DH.pod Outdated Show resolved Hide resolved
doc/man7/EVP_PKEY-DH.pod Outdated Show resolved Hide resolved
providers/implementations/keymgmt/dh_kmgmt.c Outdated Show resolved Hide resolved
providers/implementations/keymgmt/dh_kmgmt.c Outdated Show resolved Hide resolved
doc/man7/EVP_PKEY-DH.pod Outdated Show resolved Hide resolved
doc/man1/openssl-genpkey.pod.in Outdated Show resolved Hide resolved
@slontis
Copy link
Member Author

slontis commented Apr 22, 2021

NITS addressed

Copy link
Member

@t8m t8m left a comment

Choose a reason for hiding this comment

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

Great work!

@t8m t8m 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 Apr 23, 2021
@openssl-machine openssl-machine 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 Apr 24, 2021
@openssl-machine
Copy link
Collaborator

This pull request is ready to merge

openssl-machine pushed a commit that referenced this pull request Apr 26, 2021
Fix dh_rfc5114 option in genpkey.

Fixes #14145
Fixes #13956
Fixes #13952
Fixes #13871
Fixes #14054
Fixes #14444

Updated documentation for app to indicate what options are available for
DH and DHX keys.

DH and DHX now have different keymanager gen_set_params() methods.

Added CHANGES entry to indicate the breaking change.

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

t8m commented Apr 26, 2021

Merged to master. I've added a new title line of the commit message as the original one did not really cover all the change. Thank you for the contribution, Shane!

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

4 participants