Skip to content

Commit a29205d

Browse files
committed
Clean up log messages in DefStore
1 parent be8cc53 commit a29205d

1 file changed

Lines changed: 20 additions & 14 deletions

File tree

base/ocsp/src/main/java/com/netscape/cms/ocsp/DefStore.java

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ public SingleResponse processRequest(Request req) throws Exception {
310310

311311
CertID cid = req.getCertID();
312312
INTEGER serialNo = cid.getSerialNumber();
313-
logger.info("DefStore: Processing request for cert 0x" + serialNo.toString(16));
313+
logger.info("DefStore: Processing OCSP request for cert 0x" + serialNo.toString(16));
314314

315315
// cache result to speed up the performance
316316
X509CertImpl theCert = null;
@@ -324,7 +324,7 @@ public SingleResponse processRequest(Request req) throws Exception {
324324
logger.info("DefStore: CRL issuing point container: " + matched);
325325

326326
if (matched == null) {
327-
logger.info("DefStore: Searching for objectclass=" + CRLIssuingPointRecord.class.getName());
327+
logger.info("DefStore: Searching for issuing point records");
328328
Enumeration<CRLIssuingPointRecord> recs = searchCRLIssuingPointRecord(
329329
"objectclass=" + CRLIssuingPointRecord.class.getName(),
330330
100);
@@ -354,30 +354,29 @@ public SingleResponse processRequest(Request req) throws Exception {
354354
theCert = cert;
355355
continue;
356356
}
357-
logger.info("DefStore: Found issuer");
358357

358+
logger.info("DefStore: Found issuer: " + cert.getSubjectName());
359359
theCert = cert;
360360
theRec = rec;
361361
incReqCount(theRec.getId());
362362

363363
byte[] crldata = rec.getCRL();
364-
logger.info("DefStore: CRL: " + crldata);
365364

366365
if (crldata == null) {
367366
throw new Exception("Missing CRL data");
368367
}
369368

370369
if (rec.getCRLCache() == null) {
371-
logger.debug("DefStore: start building x509 crl impl");
370+
logger.info("DefStore: CRL cache not available -> parsing CRL data");
372371
try {
373372
theCRL = new X509CRLImpl(crldata);
374373
} catch (Exception e) {
375374
logger.error(CMS.getLogMessage("OCSP_DECODE_CRL", e.toString()), e);
376375
throw e;
377376
}
378-
logger.debug("DefStore: done building x509 crl impl");
377+
logger.info("DefStore: CRL number: " + theCRL.getCRLNumber());
379378
} else {
380-
logger.debug("DefStore: using crl cache");
379+
logger.info("DefStore: CRL cache available");
381380
}
382381

383382
logger.info("DefStore: Adding CRL issuing point container for {}", new String(Hex.encodeHex(digest)));
@@ -395,15 +394,14 @@ public SingleResponse processRequest(Request req) throws Exception {
395394
logger.debug("DefStore: Issuer cert: " + theCert);
396395

397396
if (theCert == null) {
398-
logger.warn("Missing issuer certificate");
397+
logger.warn("DefStore: Missing issuer certificate");
399398
// Unknown cert so respond with unknown state
400399
return new SingleResponse(cid, new UnknownInfo(), new GeneralizedTime(new Date()), null);
401400
}
402401

403402
logger.info("DefStore: Issuer DN: " + theCert.getSubjectX500Principal());
404403

405-
// check the serial number
406-
logger.info("Checked Status of certificate 0x" + serialNo.toString(16));
404+
logger.info("DefStore: Checking status of cert 0x" + serialNo.toString(16));
407405

408406
GeneralizedTime thisUpdate;
409407

@@ -415,7 +413,7 @@ public SingleResponse processRequest(Request req) throws Exception {
415413
thisUpdate = new GeneralizedTime(d);
416414
}
417415

418-
logger.debug("DefStore: this update: " + thisUpdate.toDate());
416+
logger.info("DefStore: This update: " + thisUpdate.toDate());
419417

420418
// this is an optional field
421419
GeneralizedTime nextUpdate;
@@ -432,7 +430,7 @@ public SingleResponse processRequest(Request req) throws Exception {
432430
nextUpdate = new GeneralizedTime(d);
433431
}
434432

435-
logger.debug("DefStore: next update: " + (nextUpdate == null ? null : nextUpdate.toDate()));
433+
logger.info("DefStore: Next update: " + (nextUpdate == null ? null : nextUpdate.toDate()));
436434

437435
CertStatus certStatus;
438436

@@ -441,6 +439,7 @@ public SingleResponse processRequest(Request req) throws Exception {
441439
certStatus = new UnknownInfo();
442440

443441
if (theRec == null) {
442+
logger.info("DefStore: CRL not found -> Unknown");
444443
return new SingleResponse(cid, certStatus, thisUpdate, nextUpdate);
445444
}
446445

@@ -451,34 +450,41 @@ public SingleResponse processRequest(Request req) throws Exception {
451450
RevokedCertificate rc = cache.get(new BigInteger(serialNo.toString()));
452451
if (rc == null) {
453452
if (isNotFoundGood()) {
453+
logger.info("DefStore: Cert not found in CRL cache -> Good");
454454
certStatus = new GoodInfo();
455455
} else {
456+
logger.info("DefStore: Cert not found in CRL cached -> Unknown");
456457
certStatus = new UnknownInfo();
457458
}
458459
} else {
459-
460+
logger.info("DefStore: Cert found in CRL cache -> Revoked");
460461
certStatus = new RevokedInfo(
461462
new GeneralizedTime(
462463
rc.getRevocationDate()));
463464
}
465+
} else {
466+
logger.info("DefStore: CRL cache not found -> Unknown");
464467
}
465468

466469
return new SingleResponse(cid, certStatus, thisUpdate,
467470
nextUpdate);
468471
}
469472

470-
logger.debug("DefStore: evaluating x509 crl impl");
473+
logger.info("DefStore: Getting CRL entry for cert 0x" + serialNo.toString(16));
471474
X509CRLEntry crlentry = theCRL.getRevokedCertificate(new BigInteger(serialNo.toString()));
472475

473476
if (crlentry == null) {
474477
// good or unknown
475478
if (isNotFoundGood()) {
479+
logger.info("DefStore: CRL entry not found -> Good");
476480
certStatus = new GoodInfo();
477481
} else {
482+
logger.info("DefStore: CRL entry not found -> Unknown");
478483
certStatus = new UnknownInfo();
479484
}
480485

481486
} else {
487+
logger.info("DefStore: CRL entry found -> Revoked");
482488
certStatus = new RevokedInfo(new GeneralizedTime(
483489
crlentry.getRevocationDate()));
484490
}

0 commit comments

Comments
 (0)