Re: Memory leaks in even trivial use of nss?

2009-03-18 Thread DanKegel
On Mar 18, 4:05 am, Nelson B Bolyard wrote: > > Hmm.  Can't find 3.12.2. > >http://www.mozilla.org/projects/security/pki/nss/nss-3.12.2/nss-3.12 > > says it's at > >https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_1... > > but that directory doesn't exist... > > Hmm. > Well,

Re: Memory leaks in even trivial use of nss?

2009-03-18 Thread DanKegel
On Mar 15, 9:35 pm, Nelson B Bolyard wrote: > ... Thanks for the tips. I'm using various versions of Ubuntu, and also 3.12 compiled by hand. I'll come back with more info if I still have problems afterwards. > There were a bunch of leaks involving NSS "Error stacks".  Most of them > were fixed

Memory leaks in even trivial use of nss?

2009-03-15 Thread DanKegel
Hi folks! I'm looking at memory leaks, starting with the simple test program #include #include int main() { NSS_NoDB_Init(); NSS_Shutdown(); } This shows two leaks right now, but should show none, right? The first leak was mentioned by wtc in http://sources.redhat.com/bugzilla

A tip for novice users of SSL_BadCertHook and SSL_PeerCertificate

2008-12-18 Thread DanKegel
http://www.mozilla.org/projects/security/pki/nss/ref/ssl/sslfnc.html#1088928 says "To obtain the certificate that was rejected by the certificate authentication callback, the callback function calls SSL_PeerCertificate." And it really does mean the callback function. Once that returns, the inform

Rosetta stones for nss / Mac / Win crypto?

2008-12-10 Thread DanKegel
Are there good examples of cross-platform projects that build against either Windows, Mac, or nss crypto libraries? Then somebody porting code from one library to another could look at how the cross-platform project did it in both libraries. http://src.chromium.org/viewvc/chrome/trunk/src/net/base

Re: Trouble importing test root certificate

2008-11-21 Thread DanKegel
Thanks to Wan-Teh and Nelson for the help! I've updated http://kegel.com/cert-import-demo.cc to use CERT_DecodeCertFromPackage(), which does everything I was trying to do with NSSBase64_DecodeBuffer() and CERT_ImportCerts(), and I also added a call to CERT_ChangeCertTrust(), which I think is nee

Re: Trouble importing test root certificate

2008-11-20 Thread DanKegel
On Nov 20, 6:14 pm, Nelson B Bolyard <[EMAIL PROTECTED]> wrote: > When I change the sample program so that cert_text no longer contains > the -BEGIN and -END lines, and so that the value assigned to > len no longer includes the trailing NUL character, then when I run > the program, it outpu

Re: Trouble importing test root certificate

2008-11-20 Thread DanKegel
On Nov 20, 4:23 pm, DanKegel <[EMAIL PROTECTED]> wrote: > First problem: > Decoding fails because NSSBase64_DecodeBuffer appears > to barf on the trailing ---END CERTIFICATE---. > Am I using this function properly?  It seems to have > code to skip trailing garbage, but evident

Trouble importing test root certificate

2008-11-20 Thread DanKegel
Hi folks. I'm having some trouble using CERT_ImportCerts. A minimal demo of the problem is at http://kegel.com/cert-import-demo.cc All this does is take a base 64 cert, decode it, and import it. I have verified with the sequence $ mkdir ~/.netscape $ certutil -N $ certutil -A -n foo -t "p,p,p"

Re: NSS and OpenSSL BIO replacement

2008-09-22 Thread DanKegel
On Sep 21, 9:28 pm, DanKegel <[EMAIL PROTECTED]> wrote: >> What are the equivalent APIs in NSS which probably can >> replace the BIO I/O abstraction of OpenSSL ? > I have a demo program showing a BIO-like thing for NSS. Thanks to Wan-Teh for several rounds of code review o

Re: NSS and OpenSSL BIO replacement

2008-09-21 Thread DanKegel
Ruchi Lohani wrote, On 2008-08-20 21:31: > What are the equivalent APIs in NSS which probably can replace the BIO > I/O abstraction of OpenSSL ? I have a demo program at http://kegel.com/chromium/nss/mozilla/security/nss/cmd/ptstclnt2/ showing a BIO-like thing for NSS. It's not polished or fully

Re: NSS and OpenSSL BIO replacement

2008-09-15 Thread DanKegel
On Aug 21, 3:27 am, Howard Chu <[EMAIL PROTECTED]> wrote: > Likewise you can look at the sockbuf support in OpenLDAP here > http://www.openldap.org/devel/cvsweb.cgi/libraries/libldap/ > and compare the sockbuf interface to BIOs in tls_o.c with the sockbuf > interface to NSPR in tls_m.c. This is a m