mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-20 21:43:18 +00:00
Added a null check for the endorsement credential for the tpm 1.2
This commit is contained in:
parent
a7eae2fd77
commit
6dd948c828
@ -1263,12 +1263,8 @@ public abstract class AbstractAttestationCertificateAuthority
|
||||
|
||||
Extension authKeyIdentifier = null;
|
||||
|
||||
try {
|
||||
authKeyIdentifier = IssuedCertificateAttributeHelper
|
||||
.buildAuthorityKeyIdentifier(endorsementCredential);
|
||||
} catch (Exception ex) {
|
||||
LOG.error("Test");
|
||||
}
|
||||
|
||||
builder.addExtension(subjectAlternativeName);
|
||||
if (authKeyIdentifier != null) {
|
||||
|
@ -76,6 +76,9 @@ public final class IssuedCertificateAttributeHelper {
|
||||
*/
|
||||
public static Extension buildAuthorityKeyIdentifier(
|
||||
final EndorsementCredential endorsementCredential) throws IOException {
|
||||
if (endorsementCredential == null || endorsementCredential.getX509Certificate() == null) {
|
||||
return null;
|
||||
}
|
||||
byte[] extValue = endorsementCredential.getX509Certificate()
|
||||
.getExtensionValue(Extension.authorityKeyIdentifier.getId());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user