const_generate: hardcode CK_TRUE/CK_FALSE to golang bool values #176
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The PKCS11 constants are most useful when creating attributes with
NewAttribute()
in all kinds of different PKCS11 calls. The functionis using generic type handling to decide attribute length.
The CK_TRUE/CK_FALSE constants should evaluate to direct Golang
bool values in order for these to be handled properly by the
NewAttribute()
calls, which interprets bool values as[]byte{0}, []byte{1} for false, true respectively. If these stay
integers,
NewAttribtue()
considers them 8-byte long byte slices.Some PKCS11 module implementations actually validate constant-length
arguments size. https://github.com/opendnssec/SoftHSMv2/ is an example
of a commonly used PKCS11-testing module that does that. Without this
change, the module fails to perform certain actions as it errors out
on unexpected attribute size.