VirtualBox

Changeset 54591 in vbox for trunk/include


Ignore:
Timestamp:
Mar 2, 2015 7:55:29 PM (10 years ago)
Author:
vboxsync
Message:

Add support to supply passwords for disk encryption while the VM is running

Location:
trunk/include/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vd-ifs.h

    r54403 r54591  
    44
    55/*
    6  * Copyright (C) 2011-2012 Oracle Corporation
     6 * Copyright (C) 2011-2015 Oracle Corporation
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    795795
    796796/**
     797 * Checks whether a given key is existing.
     798 *
     799 * @return  true if the key exists.
     800 * @return  false if the key does not exist.
     801 * @param   pCfgIf      Pointer to configuration callback table.
     802 * @param   pszName     Name of the key.
     803 */
     804DECLINLINE(bool) VDCFGIsKeyExisting(PVDINTERFACECONFIG pCfgIf, const char *pszName)
     805{
     806    size_t cb = 0;
     807    int rc = pCfgIf->pfnQuerySize(pCfgIf->Core.pvUser, pszName, &cb);
     808    return rc == VERR_CFGM_VALUE_NOT_FOUND ? false : true;
     809}
     810
     811/**
    797812 * Query configuration, unsigned 64-bit integer value with default.
    798813 *
     
    14311446
    14321447    /**
    1433      * Gets the password to open a key store supplied through the onfig interface.
     1448     * Gets a reference to the password identified by the given ID to open a key store supplied through the config interface.
    14341449     *
    14351450     * @returns VBox status code.
    14361451     * @param   pvUser          The opaque user data associated with this interface.
     1452     * @param   pszId           The alias/id for the password to retain.
    14371453     * @param   ppszPassword    Where to store the password to unlock the key store on success.
    14381454     */
    1439     DECLR3CALLBACKMEMBER(int, pfnKeyStoreGetPassword, (void *pvUser, const char **ppszPassword));
     1455    DECLR3CALLBACKMEMBER(int, pfnKeyStorePasswordRetain, (void *pvUser, const char *pszId, const char **ppszPassword));
     1456
     1457    /**
     1458     * Releases a reference of the password previously acquired with VDINTERFACECRYPTO::pfnKeyStorePasswordRetain()
     1459     * identified by the given ID.
     1460     *
     1461     * @returns VBox status code.
     1462     * @param   pvUser          The opaque user data associated with this interface.
     1463     * @param   pszId           The alias/id for the password to release.
     1464     */
     1465    DECLR3CALLBACKMEMBER(int, pfnKeyStorePasswordRelease, (void *pvUser, const char *pszId));
    14401466
    14411467    /**
     
    15101536
    15111537/**
    1512  * @copydoc VDINTERFACECRYPTO::pfnKeyStoreGetPassword
    1513  */
    1514 DECLINLINE(int) vdIfCryptoKeyStoreGetPassword(PVDINTERFACECRYPTO pIfCrypto, const char **ppszPassword)
    1515 {
    1516     return pIfCrypto->pfnKeyStoreGetPassword(pIfCrypto->Core.pvUser, ppszPassword);
     1538 * @copydoc VDINTERFACECRYPTO::pfnKeyStorePasswordRetain
     1539 */
     1540DECLINLINE(int) vdIfCryptoKeyStorePasswordRetain(PVDINTERFACECRYPTO pIfCrypto, const char *pszId, const char **ppszPassword)
     1541{
     1542    return pIfCrypto->pfnKeyStorePasswordRetain(pIfCrypto->Core.pvUser, pszId, ppszPassword);
     1543}
     1544
     1545/**
     1546 * @copydoc VDINTERFACECRYPTO::pfnKeyStorePasswordRelease
     1547 */
     1548DECLINLINE(int) vdIfCryptoKeyStorePasswordRelease(PVDINTERFACECRYPTO pIfCrypto, const char *pszId)
     1549{
     1550    return pIfCrypto->pfnKeyStorePasswordRelease(pIfCrypto->Core.pvUser, pszId);
    15171551}
    15181552
  • trunk/include/VBox/vmm/pdmifs.h

    r53965 r54591  
    44
    55/*
    6  * Copyright (C) 2006-2014 Oracle Corporation
     6 * Copyright (C) 2006-2015 Oracle Corporation
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    13961396     */
    13971397    DECLR3CALLBACKMEMBER(int, pfnKeyRelease, (PPDMISECKEY pInterface, const char *pszId));
     1398
     1399    /**
     1400     * Retains a password identified by the ID. The caller will only hold a reference
     1401     * to the password and must not modify the buffer in any way.
     1402     *
     1403     * @returns VBox status code.
     1404     * @param   pInterface      Pointer to this interface.
     1405     * @param   pszId           The alias/id for the password to retrieve.
     1406     * @param   ppszPassword    Where to store the pointer to the password on success.
     1407     */
     1408    DECLR3CALLBACKMEMBER(int, pfnPasswordRetain, (PPDMISECKEY pInterface, const char *pszId,
     1409                                                  const char **ppszPassword));
     1410
     1411    /**
     1412     * Releases one reference of the password identified by the given identifier.
     1413     * The caller must not access the password after calling this operation.
     1414     *
     1415     * @returns VBox status code.
     1416     * @param   pInterface      Pointer to this interface.
     1417     * @param   pszId           The alias/id for the password to release.
     1418     *
     1419     * @note: It is advised to release the password whenever it is not used anymore so the entity
     1420     *        storing the password can do anything to make retrieving the password from memory more
     1421     *        difficult like scrambling the memory buffer for instance.
     1422     */
     1423    DECLR3CALLBACKMEMBER(int, pfnPasswordRelease, (PPDMISECKEY pInterface, const char *pszId));
    13981424} PDMISECKEY;
    13991425/** PDMISECKEY interface ID. */
    1400 #define PDMISECKEY_IID                           "a7336c4a-2ca0-489d-ad2d-f740f215a1e6"
     1426#define PDMISECKEY_IID                           "3d698355-d995-453d-960f-31566a891df2"
    14011427
    14021428/** Pointer to a secret key helper interface. */
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