VirtualBox

Changeset 29778 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 25, 2010 11:56:36 AM (15 years ago)
Author:
vboxsync
Message:

Runtime: Use RTSha1ToString cause the old method used the wrong formater anyway.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/checksum/RTSha1Digest.cpp

    r28800 r29778  
    3636#include <iprt/stream.h>
    3737#include <iprt/string.h>
     38#include <iprt/mem.h>
    3839
    3940#include <openssl/sha.h>
     
    8990        return VERR_INTERNAL_ERROR;
    9091
    91     int cch = RTStrAPrintf(ppszDigest, "%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x",
    92                            auchDig[0] , auchDig[1] , auchDig[2] , auchDig[3] , auchDig[4],
    93                            auchDig[5] , auchDig[6] , auchDig[7] , auchDig[8] , auchDig[9],
    94                            auchDig[10], auchDig[11], auchDig[12], auchDig[13], auchDig[14],
    95                            auchDig[15], auchDig[16], auchDig[17], auchDig[18], auchDig[19]);
    96     if (RT_UNLIKELY(cch == -1))
    97         rc = VERR_INTERNAL_ERROR;
     92    *ppszDigest = (char*)RTMemAlloc(41);
     93    rc = RTSha1ToString(auchDig, *ppszDigest, 41);
     94    if (RT_FAILURE(rc))
     95        RTStrFree(*ppszDigest);
    9896
    9997    return rc;
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