libsec: only send client cert when we have one (fix regression from r6e976b2004dd)

This commit is contained in:
cinap_lenrek 2013-08-15 00:29:42 +02:00
parent c23a2f6a79
commit 3c3a573562

View file

@ -726,9 +726,11 @@ tlsClient2(int ctl, int hand, uchar *csid, int ncsid, uchar *cert, int certlen,
}
if(creq) {
m.u.certificate.ncert = 1;
m.u.certificate.certs = emalloc(m.u.certificate.ncert * sizeof(Bytes));
m.u.certificate.certs[0] = makebytes(cert, certlen);
if(cert != nil && certlen > 0){
m.u.certificate.ncert = 1;
m.u.certificate.certs = emalloc(m.u.certificate.ncert * sizeof(Bytes));
m.u.certificate.certs[0] = makebytes(cert, certlen);
}
m.tag = HCertificate;
if(!msgSend(c, &m, AFlush))
goto Err;