Changeset 96763 in vbox for trunk/src/VBox/Runtime/common/crypto
- Timestamp:
- Sep 16, 2022 9:10:51 AM (2 years ago)
- Location:
- trunk/src/VBox/Runtime/common/crypto
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/crypto/key-internal.h
r96407 r96763 61 61 uint32_t cBits; 62 62 63 #if defined(IPRT_WITH_OPENSSL)64 /** Size of raw key copy. */65 uint32_t cbEncoded;66 /** Raw copy of the key, for openssl and such.67 * If sensitive, this is a safer allocation, otherwise it follows the structure. */68 uint8_t *pbEncoded;69 #endif70 71 63 /** Type specific data. */ 72 64 union … … 93 85 } RsaPublic; 94 86 } u; 87 88 #if defined(IPRT_WITH_OPENSSL) 89 /** Size of raw key copy. */ 90 uint32_t cbEncoded; 91 /** Raw copy of the key, for openssl and such. 92 * If sensitive, this is a safer allocation, otherwise it follows the structure. */ 93 uint8_t *pbEncoded; 94 #endif 95 95 } RTCRKEYINT; 96 96 /** Pointer to a crypographic key. */ … … 109 109 /** Set if public key bits are present. */ 110 110 #define RTCRKEYINT_F_PUBLIC UINT32_C(0x00000004) 111 /** Set if the cbEncoded/pbEncoded members are present. */ 112 #define RTCRKEYINT_F_INCLUDE_ENCODED UINT32_C(0x00000008) 111 113 /** @} */ 112 114 -
trunk/src/VBox/Runtime/common/crypto/key-openssl.cpp
r96407 r96763 77 77 AssertReturn(hKey->u32Magic == RTCRKEYINT_MAGIC, VERR_INVALID_HANDLE); 78 78 AssertReturn(fNeedPublic == !(hKey->fFlags & RTCRKEYINT_F_PRIVATE), VERR_WRONG_TYPE); 79 AssertReturn(hKey->fFlags & RTCRKEYINT_F_INCLUDE_ENCODED, VERR_WRONG_TYPE); /* build misconfig */ 79 80 80 81 rtCrOpenSslInit(); … … 140 141 AssertReturn(hKey->u32Magic == RTCRKEYINT_MAGIC, VERR_INVALID_HANDLE); 141 142 AssertReturn(fNeedPublic == !(hKey->fFlags & RTCRKEYINT_F_PRIVATE), VERR_WRONG_TYPE); 143 AssertReturn(hKey->fFlags & RTCRKEYINT_F_INCLUDE_ENCODED, VERR_WRONG_TYPE); /* build misconfig */ 142 144 143 145 rtCrOpenSslInit(); -
trunk/src/VBox/Runtime/common/crypto/key.cpp
r96407 r96763 76 76 pThis->fFlags = fFlags; 77 77 #if defined(IPRT_WITH_OPENSSL) 78 pThis->fFlags |= RTCRKEYINT_F_INCLUDE_ENCODED; 78 79 pThis->cbEncoded = cbEncoded; 79 80 if (!(fFlags & RTCRKEYINT_F_SENSITIVE))
Note:
See TracChangeset
for help on using the changeset viewer.