Search in sources :

Example 6 with TblMleJpaController

use of com.intel.mtwilson.as.controller.TblMleJpaController in project OpenAttestation by OpenAttestation.

the class HostBO method getMleDetails.

/**
        *
        * @param mleName
        * @param mleVersion
        * @param osName
        * @param osVersion
        * @param oemName
        * @return
        */
private TblMle getMleDetails(String mleName, String mleVersion, String osName, String osVersion, String oemName) {
    TblMle tblMle;
    validateNull("mleName", mleName);
    validateNull("mleVersion", mleVersion);
    validateMleExtraAttributes(osName, osVersion, oemName);
    TblMleJpaController tblMleJpa = getMleJpaController();
    if (StringUtils.isNotBlank(oemName)) {
        log.info("Getting BIOS MLE from database");
        tblMle = tblMleJpa.findBiosMle(mleName, mleVersion, oemName);
    } else {
        log.info("Get VMM MLE from database");
        tblMle = tblMleJpa.findVmmMle(mleName, mleVersion, osName, osVersion);
    }
    return tblMle;
}
Also used : TblMleJpaController(com.intel.mtwilson.as.controller.TblMleJpaController) TblMle(com.intel.mtwilson.as.data.TblMle)

Example 7 with TblMleJpaController

use of com.intel.mtwilson.as.controller.TblMleJpaController in project OpenAttestation by OpenAttestation.

the class HostBO method findBiosMleForHost.

private TblMle findBiosMleForHost(TxtHost host) throws IOException {
    TblMleJpaController tblMleJpaController = getMleJpaController();
    TblMle biosMleId = tblMleJpaController.findBiosMle(host.getBios().getName(), host.getBios().getVersion(), host.getBios().getOem());
    if (biosMleId == null) {
        throw new ASException(ErrorCode.AS_BIOS_INCORRECT, host.getBios().getName(), host.getBios().getVersion());
    }
    return biosMleId;
}
Also used : TblMleJpaController(com.intel.mtwilson.as.controller.TblMleJpaController) TblMle(com.intel.mtwilson.as.data.TblMle) ASException(com.intel.mountwilson.as.common.ASException)

Example 8 with TblMleJpaController

use of com.intel.mtwilson.as.controller.TblMleJpaController in project OpenAttestation by OpenAttestation.

the class TrustAgentStrategy method getPcrList.

private String getPcrList(TblHosts tblHosts) {
    // Get the Bios MLE without accessing cache
    TblMle biosMle = new TblMleJpaController(getEntityManagerFactory()).findMleById(tblHosts.getBiosMleId().getId());
    String biosPcrList = biosMle.getRequiredManifestList();
    if (biosPcrList.isEmpty()) {
        throw new ASException(ErrorCode.AS_MISSING_MLE_REQD_MANIFEST_LIST, tblHosts.getBiosMleId().getName(), tblHosts.getBiosMleId().getVersion());
    }
    // Get the Vmm MLE without accessing cache
    TblMle vmmMle = new TblMleJpaController(getEntityManagerFactory()).findMleById(tblHosts.getVmmMleId().getId());
    String vmmPcrList = vmmMle.getRequiredManifestList();
    if (vmmPcrList == null || vmmPcrList.isEmpty()) {
        throw new ASException(ErrorCode.AS_MISSING_MLE_REQD_MANIFEST_LIST, tblHosts.getVmmMleId().getName(), tblHosts.getVmmMleId().getVersion());
    }
    return biosPcrList + "," + vmmPcrList;
}
Also used : TblMleJpaController(com.intel.mtwilson.as.controller.TblMleJpaController) TblMle(com.intel.mtwilson.as.data.TblMle) ASException(com.intel.mountwilson.as.common.ASException)

Aggregations

TblMleJpaController (com.intel.mtwilson.as.controller.TblMleJpaController)8 ASException (com.intel.mountwilson.as.common.ASException)7 TblMle (com.intel.mtwilson.as.data.TblMle)7 TblModuleManifestJpaController (com.intel.mtwilson.as.controller.TblModuleManifestJpaController)2 IllegalOrphanException (com.intel.mtwilson.as.controller.exceptions.IllegalOrphanException)2 NonexistentEntityException (com.intel.mtwilson.as.controller.exceptions.NonexistentEntityException)2 TblModuleManifest (com.intel.mtwilson.as.data.TblModuleManifest)2 TblEventTypeJpaController (com.intel.mtwilson.as.controller.TblEventTypeJpaController)1 TblPackageNamespaceJpaController (com.intel.mtwilson.as.controller.TblPackageNamespaceJpaController)1 TblEventType (com.intel.mtwilson.as.data.TblEventType)1 TblPackageNamespace (com.intel.mtwilson.as.data.TblPackageNamespace)1 CryptographyException (com.intel.mtwilson.crypto.CryptographyException)1 UUID (com.intel.mtwilson.util.io.UUID)1 Measurement (com.intel.mtwilson.util.model.Measurement)1 PcrEventLog (com.intel.mtwilson.util.model.PcrEventLog)1 IOException (java.io.IOException)1 UnknownHostException (java.net.UnknownHostException)1 NoResultException (javax.persistence.NoResultException)1