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:
Cyrus 2019-06-11 06:59:38 -04:00 committed by GitHub
parent ecd0ab5708
commit e69bb48799
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -678,22 +678,24 @@ public class CertificateRequestPageController extends PageController<NoPageParam
if (existingCertificate == null) {
if (certificateType.equals(PLATFORMCREDENTIAL)) {
PlatformCredential platformCertificate = (PlatformCredential) certificate;
List<PlatformCredential> sharedCertificates = getCertificateByBoardSN(
certificateType,
platformCertificate.getPlatformSerial(),
certificateManager);
if (platformCertificate.isBase()) {
List<PlatformCredential> sharedCertificates = getCertificateByBoardSN(
certificateType,
platformCertificate.getPlatformSerial(),
certificateManager);
if (sharedCertificates != null) {
for (PlatformCredential pc : sharedCertificates) {
if (pc.isBase()) {
final String failMessage = "Storing certificate failed: "
+ "platform credential "
+ "chain (" + pc.getPlatformSerial()
+ ") base already exists in this chain ("
+ fileName + ")";
messages.addError(failMessage);
LOGGER.error(failMessage);
return;
if (sharedCertificates != null) {
for (PlatformCredential pc : sharedCertificates) {
if (pc.isBase()) {
final String failMessage = "Storing certificate failed: "
+ "platform credential "
+ "chain (" + pc.getPlatformSerial()
+ ") base already exists in this chain ("
+ fileName + ")";
messages.addError(failMessage);
LOGGER.error(failMessage);
return;
}
}
}
}