VirtualBox

Changeset 98964 in vbox


Ignore:
Timestamp:
Mar 14, 2023 2:40:37 PM (21 months ago)
Author:
vboxsync
Message:

Main/UefiVariableStore: Add API to add signatures to the MOK list (Machine Owner Key) in order to deploy signatures for the guest additions, bugref:10287

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/formats/efi-signature.h

    r98103 r98964  
    5353#define EFI_IMAGE_SECURITY_DATABASE_GUID \
    5454    { 0xd719b2cb, 0x3d3a, 0x4596, { 0xa3, 0xbc, 0xda, 0xd0, 0x0e, 0x67, 0x65, 0x6f }}
     55/** The GUID used for setting and retrieving the MOK (Machine Owner Key) from the variable store. */
     56#define EFI_IMAGE_MOK_DATABASE_GUID \
     57    { 0x605dab50, 0xe046, 0x4300, { 0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23 }}
    5558
    5659
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r98793 r98964  
    63076307    uuid="d134c6b6-4479-430d-bb73-68a452ba3e67"
    63086308    wsmap="managed"
    6309     reservedMethods="10" reservedAttributes="5"
     6309    reservedMethods="9" reservedAttributes="5"
    63106310    >
    63116311    <desc>
     
    64516451        in the signature databases.
    64526452      </desc>
     6453    </method>
     6454
     6455    <method name="addSignatureToMok">
     6456      <desc>
     6457        Convenience method to add a new entry to the MOK (Machine Owner Key) signature database.
     6458      </desc>
     6459      <param name="signature" type="octet" safearray="yes" dir="in">
     6460        <desc>The signature to add.</desc>
     6461      </param>
     6462      <param name="owner" type="uuid" mod="string" dir="in">
     6463        <desc>UUID of the signature owner.</desc>
     6464      </param>
     6465      <param name="signatureType" type="SignatureType" dir="in">
     6466        <desc>Type of the signature.</desc>
     6467      </param>
    64536468    </method>
    64546469
  • trunk/src/VBox/Main/include/UefiVariableStoreImpl.h

    r98103 r98964  
    7676    HRESULT addSignatureToDbx(const std::vector<BYTE> &aData, const com::Guid &aOwnerUuid, SignatureType_T enmSignatureType);
    7777    HRESULT enrollDefaultMsSignatures(void);
     78    HRESULT addSignatureToMok(const std::vector<BYTE> &aData, const com::Guid &aOwnerUuid, SignatureType_T enmSignatureType);
    7879
    7980    int i_uefiVarStoreSetVarAttr(const char *pszVar, uint32_t fAttr);
  • trunk/src/VBox/Main/src-server/UefiVariableStoreImpl.cpp

    r98262 r98964  
    556556
    557557
     558HRESULT UefiVariableStore::addSignatureToMok(const std::vector<BYTE> &aData, const com::Guid &aOwnerUuid, SignatureType_T enmSignatureType)
     559{
     560    /* the machine needs to be mutable */
     561    AutoMutableStateDependency adep(m->pMachine);
     562    if (FAILED(adep.hrc())) return adep.hrc();
     563
     564    HRESULT hrc = i_retainUefiVariableStore(false /*fReadonly*/);
     565    if (FAILED(hrc)) return hrc;
     566
     567    AutoWriteLock wlock(this COMMA_LOCKVAL_SRC_POS);
     568
     569    EFI_GUID GuidMokList = EFI_IMAGE_MOK_DATABASE_GUID;
     570    hrc = i_uefiVarStoreAddSignatureToDbVec(&GuidMokList, "MokList", aData, aOwnerUuid, enmSignatureType);
     571
     572    i_releaseUefiVariableStore();
     573    return hrc;
     574}
     575
     576
     577
     578
    558579/**
    559580 * Sets the given attributes for the given EFI variable store variable.
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette