Open DesmondHayes opened 10 years ago
Hi, I got the same error... running x509dump with -dd option I discovered it stopped while analyzing serialNumber of the certificate: 0x020000000001454393fb2718779f serialNumber is coded as an Integer (that is OK) but asn1c seem to store and manage native Integer as long values... not sufficient to store 0x020000000001454393fb2718779f So it exit about line 114 in nativeInteger.c just comment the following and the certificate is parsed (But integer values ar bad!!!!)
if((specs&&specs->field_unsigned)
? asn_INTEGER2ulong(&tmp, (unsigned long *)&l)
: asn_INTEGER2long(&tmp, &l)) {
rval.code = RC_FAIL;
rval.consumed = 0;
return rval;
}
Any idea how to solve this? Do you think it's possible to use integer.c instead of nativeInteger.?
adding -fwide-types
to asn1c
command solves this problem for me
Tried examples/sample.source.PKIX1, but failed. Compiled just fine with usual 'make'. Then tried to use 'x509dump' executable with 'sample-Certificate-1.der' as argument, which gave me an error 'sample-Certificate-1.der: Decode failed past byte 4: Input processing error'. Also tried other certificates, self-signed and real (from the cache of Firefox). Examples from 'http://csrc.nist.gov/groups/ST/crypto_apps_infra/documents/pkixtools/' worked OK. 'Microsoft Internet Authority' certificate from the cache of Firefox forked wine, but several others failed. Self-signed certificates generated with OpenSSL and with IIS7 failed.