Skip to content

Allow passing None for the PKCS11 user pin#446

Merged
TwistedTwigleg merged 3 commits into
mainfrom
pkcs11_user_pin_fix
Feb 16, 2023
Merged

Allow passing None for the PKCS11 user pin#446
TwistedTwigleg merged 3 commits into
mainfrom
pkcs11_user_pin_fix

Conversation

@TwistedTwigleg

@TwistedTwigleg TwistedTwigleg commented Feb 16, 2023

Copy link
Copy Markdown
Contributor

Description of changes:

The documentation for the PKCS11 create_client_with_mtls_pkcs11() function states that you can pass None as a valid input, but this is not allowed because user_pin is not set to None by default. When using Python with typing, this causes problems.

This PR fixes that by making the user_pin optional by setting it to null by default. It also adjusts the C code to check if the value is null and, if it is, it passes a zeroed out aws_byte_cursor.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Comment thread awscrt/io.py Outdated
Comment thread awscrt/io.py Outdated
Comment thread source/io.c Outdated
@TwistedTwigleg

Copy link
Copy Markdown
Contributor Author

Thanks! Merging into main...

@TwistedTwigleg TwistedTwigleg merged commit f19344f into main Feb 16, 2023
@TwistedTwigleg TwistedTwigleg deleted the pkcs11_user_pin_fix branch February 16, 2023 21:47
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