Sigh, 

The PKCS #11 spec is pretty vague. There is some words about always going for the 
tightest packing possible. The current spec says to use packing (1) for Win32 and 
Win16, and default packing for Unix. Since Linux is Unix, it will probably have 
different packing than a windows binary. The entire section on binary compatibility 
and PKCS #11 is defined in section 8. This section is a very good discussion about the 
issues and the tools PKCS #11 gives to deal with them. Igeneral if the spec is quiet 
about a particular platform, then usually mozilla sets the default binary 
compatibility standard for the platform. Unfortunately, often, not a lot of thought 
goes into these issues for each platform, and mozilla depends a lot on decisions make 
in NSPR for binary compatibility. 

bob 


Andrey Jivsov wrote on Tue, 20 Apr 04, 1:04 AM: 
> Hello, 
> 
> I observed a difference in field alignment between Windows and Linux 
> version of PKCS11 library from one HW token vendor. 
> 
> On Linux CK_FUNCTION_LIST was using 4 byte field alignment, while on 
> Windows it was 1. 
> 
> File pkcs11.h, part of PKCS11 standard, states that 
> 
> *                         [...] the packing convention 
> * for PKCS #11 structures should be set.  The PKCS #11 
> * convention on packing is that structures should be 1-byte 
> * aligned. 
> 
> I find that few other vendors have 4 byte padding on Linux and they are 
> quick to point out that this works with Mozilla. 
> 
> By looking at pkcs11p.h and pkcs11u.h it appears that Mozilla uses 
> default padding for !defined(_WIN32). 
> 
> Could someone clarify what PKCS11 structure padding Mozilla uses on 32 
> and 64 bit platforms? 
> 
> Thank you. 
> 
> _______________________________________________ 
> mozilla-crypto mailing list 
> [EMAIL PROTECTED] 
> http://mail.mozilla.org/listinfo/mozilla-crypto 
_______________________________________________
mozilla-crypto mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-crypto

Reply via email to