Skip to content

Honour mandatory digest on private key in has_usable_cert() (1.1.1 backport of PR#7408)#7609

Closed
dwmw2 wants to merge 2 commits intoopenssl:OpenSSL_1_1_1-stablefrom
dwmw2:pkey_md_1.1.1
Closed

Honour mandatory digest on private key in has_usable_cert() (1.1.1 backport of PR#7408)#7609
dwmw2 wants to merge 2 commits intoopenssl:OpenSSL_1_1_1-stablefrom
dwmw2:pkey_md_1.1.1

Conversation

@dwmw2
Copy link
Contributor

@dwmw2 dwmw2 commented Nov 10, 2018

Stop TLS from using digests that the EVP_PKEY tells us it doesn't support.
And stop the EC keys from lying about what they support, while we're at it.
Fixes #7348

ASN1_PKEY_CTRL_DEFAULT_MD_NID is documented to return 2 for a mandatory
digest algorithm, when the key can't support any others. That isn't true
here, so return 1 instead.

Partially fixes openssl#7348

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from openssl#7408)

(cherry picked from commit eb7eb13)
@dwmw2 dwmw2 changed the base branch from master to OpenSSL_1_1_1-stable November 10, 2018 11:38
@dwmw2 dwmw2 changed the title Backport fix for #7348 (from PR Backport fix for #7348 (from PR#7408) Nov 10, 2018
If the private key says it can only support one specific digest, then
don't ask it to perform a different one.

Fixes: openssl#7348

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from openssl#7408)

(cherry picked from commit 2d263a4)
@dwmw2 dwmw2 changed the title Backport fix for #7348 (from PR#7408) Honour mandatory digest on private key in has_usable_cert() (1.1.1 backport of PR#7408) Nov 10, 2018
@mattcaswell mattcaswell added the branch: 1.1.1 Applies to OpenSSL_1_1_1-stable branch (EOL) label Nov 14, 2018
@romen romen self-assigned this Nov 24, 2018
levitte pushed a commit that referenced this pull request Nov 24, 2018
ASN1_PKEY_CTRL_DEFAULT_MD_NID is documented to return 2 for a mandatory
digest algorithm, when the key can't support any others. That isn't true
here, so return 1 instead.

Partially fixes #7348

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>

(cherry picked from commit eb7eb13)

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from #7609)
levitte pushed a commit that referenced this pull request Nov 24, 2018
If the private key says it can only support one specific digest, then
don't ask it to perform a different one.

Fixes: #7348

Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>

(cherry picked from commit 2d263a4)

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

romen commented Nov 24, 2018

Merged to 1.1.1:

  • abaa231 Stop marking default digest for EC keys as mandatory
  • 6aca8d1 Honour mandatory digest on private key in has_usable_cert()

Thanks @dwmw2 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch: 1.1.1 Applies to OpenSSL_1_1_1-stable branch (EOL)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants