Skip to content

Fix mem leak in ECDSA_sign(). - #20554

Closed
slontis wants to merge 1 commit into
openssl:masterfrom
slontis:ecdsa_sign_null_fix
Closed

slontis wants to merge 1 commit into
openssl:masterfrom
slontis:ecdsa_sign_null_fix

Conversation

@slontis

@slontis slontis commented Mar 21, 2023

Copy link
Copy Markdown
Member

Similiar to the issue found in PR #20553 for DSA_sign(). ECDSA_sign() leaked memory if the signature was NULL when i2d_ECDSA_SIG was called.

Note that this does not affect the higher level EVP functions as they correctly handle NULL.

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

Similiar to the issue found in PR openssl#20553 for DSA_sign().
ECDSA_sign() leaked memory if the signature was NULL
when i2d_ECDSA_SIG was called.

Note that this does not affect the higher level EVP
functions as they correctly handle NULL.
@slontis slontis added branch: master Applies to master branch approval: review pending This pull request needs review by a committer approval: otc review pending tests: present The PR has suitable tests present labels Mar 21, 2023
@github-actions github-actions Bot added the severity: fips change The pull request changes FIPS provider sources label Mar 21, 2023
@t8m t8m added triaged: bug The issue/pr is/fixes a bug branch: 3.0 Applies to openssl-3.0 branch (EOL) branch: 3.1 Applies to openssl-3.1 (EOL) labels Mar 21, 2023
@paulidale paulidale 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 Mar 21, 2023
@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 Mar 22, 2023
@openssl-machine

Copy link
Copy Markdown
Collaborator

This pull request is ready to merge

@tmshort tmshort self-assigned this Mar 31, 2023
openssl-machine pushed a commit that referenced this pull request Mar 31, 2023
Similiar to the issue found in PR #20553 for DSA_sign().
ECDSA_sign() leaked memory if the signature was NULL
when i2d_ECDSA_SIG was called.

Note that this does not affect the higher level EVP
functions as they correctly handle NULL.

Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Todd Short <[email protected]>
(Merged from #20554)
@tmshort

tmshort commented Mar 31, 2023

Copy link
Copy Markdown
Contributor

Merged to master. Trivial conflict when cherry-picked to openssl-3.1 (the ossl_ecdsa_deterministic_sign() function does not exist in 3.1). No issues cherry-picking into 3.0.
Thank you for your contribution!

@tmshort tmshort closed this Mar 31, 2023
openssl-machine pushed a commit that referenced this pull request Mar 31, 2023
Similiar to the issue found in PR #20553 for DSA_sign().
ECDSA_sign() leaked memory if the signature was NULL
when i2d_ECDSA_SIG was called.

Note that this does not affect the higher level EVP
functions as they correctly handle NULL.

Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Todd Short <[email protected]>
(Merged from #20554)

(cherry picked from commit 4befe81)
openssl-machine pushed a commit that referenced this pull request Mar 31, 2023
Similiar to the issue found in PR #20553 for DSA_sign().
ECDSA_sign() leaked memory if the signature was NULL
when i2d_ECDSA_SIG was called.

Note that this does not affect the higher level EVP
functions as they correctly handle NULL.

Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Todd Short <[email protected]>
(Merged from #20554)

(cherry picked from commit 4befe81)
(cherry picked from commit 680b4be)
bernd-edlinger pushed a commit to bernd-edlinger/openssl that referenced this pull request May 2, 2023
Similiar to the issue found in PR openssl#20553 for DSA_sign().
ECDSA_sign() leaked memory if the signature was NULL
when i2d_ECDSA_SIG was called.

Note that this does not affect the higher level EVP
functions as they correctly handle NULL.

Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Todd Short <[email protected]>
(Merged from openssl#20554)

(cherry picked from commit 4befe81)
(cherry picked from commit 680b4be)
bernd-edlinger pushed a commit to bernd-edlinger/openssl that referenced this pull request May 13, 2023
Similiar to the issue found in PR openssl#20553 for DSA_sign().
ECDSA_sign() leaked memory if the signature was NULL
when i2d_ECDSA_SIG was called.

Note that this does not affect the higher level EVP
functions as they correctly handle NULL.

Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Todd Short <[email protected]>
(Merged from openssl#20554)

(cherry picked from commit 4befe81)
(cherry picked from commit 680b4be)
bernd-edlinger pushed a commit to bernd-edlinger/openssl that referenced this pull request May 17, 2023
Similiar to the issue found in PR openssl#20553 for DSA_sign().
ECDSA_sign() leaked memory if the signature was NULL
when i2d_ECDSA_SIG was called.

Note that this does not affect the higher level EVP
functions as they correctly handle NULL.

Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Todd Short <[email protected]>
(Merged from openssl#20554)

(cherry picked from commit 4befe81)
(cherry picked from commit 680b4be)
bernd-edlinger pushed a commit to bernd-edlinger/openssl that referenced this pull request May 30, 2023
Similiar to the issue found in PR openssl#20553 for DSA_sign().
ECDSA_sign() leaked memory if the signature was NULL
when i2d_ECDSA_SIG was called.

Note that this does not affect the higher level EVP
functions as they correctly handle NULL.

Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Todd Short <[email protected]>
(Merged from openssl#20554)

(cherry picked from commit 4befe81)
(cherry picked from commit 680b4be)
bernd-edlinger pushed a commit to bernd-edlinger/openssl that referenced this pull request Jul 19, 2023
Similiar to the issue found in PR openssl#20553 for DSA_sign().
ECDSA_sign() leaked memory if the signature was NULL
when i2d_ECDSA_SIG was called.

Note that this does not affect the higher level EVP
functions as they correctly handle NULL.

Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Todd Short <[email protected]>
(Merged from openssl#20554)

(cherry picked from commit 4befe81)
(cherry picked from commit 680b4be)
bernd-edlinger pushed a commit to bernd-edlinger/openssl that referenced this pull request Aug 1, 2023
Similiar to the issue found in PR openssl#20553 for DSA_sign().
ECDSA_sign() leaked memory if the signature was NULL
when i2d_ECDSA_SIG was called.

Note that this does not affect the higher level EVP
functions as they correctly handle NULL.

Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Todd Short <[email protected]>
(Merged from openssl#20554)

(cherry picked from commit 4befe81)
(cherry picked from commit 680b4be)
bernd-edlinger pushed a commit to bernd-edlinger/openssl that referenced this pull request Aug 19, 2023
Similiar to the issue found in PR openssl#20553 for DSA_sign().
ECDSA_sign() leaked memory if the signature was NULL
when i2d_ECDSA_SIG was called.

Note that this does not affect the higher level EVP
functions as they correctly handle NULL.

Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Todd Short <[email protected]>
(Merged from openssl#20554)

(cherry picked from commit 4befe81)
(cherry picked from commit 680b4be)
bernd-edlinger pushed a commit to bernd-edlinger/openssl that referenced this pull request Sep 12, 2023
Similiar to the issue found in PR openssl#20553 for DSA_sign().
ECDSA_sign() leaked memory if the signature was NULL
when i2d_ECDSA_SIG was called.

Note that this does not affect the higher level EVP
functions as they correctly handle NULL.

Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Todd Short <[email protected]>
(Merged from openssl#20554)

(cherry picked from commit 4befe81)
(cherry picked from commit 680b4be)
kafei-cy added a commit to kafei-cy/Tongsuo that referenced this pull request Mar 26, 2026
Similiar to the issue found in PR #20553 for DSA_sign().
ECDSA_sign() leaked memory if the signature was NULL
when i2d_ECDSA_SIG was called.

Note that this does not affect the higher level EVP
functions as they correctly handle NULL.

(Merged from openssl/openssl#20554)
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 Applies to master branch branch: 3.0 Applies to openssl-3.0 branch (EOL) branch: 3.1 Applies to openssl-3.1 (EOL) severity: fips change The pull request changes FIPS provider sources tests: present The PR has suitable tests present triaged: bug The issue/pr is/fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants