rust-cryptoki icon indicating copy to clipboard operation
rust-cryptoki copied to clipboard

Add a way to pass a pointer for the "reserved" argument in CInitializeArgs()

Open simo5 opened this issue 4 weeks ago • 1 comments

Although the spec says the pReserved pointer is reserved, there are some tokens that make use (and sort-of depend on being able to get an initialization string through that interface.

Softokn from the NSS project and also Kryoptic can be initialized that way, and although they both can use also environment variables to pass the same info, it is often easier (especially in testing environments) to just pass a string straight to the C_Initialize call.

simo5 avatar Oct 27 '25 21:10 simo5

Good point! Seems like a miss on our side because our CInitializeArgs abstraction structure only actually implements the flags field of the same structure in the specs.

It should probably be improved to at least contain flags and pReserved and with easy to use constructors settings those values.

hug-dev avatar Oct 28 '25 09:10 hug-dev