Skip to content

Comments

Check the modulus bit length#9796

Closed
bernd-edlinger wants to merge 3 commits intoopenssl:masterfrom
bernd-edlinger:check_bit_length_in_dh_check
Closed

Check the modulus bit length#9796
bernd-edlinger wants to merge 3 commits intoopenssl:masterfrom
bernd-edlinger:check_bit_length_in_dh_check

Conversation

@bernd-edlinger
Copy link
Member

@bernd-edlinger bernd-edlinger commented Sep 6, 2019

The check was missing in DH_check and DH_check_params.
DH_check_pub_key_ex was accidentally calling DH_check,
so results were undefined.

[extended tests]

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

@bernd-edlinger bernd-edlinger force-pushed the check_bit_length_in_dh_check branch 2 times, most recently from 31617c6 to 9a60820 Compare September 6, 2019 22:38
The check was missing in DH_check and DH_check_params.

[extended tests]
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.

Looks good, just one query about clearing the pub_key field when freeing. It looks odd.

@bernd-edlinger
Copy link
Member Author

Can I cherry-pick the commit
fc0f536 "DH_check_pub_key_ex was accidentally calling DH_check" to 1.1.1
and
fdde60f "Use BN_clear_free in DH_set0_key" to all 1.1.1, 1.1.0 and 1.0.2

@levitte
Copy link
Member

levitte commented Sep 9, 2019

Is this for master only? If not, it should be labeled appropriately

UPDATE: oh...

@bernd-edlinger
Copy link
Member Author

Yes, sorry for confusion, but whenever I look somewhere, something comes up.

@paulidale
Copy link
Contributor

I'm okay with cherry picking the changes.

levitte pushed a commit that referenced this pull request Sep 9, 2019
The check was missing in DH_check and DH_check_params.

[extended tests]

Reviewed-by: Paul Dale <[email protected]>
(Merged from #9796)
levitte pushed a commit that referenced this pull request Sep 9, 2019
Reviewed-by: Paul Dale <[email protected]>
(Merged from #9796)
levitte pushed a commit that referenced this pull request Sep 9, 2019
so results were undefined.

Reviewed-by: Paul Dale <[email protected]>
(Merged from #9796)
levitte pushed a commit that referenced this pull request Sep 9, 2019
so results were undefined.

Reviewed-by: Paul Dale <[email protected]>
(Merged from #9796)

(cherry picked from commit 2b95e8e)
levitte pushed a commit that referenced this pull request Sep 9, 2019
Reviewed-by: Paul Dale <[email protected]>
(Merged from #9796)

(cherry picked from commit fa01370)
levitte pushed a commit that referenced this pull request Sep 9, 2019
Reviewed-by: Paul Dale <[email protected]>
(Merged from #9796)

(cherry picked from commit fa01370)
@bernd-edlinger
Copy link
Member Author

Merged to all branches where applicable, cherry-pick for 1.0.2 did fail,
maybe I'll make another PR for that. Thanks!

mattcaswell added a commit to mattcaswell/openssl that referenced this pull request Mar 4, 2021
The dh_test was failing because we now enforce a lower bound on the
modulus size that may be used. A number of locations in dhtest.c were
assuming that a very small modulus is valid.

A 512 bit lower bound was introduced by PR openssl#9437 (commit 6de1fe9) and
subsequently amended by PR openssl#9796 (commit feeb7ec).

The CHANGES entry says this:

 * Enforce a minimum DH modulus size of 512 bits.
levitte pushed a commit to levitte/openssl that referenced this pull request Mar 4, 2021
The dh_test was failing because we now enforce a lower bound on the
modulus size that may be used. A number of locations in dhtest.c were
assuming that a very small modulus is valid.

A 512 bit lower bound was introduced by PR openssl#9437 (commit 6de1fe9) and
subsequently amended by PR openssl#9796 (commit feeb7ec).

The CHANGES entry says this:

 * Enforce a minimum DH modulus size of 512 bits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants