Skip to content

cmp_vfy.c: fix major duplications and minor mistakes in diagnostic output on failure validating CMP messages - #28986

Closed
DDvO wants to merge 2 commits into
openssl:masterfrom
siemens:fix_cmp_vfy_diagnostics
Closed

DDvO wants to merge 2 commits into
openssl:masterfrom
siemens:fix_cmp_vfy_diagnostics

Conversation

@DDvO

@DDvO DDvO commented Oct 23, 2025

Copy link
Copy Markdown
Contributor
  • prevent needless and confusing duplication of diagnostic output on failure validating CMP messages
  • small fixes on content and layout of diagnostics on failure validating signature-based message protection

@DDvO DDvO added branch: master Applies to master branch approval: review pending This pull request needs review by a committer triaged: bug The issue/pr is/fixes a bug tests: exempted The PR is exempt from requirements for testing branch: 3.5 Applies to openssl-3.5 branch: 3.6 Applies to openssl-3.6 labels Oct 23, 2025
@DDvO
DDvO requested a review from Copilot October 23, 2025 20:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes diagnostic output issues in CMP message validation, specifically eliminating duplicate error messages and improving error reporting clarity. The changes focus on refining how validation failures are logged and reported to users.

Key changes:

  • Restructures error reporting in signature validation to prevent duplicate diagnostics
  • Adjusts log severity levels for more appropriate classification of validation issues
  • Improves error message handling flow in certificate verification

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread crypto/cmp/cmp_vfy.c
Comment thread crypto/cmp/cmp_vfy.c
@openssl-machine

Copy link
Copy Markdown
Collaborator

This PR is in a state where it requires action by @openssl/committers but the last update was 30 days ago

DDvO added 2 commits December 22, 2025 19:29
…e validating signature-based protection of CMP messages
@DDvO
DDvO force-pushed the fix_cmp_vfy_diagnostics branch from 213417a to 115df45 Compare December 22, 2025 18:31
@DDvO

DDvO commented Dec 22, 2025

Copy link
Copy Markdown
Contributor Author

Rebased to fix merge conflict after clang-format

@openssl-machine

Copy link
Copy Markdown
Collaborator

This PR is in a state where it requires action by @openssl/committers but the last update was 30 days ago

@DDvO DDvO removed the approval: review pending This pull request needs review by a committer label Jan 28, 2026
@DDvO DDvO added the approval: review pending This pull request needs review by a committer label Feb 4, 2026
@openssl-machine

Copy link
Copy Markdown
Collaborator

This PR is in a state where it requires action by @openssl/committers but the last update was 30 days ago

@esyr esyr added the branch: 4.0 Applies to openssl-4.0 label Mar 10, 2026
@openssl-machine

Copy link
Copy Markdown
Collaborator

This PR is in a state where it requires action by @openssl/committers but the last update was 30 days ago

@openssl-machine

Copy link
Copy Markdown
Collaborator

This PR is in a state where it requires action by @openssl/committers but the last update was 61 days ago

@DDvO

DDvO commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

@openssl/committers can we please get this done soon?
It is a pretty small PR improving just diagnostic output (so nothing critical),
so a low-hanging fruit.

@mbroz mbroz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@openssl-machine openssl-machine added approval: done This pull request has the required number of approvals approval: ready to merge The 24 hour grace period has passed, ready to merge and removed approval: review pending This pull request needs review by a committer approval: done This pull request has the required number of approvals labels Jun 8, 2026
@openssl-machine

Copy link
Copy Markdown
Collaborator

This pull request is ready to merge

@esyr esyr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

Comment thread crypto/cmp/cmp_vfy.c
if (res)
goto end;
}
/* failed finding a sender cert that verifies the message signature */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would be nice to leave an empty line before comment and not after.

