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

rpc: Fix serialization of NULL mechanism pointer #601

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

ueno
Copy link
Member

@ueno ueno commented Nov 14, 2023

A NULL mechanism pointer is valid for C_*Init functions to cancel the
operation. Since 852ccd8 we encoded it with a CK_MECHANISM_TYPE 0 as
an indicator, though it clashes with CKM_RSA_PKCS_KEY_PAIR_GEN (0).
This patch changes the encoding to use a special value (0xffffffff) to
indicate that and also properly advance the offset when reading.

@ueno ueno force-pushed the wip/dueno/mech-fixes branch 2 times, most recently from 36da777 to a146cfd Compare November 15, 2023 01:16
@coveralls
Copy link

coveralls commented Nov 15, 2023

Coverage Status

coverage: 69.471% (+0.04%) from 69.431%
when pulling 6847704 on ueno:wip/dueno/mech-fixes
into 66d6b42 on p11-glue:master.

@ueno ueno force-pushed the wip/dueno/mech-fixes branch from a146cfd to a4a88f1 Compare November 15, 2023 01:31
@ueno ueno requested a review from ZoltanFridrich November 15, 2023 01:32
A NULL mechanism pointer is valid for C_*Init functions to cancel the
operation.  Since 852ccd8 we encoded it with a CK_MECHANISM_TYPE 0 as
an indicator, though it clashes with CKM_RSA_PKCS_KEY_PAIR_GEN (0).
This patch changes the encoding to use a special value (0xffffffff) to
indicate that and also properly advance the offset when reading.

Signed-off-by: Daiki Ueno <[email protected]>
@ueno ueno force-pushed the wip/dueno/mech-fixes branch from a4a88f1 to 6847704 Compare November 15, 2023 05:29
Copy link
Contributor

@ZoltanFridrich ZoltanFridrich left a comment

Choose a reason for hiding this comment

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

I can confirm that this patch fixes the remote-option test.

@ZoltanFridrich ZoltanFridrich merged commit 66f1fc7 into p11-glue:master Nov 15, 2023
14 checks passed
@ZoltanFridrich ZoltanFridrich added this to the 0.25.3 milestone Jul 1, 2024
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.

3 participants