VirtualBox

Ignore:
Timestamp:
Feb 10, 2016 8:55:22 AM (9 years ago)
Author:
vboxsync
Message:

IPRT: Added RTCrPemFindFirstSectionInContent and exposed certificate PEM markers (g_aRTCrX509CertificateMarkers).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/crypto/x509-file.cpp

    r59620 r59625  
    4343static RTCRPEMMARKERWORD const g_aWords_Certificate[]  = { { RT_STR_TUPLE("CERTIFICATE") } };
    4444/** X509 Certificate markers. */
    45 static RTCRPEMMARKER     const g_aCertificateMarkers[] = { { g_aWords_Certificate, RT_ELEMENTS(g_aWords_Certificate) } };
     45RT_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. */
     50RT_DECL_DATA_CONST(uint32_t const) g_cRTCrX509CertificateMarkers = RT_ELEMENTS(g_aRTCrX509CertificateMarkers);
    4651
    4752
     
    5156    AssertReturn(!fFlags, VERR_INVALID_FLAGS);
    5257    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);
    5460    if (RT_SUCCESS(rc))
    5561    {
     
    8591    AssertReturn(!fFlags, VERR_INVALID_FLAGS);
    8692    PCRTCRPEMSECTION pSectionHead;
    87     int rc = RTCrPemParseContent(pvBuf, cbBuf, 0, g_aCertificateMarkers, RT_ELEMENTS(g_aCertificateMarkers),
     93    int rc = RTCrPemParseContent(pvBuf, cbBuf, 0, g_aRTCrX509CertificateMarkers, g_cRTCrX509CertificateMarkers,
    8894                                 &pSectionHead, pErrInfo);
    8995    if (RT_SUCCESS(rc))
     
    121127    AssertReturn(!fFlags, VERR_INVALID_FLAGS);
    122128    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);
    124131    if (RT_SUCCESS(rc))
    125132    {
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