Changeset 95681 in vbox
- Timestamp:
- Jul 17, 2022 6:39:27 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 152331
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/crypto/store.h
r93115 r95681 133 133 * and certificates. */ 134 134 RTCRSTOREID_SYSTEM_TRUSTED_CAS_AND_CERTIFICATES, 135 /** Open the certificate store of the current user containing intermediate CAs. 136 * @remarks This may or may not include all the certificates in the system 137 * store, that's host dependent. So, you better look in both. */ 138 RTCRSTOREID_USER_INTERMEDIATE_CAS, 139 /** Open the certificate store of the system containg intermediate CAs. */ 140 RTCRSTOREID_SYSTEM_INTERMEDIATE_CAS, 135 141 /** End of valid values. */ 136 142 RTCRSTOREID_END, … … 146 152 * 147 153 * @returns IPRT status code. 148 * @retval VWRN_ALREADY_EXISTS if the certificate is already present and149 * RTCRCERTCTX_F_ADD_IF_NOT_FOUND was specified.150 154 * @param phStore Where to return the store handle. Use 151 155 * RTCrStoreRelease to release it. -
trunk/src/VBox/Runtime/r3/win/RTCrStoreCreateSnapshotById-win.cpp
r93115 r95681 57 57 HCERTSTORE hNativeStore = pfnOpenStore(CERT_STORE_PROV_SYSTEM_W, PKCS_7_ASN_ENCODING | X509_ASN_ENCODING, 58 58 NULL /* hCryptProv = default */, fStore | fOpenStore, pwszStoreName); 59 if (h Store)59 if (hNativeStore) 60 60 { 61 61 PCCERT_CONTEXT pCurCtx = NULL; … … 137 137 * Do the work. 138 138 */ 139 DWORD fStore = CERT_SYSTEM_STORE_CURRENT_USER; 139 140 switch (enmStoreId) 140 141 { 142 case RTCRSTOREID_SYSTEM_TRUSTED_CAS_AND_CERTIFICATES: 143 case RTCRSTOREID_SYSTEM_INTERMEDIATE_CAS: 144 fStore = CERT_SYSTEM_STORE_LOCAL_MACHINE; 145 RT_FALL_THRU(); 141 146 case RTCRSTOREID_USER_TRUSTED_CAS_AND_CERTIFICATES: 142 case RTCRSTOREID_ SYSTEM_TRUSTED_CAS_AND_CERTIFICATES:147 case RTCRSTOREID_USER_INTERMEDIATE_CAS: 143 148 { 144 DWORD fStore = enmStoreId == RTCRSTOREID_USER_TRUSTED_CAS_AND_CERTIFICATES 145 ? CERT_SYSTEM_STORE_CURRENT_USER : CERT_SYSTEM_STORE_LOCAL_MACHINE; 146 static PCRTUTF16 const s_apwszStores[] = { L"AuthRoot", L"CA", L"MY", L"Root" }; 147 for (uint32_t i = 0; i < RT_ELEMENTS(s_apwszStores); i++) 148 rc = rtCrStoreAddCertsFromNative(hStore, fStore, s_apwszStores[i], pfnOpenStore, pfnCloseStore, 149 /** @todo CA and MY in s_apwszRootStores are _very_ questionable!!! However, 150 * curl may need them to work correct and it doesn't seem to have any 151 * intermediate ca file. :/ */ 152 static PCRTUTF16 const s_apwszRootStores[] = { L"AuthRoot", L"CA", L"MY", L"Root" }; 153 static PCRTUTF16 const s_apwszIntermediateStores[] = { L"CA", L"MY" }; 154 PCRTUTF16 const *papwszStores = s_apwszRootStores; 155 uint32_t cStores = RT_ELEMENTS(s_apwszRootStores); 156 if (enmStoreId == RTCRSTOREID_USER_INTERMEDIATE_CAS || enmStoreId == RTCRSTOREID_SYSTEM_INTERMEDIATE_CAS) 157 { 158 papwszStores = s_apwszIntermediateStores; 159 cStores = RT_ELEMENTS(s_apwszIntermediateStores); 160 } 161 162 for (uint32_t i = 0; i < cStores; i++) 163 rc = rtCrStoreAddCertsFromNative(hStore, fStore, papwszStores[i], pfnOpenStore, pfnCloseStore, 149 164 pfnEnumCerts, rc, pErrInfo); 150 165 break;
Note:
See TracChangeset
for help on using the changeset viewer.