Check in sorted list into OTIS branch for beta release unlabeled-1.85.2
authorrelyea%netscape.com
Tue, 23 Jul 2002 00:39:55 +0000
branchunlabeled-1.85.2
changeset 3340 c301b45874895c87e319d17ec1cb313aee0388d5
parent 3286 61e50a03cb52762a859250301bdb3da16bce7f8b
child 13818 6e37434844020749c37cdb964532dbd9b3c9f0dc
push idunknown
push userunknown
push dateunknown
Check in sorted list into OTIS branch for beta release
security/nss/lib/pk11wrap/pk11cert.c
--- a/security/nss/lib/pk11wrap/pk11cert.c
+++ b/security/nss/lib/pk11wrap/pk11cert.c
@@ -1429,21 +1429,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_AddCertToListSorted(certList, certCert,
+			CERT_SortCBValidity, &now);
 	    }
 	}
 	if (CERT_LIST_HEAD(certList) == NULL) {
 	    CERT_DestroyCertList(certList);
 	    certList = NULL;
 	}
 	nss_ZFreeIf(foundCerts);
     }