VirtualBox

Changeset 33062 in vbox


Ignore:
Timestamp:
Oct 12, 2010 12:47:12 PM (14 years ago)
Author:
vboxsync
Message:

Main-OVF: use RTSHA1CONTEXT instead of SHA_CTX

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ApplianceImplIO.cpp

    r33060 r33062  
    3232#include <iprt/stream.h>
    3333#include <VBox/VBoxHDD.h>
    34 
    35 #include <openssl/sha.h>
    3634
    3735/******************************************************************************
     
    8482    RTSEMEVENT calcFinishedEvent;
    8583    /** SHA1 calculation context. */
    86     SHA_CTX ctx;
     84    RTSHA1CONTEXT ctx;
    8785} SHA1STORAGEINTERNAL, *PSHA1STORAGEINTERNAL;
    8886
     
    441439            {
    442440                /* Update the SHA1 context with the next data block. */
    443                 if(!SHA1_Update(&pInt->ctx, pInt->pcBuf, pInt->cbCurBuf))
    444                 {
    445                     rc = VERR_INTERNAL_ERROR;
    446                     fLoop = false;
    447                 }
     441                RTSha1Update(&pInt->ctx, pInt->pcBuf, pInt->cbCurBuf);
    448442                /* Reset the thread status and signal the main thread that we
    449443                   are finished. */
     
    569563        {
    570564            /* Create a sha1 context the sha1 worker thread will work with. */
    571             if (!SHA1_Init(&pInt->ctx))
    572             {
    573                 rc = VERR_INTERNAL_ERROR;
    574                 break;
    575             }
     565            RTSha1Init(&pInt->ctx);
    576566            /* Create an event semaphore to indicate a state change for the sha1
    577567               worker thread. */
     
    651641        unsigned char auchDig[RTSHA1_HASH_SIZE];
    652642        char *pszDigest;
    653         if (!SHA1_Final(auchDig, &pInt->ctx))
    654             rc = VERR_INTERNAL_ERROR;
     643        RTSha1Final(&pInt->ctx, auchDig);
    655644        rc = RTStrAllocEx(&pszDigest, RTSHA1_DIGEST_LEN + 1);
    656645        if (RT_SUCCESS(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