parse all certs when user callback accepts some

This commit is contained in:
Todd A Ouska 2011-02-28 13:40:56 -08:00
parent 4dd9f290e5
commit 27d54b1096

View File

@ -1360,6 +1360,7 @@ static int DoCertificate(SSL* ssl, byte* input, word32* inOutIdx)
{ {
word32 listSz, i = *inOutIdx; word32 listSz, i = *inOutIdx;
int ret = 0; int ret = 0;
int anyError = 0;
int firstTime = 1; /* peer's is at front */ int firstTime = 1; /* peer's is at front */
char domain[ASN_NAME_MAX]; char domain[ASN_NAME_MAX];
@ -1370,7 +1371,7 @@ static int DoCertificate(SSL* ssl, byte* input, word32* inOutIdx)
c24to32(&input[i], &listSz); c24to32(&input[i], &listSz);
i += CERT_HEADER_SZ; i += CERT_HEADER_SZ;
while (listSz && ret == 0) { while (listSz) {
/* cert size */ /* cert size */
buffer myCert; buffer myCert;
word32 certSz; word32 certSz;
@ -1386,6 +1387,9 @@ static int DoCertificate(SSL* ssl, byte* input, word32* inOutIdx)
listSz -= certSz + CERT_HEADER_SZ; listSz -= certSz + CERT_HEADER_SZ;
if (ret != 0 && anyError == 0)
anyError = ret; /* save error from last time */
#ifdef SESSION_CERTS #ifdef SESSION_CERTS
if (ssl->session.chain.count < MAX_CHAIN_DEPTH && if (ssl->session.chain.count < MAX_CHAIN_DEPTH &&
myCert.length < MAX_X509_SIZE) { myCert.length < MAX_X509_SIZE) {
@ -1476,6 +1480,9 @@ static int DoCertificate(SSL* ssl, byte* input, word32* inOutIdx)
FreeDecodedCert(&dCert); FreeDecodedCert(&dCert);
} }
if (anyError != 0)
ret = anyError;
if (ret == 0 && ssl->options.side == CLIENT_END) if (ret == 0 && ssl->options.side == CLIENT_END)
ssl->options.serverState = SERVER_CERT_COMPLETE; ssl->options.serverState = SERVER_CERT_COMPLETE;