vbox的更動 59625 路徑 trunk/src/VBox/Runtime
- 時間撮記:
- 2016-2-10 上午08:55:22 (9 年 以前)
- 位置:
- trunk/src/VBox/Runtime/common/crypto
- 檔案:
-
- 修改 2 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Runtime/common/crypto/pemfile.cpp
r57641 r59625 271 271 * tab, newline, return, form feed 272 272 * 273 * However, if we wan 't to read PEM files which contains human readable273 * However, if we want to read PEM files which contains human readable 274 274 * certificate details before or after each base-64 section, we can't stick 275 275 * to 7-bit ASCII. We could say it must be UTF-8, but that's probably to 276 * limited too. So, we'll settle for detecting binary files by control276 * limited as well. So, we'll settle for detecting binary files by control 277 277 * characters alone (safe enough for DER encoded stuff, I think). 278 278 */ … … 435 435 436 436 437 438 437 RTDECL(int) RTCrPemReadFile(const char *pszFilename, uint32_t fFlags, PCRTCRPEMMARKER paMarkers, size_t cMarkers, 439 438 PCRTCRPEMSECTION *ppSectionHead, PRTERRINFO pErrInfo) … … 455 454 } 456 455 456 457 RTDECL(const char *) RTCrPemFindFirstSectionInContent(void const *pvContent, size_t cbContent, 458 PCRTCRPEMMARKER paMarkers, size_t cMarkers) 459 { 460 size_t offBegin; 461 if (rtCrPemFindMarker((uint8_t *)pvContent, cbContent, 0, "BEGIN", 5, paMarkers, cMarkers, NULL, &offBegin, NULL)) 462 return (const char *)pvContent + offBegin; 463 return NULL; 464 } -
trunk/src/VBox/Runtime/common/crypto/x509-file.cpp
r59620 r59625 43 43 static RTCRPEMMARKERWORD const g_aWords_Certificate[] = { { RT_STR_TUPLE("CERTIFICATE") } }; 44 44 /** X509 Certificate markers. */ 45 static RTCRPEMMARKER const g_aCertificateMarkers[] = { { g_aWords_Certificate, RT_ELEMENTS(g_aWords_Certificate) } }; 45 RT_DECL_DATA_CONST(RTCRPEMMARKER const) g_aRTCrX509CertificateMarkers[] = 46 { 47 { g_aWords_Certificate, RT_ELEMENTS(g_aWords_Certificate) } 48 }; 49 /** Number of entries in g_aRTCrX509CertificateMarkers. */ 50 RT_DECL_DATA_CONST(uint32_t const) g_cRTCrX509CertificateMarkers = RT_ELEMENTS(g_aRTCrX509CertificateMarkers); 46 51 47 52 … … 51 56 AssertReturn(!fFlags, VERR_INVALID_FLAGS); 52 57 PCRTCRPEMSECTION pSectionHead; 53 int rc = RTCrPemReadFile(pszFilename, 0, g_aCertificateMarkers, RT_ELEMENTS(g_aCertificateMarkers), &pSectionHead, pErrInfo); 58 int rc = RTCrPemReadFile(pszFilename, 0, g_aRTCrX509CertificateMarkers, g_cRTCrX509CertificateMarkers, 59 &pSectionHead, pErrInfo); 54 60 if (RT_SUCCESS(rc)) 55 61 { … … 85 91 AssertReturn(!fFlags, VERR_INVALID_FLAGS); 86 92 PCRTCRPEMSECTION pSectionHead; 87 int rc = RTCrPemParseContent(pvBuf, cbBuf, 0, g_a CertificateMarkers, RT_ELEMENTS(g_aCertificateMarkers),93 int rc = RTCrPemParseContent(pvBuf, cbBuf, 0, g_aRTCrX509CertificateMarkers, g_cRTCrX509CertificateMarkers, 88 94 &pSectionHead, pErrInfo); 89 95 if (RT_SUCCESS(rc)) … … 121 127 AssertReturn(!fFlags, VERR_INVALID_FLAGS); 122 128 PCRTCRPEMSECTION pSectionHead; 123 int rc = RTCrPemReadFile(pszFilename, 0, g_aCertificateMarkers, RT_ELEMENTS(g_aCertificateMarkers), &pSectionHead, pErrInfo); 129 int rc = RTCrPemReadFile(pszFilename, 0, g_aRTCrX509CertificateMarkers, g_cRTCrX509CertificateMarkers, 130 &pSectionHead, pErrInfo); 124 131 if (RT_SUCCESS(rc)) 125 132 {
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器