VirtualBox

Changeset 74094 in vbox for trunk/src


Ignore:
Timestamp:
Sep 5, 2018 9:03:06 PM (6 years ago)
Author:
vboxsync
Message:

IPRT/http: Fixed two bugs in RTHttpSignHeaders, adding a testcase for it. bugref:9167

Location:
trunk/src/VBox/Runtime
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/generic/http-curl.cpp

    r74091 r74094  
    23002300    static const char s_szRequestField[] = "(request-target)";
    23012301    size_t const      cchKeyId           = strlen(pszKeyId);
    2302     size_t const      cbSigRaw           = (RTCrKeyGetBitCount(hKey) + 8) / 8; /** @todo ?? */
     2302    size_t const      cbSigRaw           = (RTCrKeyGetBitCount(hKey) + 7) / 8;
    23032303    size_t const      cbSigRawAligned    = RT_ALIGN_Z(cbSigRaw, 8);
    23042304    size_t const      cchSigStr          = RTBase64EncodedLengthEx(cbSigRaw, RTBASE64_FLAGS_NO_LINE_BREAKS);
     
    23372337        Assert(cbLeft > sizeof(s_szRequestField));
    23382338        memcpy(pszLeft, RT_STR_TUPLE(s_szRequestField));
    2339         pszLeft += sizeof(s_szRequestField);
     2339        pszLeft += sizeof(s_szRequestField) - 1;
    23402340
    23412341        rc = RTCrDigestUpdate(hDigest, RT_STR_TUPLE(s_szRequestField));
     
    23532353        {
    23542354            AssertBreakStmt(cbLeft > pCur->cchName, rc = VERR_INTERNAL_ERROR_3);
     2355            *pszLeft++ = ' ';
     2356            cbLeft--;
    23552357            memcpy(pszLeft, pCur->szData, pCur->cchName);
    23562358            pszLeft[pCur->cchName] = '\0';
     
    23682370
    23692371            pszLeft += pCur->cchName;
    2370             cbLeft -= pCur->cchName;
     2372            cbLeft  -= pCur->cchName;
    23712373        }
    23722374        if (RT_SUCCESS(rc))
  • trunk/src/VBox/Runtime/testcase/Makefile.kmk

    r73665 r74094  
    174174ifdef VBOX_WITH_LIBCURL
    175175 PROGRAMS += \
    176         tstRTHttp \
     176        tstRTHttp-1 \
    177177        tstRTS3
    178178endif
     
    318318
    319319ifdef VBOX_WITH_LIBCURL
    320 tstRTHttp_TEMPLATE = VBOXR3TSTEXE
    321 tstRTHttp_SOURCES = tstRTHttp.cpp
    322 tstRTHttp_SDKS = VBOX_LIBCURL
     320tstRTHttp-1_TEMPLATE = VBOXR3TSTEXE
     321tstRTHttp-1_SOURCES = tstRTHttp-1.cpp
     322tstRTHttp-1_SDKS = VBOX_LIBCURL
    323323endif
    324324
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