Modified the request class that handles uploading, deleting and other associated ACA actions, to only delete multiple associated certificates if the certificate being deleted is a base platform certificate. (#155)

This commit is contained in:
Cyrus 2019-06-06 11:07:56 -04:00 committed by GitHub
parent 5cd77c589d
commit ecd0ab5708
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -261,16 +261,19 @@ public class CertificateRequestPageController extends PageController<NoPageParam
} else {
if (certificateType.equals(PLATFORMCREDENTIAL)) {
PlatformCredential platformCertificate = (PlatformCredential) certificate;
List<PlatformCredential> sharedCertificates = getCertificateByBoardSN(
certificateType,
platformCertificate.getPlatformSerial(),
certificateManager);
if (platformCertificate.isBase()) {
// only do this if the base is being deleted.
List<PlatformCredential> sharedCertificates = getCertificateByBoardSN(
certificateType,
platformCertificate.getPlatformSerial(),
certificateManager);
if (sharedCertificates != null) {
for (PlatformCredential pc : sharedCertificates) {
if (!pc.isBase()) {
pc.archive();
certificateManager.update(pc);
if (sharedCertificates != null) {
for (PlatformCredential pc : sharedCertificates) {
if (!pc.isBase()) {
pc.archive();
certificateManager.update(pc);
}
}
}
}