Skip to content

Commit

Permalink
Bug2246422 (debug log cleanup)- ServerSideKeygen static SKID
Browse files Browse the repository at this point in the history
This is just a follow-up patch to commit
71bf161
to clean up some debug calls.

relating to https://bugzilla.redhat.com/show_bug.cgi?id=2246422
  • Loading branch information
ladycfu committed Nov 15, 2023
1 parent efb1aa7 commit 6232c05
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,15 +297,15 @@ public void execute(IRequest request)

// process certificate issuance
X509CertInfo info = request.getExtDataInCertInfo(REQUEST_CERTINFO);
logger.debug(method + "cfu before: X509CertInfo info = " + info.toString());
// logger.debug(method + " before: X509CertInfo info = " + info.toString());

if (isSSKeygen) {
try {
String pubKeyStr = request.getExtDataInString("public_key");
if (pubKeyStr == null) {
throw new EProfileException("Server-Side Keygen enrollment failed to retrieve public_key from KRA");
}
logger.debug(method + "pubKeyStr = " + pubKeyStr);
// logger.debug(method + "pubKeyStr = " + pubKeyStr);
byte[] pubKeyB = CryptoUtil.base64Decode(pubKeyStr);
CertificateX509Key certKey = new CertificateX509Key(
new ByteArrayInputStream(pubKeyB));
Expand All @@ -316,17 +316,17 @@ public void execute(IRequest request)
if (infokey != null) {
X509Key key = (X509Key)
infokey.get(CertificateX509Key.KEY);
logger.debug(method + "key = " + key.toString());
// logger.debug(method + "key = " + key.toString());
// a placeholder temporary fake key was put in
// ServerKeygenUserKeyDefault
info.delete(X509CertInfo.KEY);
logger.debug(method + "key deleted");
// logger.debug(method + "fake key deleted");
}

// adding real key
info.set(X509CertInfo.KEY, certKey);

// fake key relaced;
// fake key replaced;
// need to compute/replace SKI as well if present

Extension ext = CertUtils.getExtension(PKIXExtensions.SubjectKey_Id.toString(), info);
Expand All @@ -344,8 +344,8 @@ public void execute(IRequest request)
CertUtils.replaceExtension(PKIXExtensions.SubjectKey_Id.toString(), skiExt, info);
logger.debug(method + " SubjectKey_Id replaced");

logger.debug(method + " after replacement: X509CertInfo info = " + info.toString());
}/* else
// logger.debug(method + " after replacement: X509CertInfo info = " + info.toString());
}/* else
Not every cert needs an SKI
logger.debug(method + "did not find SubjectKey_Id");
*/
Expand Down

0 comments on commit 6232c05

Please sign in to comment.