Skip to content

pkcs11:avoid returning value overwriting #346

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

Closed

Conversation

alexs-sh
Copy link

When configuration(s) is incorrect, overwriting of returned value allows the init procedure to move forward instead of stopping. It triggers fails in later steps, which sometimes look not too much obvious. This change removes the rv value overwriting.

Here is an example. I pushed 2 configs which triggered an error.

Original version:

PKCS#11: Initializing the engine
7011:7011:C_Initialize:141:
7011:7011:pkcs11_config_load_objects:892:Opening Configuration: /etc/tmp/0.conf
7011:7011:pkcs11_config_load_objects:892:Opening Configuration: /etc/tmp/slot.conf
7011:7011:pkcs11_config_load_objects:909:Tried to reload the same configuration file for the same slot
7011:7011:C_Initialize:142:CKR_OK(0)
7011:7011:C_GetInfo:159:
7011:7011:C_GetInfo:160:CKR_CRYPTOKI_NOT_INITIALIZED(190)
7011:7011:C_Finalize:150:
7011:7011:C_Finalize:151:CKR_CRYPTOKI_NOT_INITIALIZED(190)
Unable to load module /usr/lib/libcryptoauth.so

Modified version:

PKCS#11: Initializing the engine
7359:7359:C_Initialize:141:
7359:7359:pkcs11_config_load_objects:892:Opening Configuration: /etc/tmp/0.conf
7359:7359:pkcs11_config_load_objects:892:Opening Configuration: /etc/tmp/slot.conf
7359:7359:pkcs11_config_load_objects:909:Tried to reload the same configuration file for the same slot
7359:7359:C_Initialize:142:CKR_GENERAL_ERROR(5)
Unable to load module /usr/lib/libcryptoauth.so

Checklist

When configuration(s) is incorrect, overwriting allows the init
procedure to move forward instead of stopping. It triggers fails in
later steps, which sometimes look not too much obvious. This change
removes the rv value overwriting.
@github-actions
Copy link

This PR has been marked as stale and will be automatically closed in 7 days.

@github-actions github-actions bot added the Stale label Oct 15, 2023
@github-actions github-actions bot closed this Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant