I am working on some code that performs a DERDecode on some data. The template I am using is:
const SEC_ASN1Template CERT_SignatureDataTemplate[] = { { SEC_ASN1_SEQUENCE, 0, NULL, sizeof(CERTSignedData) }, { SEC_ASN1_INLINE, offsetof(CERTSignedData,signatureAlgorithm), SECOID_AlgorithmIDTemplate, }, { SEC_ASN1_BIT_STRING, offsetof(CERTSignedData,signature), }, { 0, } }; This works nicely on my Mac, but fails to compile on a windows machine with an unresolved external symbol _SECOID_AlgorithmIDTemplate. I can see some vague references to build issues on windows with these templates, particularly with the macros used like here http://mxr.mozilla.org/seamonkey/source/security/nss/lib/certdb/certt.h#920 and http://mxr.mozilla.org/seamonkey/source/security/nss/lib/util/secasn1t.h#209 so I think I may need some combination of them but I'm not sure exactly what is right. I tried using SEC_ASN1_GET(SECOIDAlgorithmIDTemplate) and that actually compiles and works correctly, but looking at the rest of the codebase and seeing it's not used like that anywhere else I'm guessing it's wrong. The other alternative is I could just copy SECOIDAlgorithmIDTemplate into my file, that works as well. Can anyone shed some light on the best thing to do here? Cheers Dave _______________________________________________ dev-tech-crypto mailing list dev-tech-crypto@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tech-crypto