Added a null check for the platformCredentials in the issued certificate attribute helper so that NPEs aren't thrown.

This commit is contained in:
Cyrus 2021-01-14 12:48:53 -05:00
parent 164a43f056
commit 859fdbef83

View File

@ -114,9 +114,11 @@ public final class IssuedCertificateAttributeHelper {
// assemble AIK cert SAN, using info from EC and PC
X500NameBuilder nameBuilder = new X500NameBuilder();
populateEndorsementCredentialAttributes(endorsementCredential, nameBuilder);
if (platformCredentials != null) {
for (PlatformCredential platformCredential : platformCredentials) {
populatePlatformCredentialAttributes(platformCredential, nameBuilder);
}
}
// add the OID for the TCG-required TPM ID label
DERUTF8String idLabel = new DERUTF8String(hostName);