Skip to content

Fix(CheckUtils): Fail The MAC Sender Checks When The Sender Has No commonName - #115

Open
misiektoja wants to merge 3 commits into
siemens:mainfrom
misiektoja:fix/mac-sender-cn-check
Open

misiektoja wants to merge 3 commits into
siemens:mainfrom
misiektoja:fix/mac-sender-cn-check

Conversation

@misiektoja

@misiektoja misiektoja commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

_verify_sender_field_for_mac and _verify_senderkid_for_mac now read the commonName from the dictionary form of the lookup.

Motivation and Context

Both functions look up the commonName with get_openssl_name_notation. _verify_sender_field_for_mac then fails only if the result is None and _verify_senderkid_for_mac only if it is empty. Without a commonName the lookup returns the string "NULL-DN", so neither check fires. RFC 9483 Section 3.1 requires the commonName for MAC protection. With allow_failure=False a MAC-protected message without it passed Check Sender CMP Protection. Validate senderKID For CMP Protection accepted the senderKID "NULL-DN". The mock CA runs both checks on every request, so it now rejects such a request.

How Has This Been Tested?

New unit tests send a MAC-protected message whose sender has no commonName to Check Sender CMP Protection and Validate senderKID For CMP Protection. They fail on main and pass with this change. Other unit test results match main. Python 3.15 with pytest 9.2.

@misiektoja
misiektoja requested a review from ralienpp as a code owner October 28, 2026 03:42
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.

1 participant