Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from

Conversation

Jakuje
Copy link
Contributor

@Jakuje Jakuje commented Jun 14, 2023

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
Copy link
Contributor

djmdjm commented Jul 27, 2023

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
2 participants