brianhks wrote, On 2008-09-24 08:16:
> The following is my code to import a der encoded CA certificate.  I'm
> getting a memory access down in CERT_ImportCerts.  It looks like it is
> trying to access a pointer that is set to 0x3 instead of a valid
> pointer.
> 
> So I have two questions is this code the correct way of doing it?


> SECItem cert[1];

> //Load up the cert
> cert[0].type = siDERCertBuffer;
> cert[0].data = m_certBuffer;
> cert[0].len = m_certBufferSize;
> 
> rv = myCERT_ImportCerts(dbHandle, certUsageSSLCA, 1, (SECItem**)&cert,
> NULL, PR_TRUE, PR_TRUE, "MyCA");

Looks to me like the problem is that (SECItem**)&cert argument.
Try this:

SECItem cert;
SECItem *pCert = &cert;
...
CERT_ImportCerts(dbHandle, certUsageSSLCA, 1, &pCert,
_______________________________________________
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to