Changes to PKCS#11 definitions
stefw at collabora.co.uk
Wed Oct 19 18:06:54 CEST 2011
On 2011-10-18 14:07, Marcus Brinkmann wrote:
> On 10/17/2011 09:01 AM, Stef Walter wrote:
>> Hey Marcus,
>> I've made some minor fixes to the pkcs11.h header that comes from the Scute
>> project, and wanted to contribute them back as requested.
>> The patch makes all the relevant constants in pkcs11.h unsigned longs rather
>> than integers. This allows use of the constants in places where need the size
>> to be correct (such as varargs).
>> The patch is rather large, bit it just makes that one change. Let me know if I
>> should prepare it differently.
> I am unsure. On the one hand, all these constants are supposed to be used for
> ULONG datatypes, and thus it could be argued they should be UL.
> On the other hand, the official pkcs11.h header file doesn't do that. So, in
> order to be compatible, you can not rely on it, and have to cast anyway.
I see. That's a good point.
> The pkcs11.h file is supposed to be a drop in replacement for the official
> header file (at least in CRYPTOKI_COMPAT mode). It is true that adding the UL
> would be backwards compatible, but you will then write code that can not be
> backported to the official pkcs11.h without a visible indicator or compiler
> warning of that.
> Do we really want that?
> Do you use the CRYPTOKI_COMPAT mode?
Yup, plain ol PKCS#11 definitions.
The bummer is that we have varargs functions in libgck , which accept
these ulongs, so our shipped pkcs11.h header defines everything as UL so
that the definitions can be easily used with those functions.
 like this one:
More information about the Gnupg-devel