summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authornelson%bolyard.com <devnull@localhost>2007-04-26 01:57:44 +0000
committernelson%bolyard.com <devnull@localhost>2007-04-26 01:57:44 +0000
commit20f612cc8e1785eefa5680ec6030080907eb09c7 (patch)
treeb3aaedb6ba96fc1e8a3447d97cc5beedb3918fdc /security
parent68e59dd476287546f2730689d6298011266ef9a8 (diff)
downloadnss-hg-20f612cc8e1785eefa5680ec6030080907eb09c7.tar.gz
Bug 377542. Eliminate duplicate implementation of cert validity time checking.
r=neil.williams,alexei.volkov
Diffstat (limited to 'security')
-rw-r--r--security/nss/lib/certhigh/certvfy.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/security/nss/lib/certhigh/certvfy.c b/security/nss/lib/certhigh/certvfy.c
index 1982fe55b..554d88486 100644
--- a/security/nss/lib/certhigh/certvfy.c
+++ b/security/nss/lib/certhigh/certvfy.c
@@ -54,42 +54,15 @@
#include "pki3hack.h"
#include "base.h"
-#define PENDING_SLOP (24L*60L*60L)
/*
- * WARNING - this function is depricated, and will go away in the near future.
- * It has been superseded by CERT_CheckCertValidTimes().
- *
* Check the validity times of a certificate
*/
SECStatus
CERT_CertTimesValid(CERTCertificate *c)
{
- int64 now, notBefore, notAfter, pendingSlop;
- SECStatus rv;
-
- /* if cert is already marked OK, then don't bother to check */
- if ( c->timeOK ) {
- return(SECSuccess);
- }
-
- /* get current time */
- now = PR_Now();
- rv = CERT_GetCertTimes(c, &notBefore, &notAfter);
-
- if (rv) {
- return(SECFailure);
- }
-
- LL_I2L(pendingSlop, PENDING_SLOP);
- LL_SUB(notBefore, notBefore, pendingSlop);
-
- if (LL_CMP(now, <, notBefore) || LL_CMP(now, >, notAfter)) {
- PORT_SetError(SEC_ERROR_EXPIRED_CERTIFICATE);
- return(SECFailure);
- }
-
- return(SECSuccess);
+ SECCertTimeValidity valid = CERT_CheckCertValidTimes(c, PR_Now(), PR_TRUE);
+ return (valid == secCertTimeValid) ? SECSuccess : SECFailure;
}
/*