OTIS fix with tag advance NSS_OTIS_BETA_2_BRANCH
authorrelyea%netscape.com
Tue, 23 Jul 2002 00:53:42 +0000
branchNSS_OTIS_BETA_2_BRANCH
changeset 3341 f1873fb1cd126755fb849b1dcbcd9c206413616c
parent 3317 0db2e162ad1a1dc1ea4dfd67f242c3e4ea49334a
child 3342 179f6623dc30e96d625ec086cbb9868477468393
push idunknown
push userunknown
push dateunknown
OTIS fix with tag advance
security/nss/lib/pk11wrap/pk11cert.c
--- a/security/nss/lib/pk11wrap/pk11cert.c
+++ b/security/nss/lib/pk11wrap/pk11cert.c
@@ -1432,21 +1432,23 @@ PK11_FindCertsFromNickname(char *nicknam
 	                                                    NULL, 0, NULL);
 	nssPKIObjectCollection_Destroy(collection);
     }
     if (slot) {
 	PK11_FreeSlot(slot);
     }
     if (nickCopy) PORT_Free(nickCopy);
     if (foundCerts) {
+	PRTime now = PR_Now();
 	certList = CERT_NewCertList();
 	for (i=0, c = *foundCerts; c; c = foundCerts[++i]) {
 	    CERTCertificate *certCert = STAN_GetCERTCertificate(c);
 	    if (certCert) {
-		CERT_AddCertToListTail(certList, certCert);
+		CERT_AddCertToListTail(certList, certCert,
+			CERT_SortCBValidity, &now);
 	    }
 	}
 	if (CERT_LIST_HEAD(certList) == NULL) {
 	    CERT_DestroyCertList(certList);
 	    certList = NULL;
 	}
 	nss_ZFreeIf(foundCerts);
     }