Comment thread crypto/cmp/cmp_vfy.c
if (res)
ERR_add_error_mem_bio("\n", bio);
if (res) {
ERR_add_error_txt(NULL, "\n");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would print a newline to bio instead, but that's a personal preference.

Comment thread crypto/cmp/cmp_vfy.c
@@ -56,8 +56,10 @@ static int verify_signature(const OSSL_CMP_CTX *cmp_ctx,
sig_err:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Commit message could've been more descriptive.

openssl-machine pushed a commit that referenced this pull request Jun 10, 2026
…e validating signature-based protection of CMP messages

Reviewed-by: Daniel Kubec <[email protected]>
Reviewed-by: Milan Broz <[email protected]>
Reviewed-by: Eugene Syromiatnikov <[email protected]>
MergeDate: Wed Jun 10 06:38:59 2026
(Merged from #28986)
openssl-machine pushed a commit that referenced this pull request Jun 10, 2026
…utput on failure validating CMP messages

Reviewed-by: Daniel Kubec <[email protected]>
Reviewed-by: Milan Broz <[email protected]>
Reviewed-by: Eugene Syromiatnikov <[email protected]>
MergeDate: Wed Jun 10 06:39:00 2026
(Merged from #28986)
openssl-machine pushed a commit that referenced this pull request Jun 10, 2026
…e validating signature-based protection of CMP messages

Reviewed-by: Daniel Kubec <[email protected]>
Reviewed-by: Milan Broz <[email protected]>
Reviewed-by: Eugene Syromiatnikov <[email protected]>
MergeDate: Wed Jun 10 06:38:59 2026
(Merged from #28986)

(cherry picked from commit 0a6b666)
openssl-machine pushed a commit that referenced this pull request Jun 10, 2026
…utput on failure validating CMP messages

Reviewed-by: Daniel Kubec <[email protected]>
Reviewed-by: Milan Broz <[email protected]>
Reviewed-by: Eugene Syromiatnikov <[email protected]>
MergeDate: Wed Jun 10 06:39:00 2026
(Merged from #28986)

(cherry picked from commit b6eb715)
openssl-machine pushed a commit that referenced this pull request Jun 10, 2026
…e validating signature-based protection of CMP messages

Reviewed-by: Daniel Kubec <[email protected]>
Reviewed-by: Milan Broz <[email protected]>
Reviewed-by: Eugene Syromiatnikov <[email protected]>
MergeDate: Wed Jun 10 06:38:59 2026
(Merged from #28986)

(cherry picked from commit 0a6b666)
openssl-machine pushed a commit that referenced this pull request Jun 10, 2026
…utput on failure validating CMP messages

Reviewed-by: Daniel Kubec <[email protected]>
Reviewed-by: Milan Broz <[email protected]>
Reviewed-by: Eugene Syromiatnikov <[email protected]>
MergeDate: Wed Jun 10 06:39:00 2026
(Merged from #28986)

(cherry picked from commit b6eb715)
@DDvO

DDvO commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @n13l, @mbroz, and @esyr for your reviews and approvals.
@esyr since there were already two approvals and the PR was already waiting long,
I did not handle the nits you reported yesterday. Yet in future I'll make sure to give more descriptive commit messages.

@DDvO

DDvO commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Merged to master, 4.0, 3.6, and 3.5.

@DDvO DDvO closed this Jun 10, 2026
openssl-machine pushed a commit that referenced this pull request Jun 10, 2026
…e validating signature-based protection of CMP messages

Reviewed-by: Daniel Kubec <[email protected]>
Reviewed-by: Milan Broz <[email protected]>
Reviewed-by: Eugene Syromiatnikov <[email protected]>
MergeDate: Wed Jun 10 06:38:59 2026
(Merged from #28986)

(cherry picked from commit 0a6b666)
openssl-machine pushed a commit that referenced this pull request Jun 10, 2026
…utput on failure validating CMP messages

Reviewed-by: Daniel Kubec <[email protected]>
Reviewed-by: Milan Broz <[email protected]>
Reviewed-by: Eugene Syromiatnikov <[email protected]>
MergeDate: Wed Jun 10 06:39:00 2026
(Merged from #28986)

(cherry picked from commit b6eb715)
@esyr

esyr commented Jun 10, 2026

Copy link
Copy Markdown
Member

Yet in future I'll make sure to give more descriptive commit messages.

No problem, those are nits, after all. You can adjust commit messages when applying: ghmerge does interactive rebase and you can use reword action for commits when needed.

n13l pushed a commit to n13l/openssl that referenced this pull request Jul 25, 2026
…e validating signature-based protection of CMP messages

Reviewed-by: Daniel Kubec <[email protected]>
Reviewed-by: Milan Broz <[email protected]>
Reviewed-by: Eugene Syromiatnikov <[email protected]>
MergeDate: Wed Jun 10 06:38:59 2026
(Merged from openssl#28986)
n13l pushed a commit to n13l/openssl that referenced this pull request Jul 25, 2026
…utput on failure validating CMP messages

Reviewed-by: Daniel Kubec <[email protected]>
Reviewed-by: Milan Broz <[email protected]>
Reviewed-by: Eugene Syromiatnikov <[email protected]>
MergeDate: Wed Jun 10 06:39:00 2026
(Merged from openssl#28986)
rickyringler pushed a commit to rickyringler/openssl that referenced this pull request Aug 21, 2026
…e validating signature-based protection of CMP messages

Reviewed-by: Daniel Kubec <[email protected]>
Reviewed-by: Milan Broz <[email protected]>
Reviewed-by: Eugene Syromiatnikov <[email protected]>
MergeDate: Wed Jun 10 06:38:59 2026
(Merged from openssl#28986)
rickyringler pushed a commit to rickyringler/openssl that referenced this pull request Aug 21, 2026
…utput on failure validating CMP messages

Reviewed-by: Daniel Kubec <[email protected]>
Reviewed-by: Milan Broz <[email protected]>
Reviewed-by: Eugene Syromiatnikov <[email protected]>
MergeDate: Wed Jun 10 06:39:00 2026
(Merged from openssl#28986)
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.5 Applies to openssl-3.5 branch: 3.6 Applies to openssl-3.6 branch: 4.0 Applies to openssl-4.0 tests: exempted The PR is exempt from requirements for testing triaged: bug The issue/pr is/fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants