Changeset 54403 in vbox
- Timestamp:
- Feb 23, 2015 10:17:04 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vd-ifs.h
r53539 r54403 70 70 /** Interface for the metadata traverse callback. Per-operation. */ 71 71 VDINTERFACETYPE_TRAVERSEMETADATA, 72 /** Interface for crypto oper tions. Per-disk. */72 /** Interface for crypto operations. Per-filter. */ 73 73 VDINTERFACETYPE_CRYPTO, 74 74 /** invalid interface. */ … … 822 822 823 823 /** 824 * Query configuration, unsigned 64-bit integer value. 825 * 826 * @return VBox status code. 827 * @param pCfgIf Pointer to configuration callback table. 828 * @param pszName Name of an integer value 829 * @param pu64 Where to store the value. 830 */ 831 DECLINLINE(int) VDCFGQueryU64(PVDINTERFACECONFIG pCfgIf, const char *pszName, 832 uint64_t *pu64) 833 { 834 char aszBuf[32]; 835 int rc = pCfgIf->pfnQuery(pCfgIf->Core.pvUser, pszName, aszBuf, sizeof(aszBuf)); 836 if (RT_SUCCESS(rc)) 837 { 838 rc = RTStrToUInt64Full(aszBuf, 0, pu64); 839 } 840 841 return rc; 842 } 843 844 /** 824 845 * Query configuration, unsigned 32-bit integer value with default. 825 846 * … … 861 882 uint64_t u64; 862 883 int rc = VDCFGQueryU64Def(pCfgIf, pszName, &u64, fDef); 884 if (RT_SUCCESS(rc)) 885 *pf = u64 ? true : false; 886 return rc; 887 } 888 889 /** 890 * Query configuration, bool value. 891 * 892 * @return VBox status code. 893 * @param pCfgIf Pointer to configuration callback table. 894 * @param pszName Name of an integer value 895 * @param pf Where to store the value. 896 */ 897 DECLINLINE(int) VDCFGQueryBool(PVDINTERFACECONFIG pCfgIf, const char *pszName, 898 bool *pf) 899 { 900 uint64_t u64; 901 int rc = VDCFGQueryU64(pCfgIf, pszName, &u64); 863 902 if (RT_SUCCESS(rc)) 864 903 *pf = u64 ? true : false; … … 1391 1430 DECLR3CALLBACKMEMBER(int, pfnKeyRelease, (void *pvUser, const char *pszId)); 1392 1431 1432 /** 1433 * Gets the password to open a key store supplied through the onfig interface. 1434 * 1435 * @returns VBox status code. 1436 * @param pvUser The opaque user data associated with this interface. 1437 * @param ppszPassword Where to store the password to unlock the key store on success. 1438 */ 1439 DECLR3CALLBACKMEMBER(int, pfnKeyStoreGetPassword, (void *pvUser, const char **ppszPassword)); 1440 1441 /** 1442 * Saves a key store. 1443 * 1444 * @returns VBox status code. 1445 * @param pvUser The opaque user data associated with this interface. 1446 * @param pvKeyStore The key store to save. 1447 * @param cbKeyStore Size of the key store in bytes. 1448 * 1449 * @note The format is filter specific and should be treated as binary data. 1450 */ 1451 DECLR3CALLBACKMEMBER(int, pfnKeyStoreSave, (void *pvUser, const void *pvKeyStore, size_t cbKeyStore)); 1452 1453 /** 1454 * Returns the parameters after the key store was loaded successfully. 1455 * 1456 * @returns VBox status code. 1457 * @param pvUser The opaque user data associated with this interface. 1458 * @param pszCipher The cipher identifier the DEK is used for. 1459 * @param pbDek The raw DEK which was contained in the key store loaded by 1460 * VDINTERFACECRYPTO::pfnKeyStoreLoad(). 1461 * @param cbDek The size of the DEK. 1462 * 1463 * @note The provided pointer to the DEK is only valid until this call returns. 1464 * The content might change afterwards with out notice (when scrambling the key 1465 * for further protection for example) or might be even freed. 1466 * 1467 * @note This method is optional and can be NULL if the caller does not require the 1468 * parameters. 1469 */ 1470 DECLR3CALLBACKMEMBER(int, pfnKeyStoreReturnParameters, (void *pvUser, const char *pszCipher, 1471 const uint8_t *pbDek, size_t cbDek)); 1472 1393 1473 } VDINTERFACECRYPTO, *PVDINTERFACECRYPTO; 1394 1474 … … 1414 1494 1415 1495 /** 1416 * @copydoc VDINTERFACECRYPTO KEYS::pfnKeyRetain1496 * @copydoc VDINTERFACECRYPTO::pfnKeyRetain 1417 1497 */ 1418 1498 DECLINLINE(int) vdIfCryptoKeyRetain(PVDINTERFACECRYPTO pIfCrypto, const char *pszId, const uint8_t **ppbKey, size_t *pcbKey) … … 1422 1502 1423 1503 /** 1424 * @copydoc VDINTERFACECRYPTO KEYS::pfnKeyRelease1504 * @copydoc VDINTERFACECRYPTO::pfnKeyRelease 1425 1505 */ 1426 1506 DECLINLINE(int) vdIfCryptoKeyRelease(PVDINTERFACECRYPTO pIfCrypto, const char *pszId) … … 1429 1509 } 1430 1510 1511 /** 1512 * @copydoc VDINTERFACECRYPTO::pfnKeyStoreGetPassword 1513 */ 1514 DECLINLINE(int) vdIfCryptoKeyStoreGetPassword(PVDINTERFACECRYPTO pIfCrypto, const char **ppszPassword) 1515 { 1516 return pIfCrypto->pfnKeyStoreGetPassword(pIfCrypto->Core.pvUser, ppszPassword); 1517 } 1518 1519 /** 1520 * @copydoc VDINTERFACECRYPTO::pfnKeyStoreSave 1521 */ 1522 DECLINLINE(int) vdIfCryptoKeyStoreSave(PVDINTERFACECRYPTO pIfCrypto, const void *pvKeyStore, size_t cbKeyStore) 1523 { 1524 return pIfCrypto->pfnKeyStoreSave(pIfCrypto->Core.pvUser, pvKeyStore, cbKeyStore); 1525 } 1526 1527 /** 1528 * @copydoc VDINTERFACECRYPTO::pfnKeyStoreReturnParameters 1529 */ 1530 DECLINLINE(int) vdIfCryptoKeyStoreReturnParameters(PVDINTERFACECRYPTO pIfCrypto, const char *pszCipher, 1531 const uint8_t *pbDek, size_t cbDek) 1532 { 1533 if (pIfCrypto->pfnKeyStoreReturnParameters) 1534 return pIfCrypto->pfnKeyStoreReturnParameters(pIfCrypto->Core.pvUser, pszCipher, pbDek, cbDek); 1535 1536 return VINF_SUCCESS; 1537 } 1538 1539 1431 1540 RT_C_DECLS_END 1432 1541 -
trunk/src/VBox/Storage/Makefile.kmk
r53806 r54403 60 60 VDPluginCrypt_LDFLAGS.linux = -Wl,--no-undefined 61 61 62 VDPluginCrypt_SOURCES = VDFilterCrypt.cpp 62 VDPluginCrypt_SOURCES = \ 63 VDFilterCrypt.cpp \ 64 VDKeyStore.cpp 63 65 VDPluginCrypt_SOURCES.win = VDPluginCrypt.rc 64 66 endif
Note:
See TracChangeset
for help on using the changeset viewer.