[Help-gnutls] Re: _gnutls_fbase64_decode and PEM headers

Michael Welsh Duggan mwd at cert.org
Thu Jun 14 18:18:21 CEST 2007

Michael Welsh Duggan <mwd at cert.org> writes:

> This worked.  I then tried the following:
> a) Created a PKCS-12 key using:
>    certtool --load-certificate clientcert.pem \
>      --load-privkey clientkey.pem --to-p12 --outfile client.p12
>    (Used an empty password)
> b) Used 
>         rv = gnutls_certificate_set_x509_simple_pkcs12_file(
>             queue->root->cred,
>             cert_filename,
>             GNUTLS_X509_FMT_PEM,
>             password);
>    (Used an empty password)
> When I do this, I get the following error:
>     ASN1 parser: Error in TAG.
> Gnutls version is 1.4.1.  Any suggestions?

Oh, and just a few more pieces of debug information.  It fails in the
first asn1_der_decoding in _pkcs12_decode_safe_contents called from

#0  _pkcs12_decode_safe_contents (content=0xbfd66898, bag=0x83cd120) at pkcs12.c:371
#1  0x009704bd in gnutls_pkcs12_bag_decrypt (bag=0x83cd120, pass=0x0) at pkcs12_bag.c:662
#2  0x0093d55f in parse_pkcs12 (res=0x83ca480, p12=0x83c0700, password=0x0, key=0xbfd6695c, cert=0xbfd66958, crl=0xbfd66954) at gnutls_x509.c:1850
#3  0x0093dc3a in gnutls_certificate_set_x509_simple_pkcs12_file (res=0x83ca480, pkcs12file=0xbfd68830 "/afs/cert.org/usr/mwd/projects/test/client.p12", type=GNUTLS_X509_FMT_PEM, password=0x0) at gnutls_x509.c:2043
#4  0x0804f25e in skMsgQueueAddPKCS12 (queue=0x83ad850, cert_filename=0xbfd68830 "/afs/cert.org/usr/mwd/projects/test/client.p12", password=0x0) at skmsg.c:1009
#5  0x0804de49 in startTransferDaemon () at rwtransfer.c:1315
#6  0x0804b97c in main (argc=Cannot access memory at address 0x1

Michael Welsh Duggan
(mwd at cert.org)

More information about the Gnutls-help mailing list