Skip to content

pkcs11: Do not trim last character of fixed-length fields#406

Closed
Jakuje wants to merge 1 commit into
openssh:masterfrom
Jakuje:rmspace
Closed

pkcs11: Do not trim last character of fixed-length fields#406
Jakuje wants to merge 1 commit into
openssh:masterfrom
Jakuje:rmspace

Conversation

@Jakuje

@Jakuje Jakuje commented Jun 14, 2023

Copy link
Copy Markdown
Contributor

The function rmspace trimmed last character of all the fixed-length fields causing inaccurate information being reported to the user when the whole buffer was used by the pkcs11 library. This is common for the serial number and very unlike for other fields such as manufacturer ID.

This commit changes the rmspace function to not trim the last character. As a consequence the resulting buffers might not be null terminated so we modify the debug prints to make sure they do not go over the buffer limits by explicitly using precision modifiers.

The function rmspace trimmed last character of all the fixed-length
fields causing inaccurate information being reported to the user when
the whole buffer was used by the pkcs11 library. This is common for the
serial number and very unlike for other fields such as manufacturer ID.

This commit changes the rmspace function to not trim the last character.
As a consequence the resulting buffers might not be null terminated so
we modify the debug prints to make sure they do not go over the buffer
limits by explicitly using precision modifiers.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
@djmdjm

djmdjm commented Jul 27, 2023

Copy link
Copy Markdown
Contributor

Fixed in 6958f00

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.

2 participants