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

cmp_vfy.c: fix major duplications and minor mistakes in diagnostic output on failure validating CMP messages#28986
DDvO wants to merge 2 commits into
openssl:masterfrom
siemens:fix_cmp_vfy_diagnostics

Conversation

@DDvO

@DDvODDvO 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

@DDvODDvO 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 CopilotOctober 23, 2025 20:14

CopilotAI 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 threadcrypto/cmp/cmp_vfy.c
Comment threadcrypto/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

…e validating signature-based protection of CMP messages
@DDvO
DDvOforce-pushed the fix_cmp_vfy_diagnostics branch from 213417a to 115df45CompareDecember 22, 2025 18:31
@DDvO

DDvO commented Dec 22, 2025

Copy link
Copy Markdown
ContributorAuthor

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

@DDvODDvO removed the approval: review pending This pull request needs review by a committer label Jan 28, 2026
@DDvODDvO 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

@esyresyr 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
ContributorAuthor

@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.

n13l
n13l approved these changes Jun 8, 2026

@mbrozmbroz 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-machineopenssl-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

@esyresyr 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 threadcrypto/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 threadcrypto/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 threadcrypto/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 <kubec@openssl.foundation>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
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 <kubec@openssl.foundation>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
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 <kubec@openssl.foundation>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
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 <kubec@openssl.foundation>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
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 <kubec@openssl.foundation>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
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 <kubec@openssl.foundation>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
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
ContributorAuthor

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
ContributorAuthor

Merged to master, 4.0, 3.6, and 3.5.

@DDvODDvO 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 <kubec@openssl.foundation>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
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 <kubec@openssl.foundation>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
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 <kubec@openssl.foundation>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
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 <kubec@openssl.foundation>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
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 <kubec@openssl.foundation>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
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 <kubec@openssl.foundation>
Reviewed-by: Milan Broz <mbroz@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Wed Jun 10 06:39:00 2026
(Merged from openssl#28986)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval: ready to mergeThe 24 hour grace period has passed, ready to mergebranch: masterApplies to master branchbranch: 3.5Applies to openssl-3.5branch: 3.6Applies to openssl-3.6branch: 4.0Applies to openssl-4.0tests: exemptedThe PR is exempt from requirements for testingtriaged: bugThe issue/pr is/fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@DDvO@openssl-machine@esyr@n13l@mbroz