mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-02-06 11:10:15 +00:00
Similar to the #154 issue, adding multiple delta platform certificates was blocked because there wasn't a check on if the certificate was a base or not. (#157)
This commit is contained in:
parent
ecd0ab5708
commit
e69bb48799
@ -678,22 +678,24 @@ public class CertificateRequestPageController extends PageController<NoPageParam
|
|||||||
if (existingCertificate == null) {
|
if (existingCertificate == null) {
|
||||||
if (certificateType.equals(PLATFORMCREDENTIAL)) {
|
if (certificateType.equals(PLATFORMCREDENTIAL)) {
|
||||||
PlatformCredential platformCertificate = (PlatformCredential) certificate;
|
PlatformCredential platformCertificate = (PlatformCredential) certificate;
|
||||||
List<PlatformCredential> sharedCertificates = getCertificateByBoardSN(
|
if (platformCertificate.isBase()) {
|
||||||
certificateType,
|
List<PlatformCredential> sharedCertificates = getCertificateByBoardSN(
|
||||||
platformCertificate.getPlatformSerial(),
|
certificateType,
|
||||||
certificateManager);
|
platformCertificate.getPlatformSerial(),
|
||||||
|
certificateManager);
|
||||||
|
|
||||||
if (sharedCertificates != null) {
|
if (sharedCertificates != null) {
|
||||||
for (PlatformCredential pc : sharedCertificates) {
|
for (PlatformCredential pc : sharedCertificates) {
|
||||||
if (pc.isBase()) {
|
if (pc.isBase()) {
|
||||||
final String failMessage = "Storing certificate failed: "
|
final String failMessage = "Storing certificate failed: "
|
||||||
+ "platform credential "
|
+ "platform credential "
|
||||||
+ "chain (" + pc.getPlatformSerial()
|
+ "chain (" + pc.getPlatformSerial()
|
||||||
+ ") base already exists in this chain ("
|
+ ") base already exists in this chain ("
|
||||||
+ fileName + ")";
|
+ fileName + ")";
|
||||||
messages.addError(failMessage);
|
messages.addError(failMessage);
|
||||||
LOGGER.error(failMessage);
|
LOGGER.error(failMessage);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user