summaryrefslogtreecommitdiff
path: root/src/VBox/Runtime/common/checksum
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/Runtime/common/checksum')
-rw-r--r--src/VBox/Runtime/common/checksum/RTSha256Digest.cpp201
-rw-r--r--src/VBox/Runtime/common/checksum/adler32.cpp2
-rw-r--r--src/VBox/Runtime/common/checksum/crc32-zlib.cpp2
-rw-r--r--src/VBox/Runtime/common/checksum/crc32.cpp2
-rw-r--r--src/VBox/Runtime/common/checksum/crc64.cpp2
-rw-r--r--src/VBox/Runtime/common/checksum/ipv4.cpp2
-rw-r--r--src/VBox/Runtime/common/checksum/ipv6.cpp2
-rw-r--r--src/VBox/Runtime/common/checksum/manifest.cpp107
-rw-r--r--src/VBox/Runtime/common/checksum/manifest2.cpp2
-rw-r--r--src/VBox/Runtime/common/checksum/manifest3.cpp2
-rw-r--r--src/VBox/Runtime/common/checksum/md5.cpp8
-rw-r--r--src/VBox/Runtime/common/checksum/md5str.cpp2
-rw-r--r--src/VBox/Runtime/common/checksum/sha1.cpp2
-rw-r--r--src/VBox/Runtime/common/checksum/sha1str.cpp2
-rw-r--r--src/VBox/Runtime/common/checksum/sha256.cpp2
-rw-r--r--src/VBox/Runtime/common/checksum/sha256str.cpp2
-rw-r--r--src/VBox/Runtime/common/checksum/sha512.cpp2
-rw-r--r--src/VBox/Runtime/common/checksum/sha512str.cpp2
18 files changed, 312 insertions, 34 deletions
diff --git a/src/VBox/Runtime/common/checksum/RTSha256Digest.cpp b/src/VBox/Runtime/common/checksum/RTSha256Digest.cpp
new file mode 100644
index 00000000..5b8679c4
--- /dev/null
+++ b/src/VBox/Runtime/common/checksum/RTSha256Digest.cpp
@@ -0,0 +1,201 @@
+/** @file
+ * IPRT - SHA256 digest creation
+ */
+
+/*
+ * Copyright (C) 2009-2013 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*******************************************************************************
+* Header Files *
+*******************************************************************************/
+#include "internal/iprt.h"
+#include <iprt/sha.h>
+
+#include <iprt/alloca.h>
+#include <iprt/assert.h>
+#include <iprt/mem.h>
+#include <iprt/string.h>
+#include <iprt/file.h>
+
+#include <openssl/sha.h>
+
+
+RTR3DECL(int) RTSha256Digest(void* pvBuf, size_t cbBuf, char **ppszDigest, PFNRTPROGRESS pfnProgressCallback, void *pvUser)
+{
+ /* Validate input */
+ AssertPtrReturn(pvBuf, VERR_INVALID_POINTER);
+ AssertPtrReturn(ppszDigest, VERR_INVALID_POINTER);
+ AssertPtrNullReturn(pfnProgressCallback, VERR_INVALID_PARAMETER);
+
+ int rc = VINF_SUCCESS;
+ *ppszDigest = NULL;
+
+ /* Initialize OpenSSL. */
+ SHA256_CTX ctx;
+ if (!SHA256_Init(&ctx))
+ return VERR_INTERNAL_ERROR;
+
+ /* Buffer size for progress callback */
+ double rdMulti = 100.0 / cbBuf;
+
+ /* Working buffer */
+ char *pvTmp = (char*)pvBuf;
+
+ /* Process the memory in blocks */
+ size_t cbRead;
+ size_t cbReadTotal = 0;
+ for (;;)
+ {
+ cbRead = RT_MIN(cbBuf - cbReadTotal, _1M);
+ if(!SHA256_Update(&ctx, pvTmp, cbRead))
+ {
+ rc = VERR_INTERNAL_ERROR;
+ break;
+ }
+ cbReadTotal += cbRead;
+ pvTmp += cbRead;
+
+ /* Call the progress callback if one is defined */
+ if (pfnProgressCallback)
+ {
+ rc = pfnProgressCallback((unsigned)(cbReadTotal * rdMulti), pvUser);
+ if (RT_FAILURE(rc))
+ break; /* canceled */
+ }
+ /* Finished? */
+ if (cbReadTotal == cbBuf)
+ break;
+ }
+ if (RT_SUCCESS(rc))
+ {
+ /* Finally calculate & format the SHA256 sum */
+ unsigned char auchDig[RTSHA256_HASH_SIZE];
+ if (!SHA256_Final(auchDig, &ctx))
+ return VERR_INTERNAL_ERROR;
+
+ char *pszDigest;
+ rc = RTStrAllocEx(&pszDigest, RTSHA256_DIGEST_LEN + 1);
+ if (RT_SUCCESS(rc))
+ {
+ rc = RTSha256ToString(auchDig, pszDigest, RTSHA256_DIGEST_LEN + 1);
+ if (RT_SUCCESS(rc))
+ *ppszDigest = pszDigest;
+ else
+ RTStrFree(pszDigest);
+ }
+ }
+
+ return rc;
+}
+
+RTR3DECL(int) RTSha256DigestFromFile(const char *pszFile, char **ppszDigest, PFNRTPROGRESS pfnProgressCallback, void *pvUser)
+{
+ /* Validate input */
+ AssertPtrReturn(pszFile, VERR_INVALID_POINTER);
+ AssertPtrReturn(ppszDigest, VERR_INVALID_POINTER);
+ AssertPtrNullReturn(pfnProgressCallback, VERR_INVALID_PARAMETER);
+
+ *ppszDigest = NULL;
+
+ /* Initialize OpenSSL. */
+ SHA256_CTX ctx;
+ if (!SHA256_Init(&ctx))
+ return VERR_INTERNAL_ERROR;
+
+ /* Open the file to calculate a SHA256 sum of */
+ RTFILE hFile;
+ int rc = RTFileOpen(&hFile, pszFile, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE);
+ if (RT_FAILURE(rc))
+ return rc;
+
+ /* Fetch the file size. Only needed if there is a progress callback. */
+ double rdMulti = 0;
+ if (pfnProgressCallback)
+ {
+ uint64_t cbFile;
+ rc = RTFileGetSize(hFile, &cbFile);
+ if (RT_FAILURE(rc))
+ {
+ RTFileClose(hFile);
+ return rc;
+ }
+ rdMulti = 100.0 / cbFile;
+ }
+
+ /* Allocate a reasonably large buffer, fall back on a tiny one. */
+ void *pvBufFree;
+ size_t cbBuf = _1M;
+ void *pvBuf = pvBufFree = RTMemTmpAlloc(cbBuf);
+ if (!pvBuf)
+ {
+ cbBuf = 0x1000;
+ pvBuf = alloca(cbBuf);
+ }
+
+ /* Read that file in blocks */
+ size_t cbRead;
+ size_t cbReadTotal = 0;
+ for (;;)
+ {
+ rc = RTFileRead(hFile, pvBuf, cbBuf, &cbRead);
+ if (RT_FAILURE(rc) || !cbRead)
+ break;
+ if(!SHA256_Update(&ctx, pvBuf, cbRead))
+ {
+ rc = VERR_INTERNAL_ERROR;
+ break;
+ }
+ cbReadTotal += cbRead;
+
+ /* Call the progress callback if one is defined */
+ if (pfnProgressCallback)
+ {
+ rc = pfnProgressCallback((unsigned)(cbReadTotal * rdMulti), pvUser);
+ if (RT_FAILURE(rc))
+ break; /* canceled */
+ }
+ }
+ RTMemTmpFree(pvBufFree);
+ RTFileClose(hFile);
+
+ if (RT_FAILURE(rc))
+ return rc;
+
+ /* Finally calculate & format the SHA256 sum */
+ unsigned char auchDig[RTSHA256_HASH_SIZE];
+ if (!SHA256_Final(auchDig, &ctx))
+ return VERR_INTERNAL_ERROR;
+
+ char *pszDigest;
+ rc = RTStrAllocEx(&pszDigest, RTSHA256_DIGEST_LEN + 1);
+ if (RT_SUCCESS(rc))
+ {
+ rc = RTSha256ToString(auchDig, pszDigest, RTSHA256_DIGEST_LEN + 1);
+ if (RT_SUCCESS(rc))
+ *ppszDigest = pszDigest;
+ else
+ RTStrFree(pszDigest);
+ }
+
+ return rc;
+}
+
diff --git a/src/VBox/Runtime/common/checksum/adler32.cpp b/src/VBox/Runtime/common/checksum/adler32.cpp
index d9e54985..5ab8a55f 100644
--- a/src/VBox/Runtime/common/checksum/adler32.cpp
+++ b/src/VBox/Runtime/common/checksum/adler32.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2009 Oracle Corporation
+ * Copyright (C) 2009-2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
diff --git a/src/VBox/Runtime/common/checksum/crc32-zlib.cpp b/src/VBox/Runtime/common/checksum/crc32-zlib.cpp
index 650a959b..0ba474b3 100644
--- a/src/VBox/Runtime/common/checksum/crc32-zlib.cpp
+++ b/src/VBox/Runtime/common/checksum/crc32-zlib.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2009 Oracle Corporation
+ * Copyright (C) 2009-2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
diff --git a/src/VBox/Runtime/common/checksum/crc32.cpp b/src/VBox/Runtime/common/checksum/crc32.cpp
index c43b2cbb..0ea4f092 100644
--- a/src/VBox/Runtime/common/checksum/crc32.cpp
+++ b/src/VBox/Runtime/common/checksum/crc32.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2006-2009 Oracle Corporation
+ * Copyright (C) 2006-2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
diff --git a/src/VBox/Runtime/common/checksum/crc64.cpp b/src/VBox/Runtime/common/checksum/crc64.cpp
index 74c60070..0904031f 100644
--- a/src/VBox/Runtime/common/checksum/crc64.cpp
+++ b/src/VBox/Runtime/common/checksum/crc64.cpp
@@ -9,7 +9,7 @@
*/
/*
- * Copyright (C) 2006-2007 Oracle Corporation
+ * Copyright (C) 2006-2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
diff --git a/src/VBox/Runtime/common/checksum/ipv4.cpp b/src/VBox/Runtime/common/checksum/ipv4.cpp
index c757be21..0200e744 100644
--- a/src/VBox/Runtime/common/checksum/ipv4.cpp
+++ b/src/VBox/Runtime/common/checksum/ipv4.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2008 Oracle Corporation
+ * Copyright (C) 2008-2011 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
diff --git a/src/VBox/Runtime/common/checksum/ipv6.cpp b/src/VBox/Runtime/common/checksum/ipv6.cpp
index d33438a0..3364d19f 100644
--- a/src/VBox/Runtime/common/checksum/ipv6.cpp
+++ b/src/VBox/Runtime/common/checksum/ipv6.cpp
@@ -60,7 +60,7 @@ DECLINLINE(uint32_t) rtNetIPv6PseudoChecksumBits(PCRTNETADDRIPV6 pSrcAddr, PCRTN
+ RT_H2BE_U16(RT_HIWORD(cbPkt))
+ RT_H2BE_U16(RT_LOWORD(cbPkt))
+ 0
- + RT_H2BE_U16(RT_MAKE_U16(0, bProtocol));
+ + RT_H2BE_U16(RT_MAKE_U16(bProtocol, 0));
return u32Sum;
}
diff --git a/src/VBox/Runtime/common/checksum/manifest.cpp b/src/VBox/Runtime/common/checksum/manifest.cpp
index b16a8f6a..77d4d039 100644
--- a/src/VBox/Runtime/common/checksum/manifest.cpp
+++ b/src/VBox/Runtime/common/checksum/manifest.cpp
@@ -1,10 +1,10 @@
/* $Id: manifest.cpp $ */
/** @file
- * IPRT - Manifest file handling.
+ * IPRT - Manifest file handling, old style - deprecated.
*/
/*
- * Copyright (C) 2009 Oracle Corporation
+ * Copyright (C) 2009-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -66,6 +66,7 @@ typedef struct RTMANIFESTCALLBACKDATA
} RTMANIFESTCALLBACKDATA;
typedef RTMANIFESTCALLBACKDATA* PRTMANIFESTCALLBACKDATA;
+
/*******************************************************************************
* Private functions
*******************************************************************************/
@@ -96,6 +97,7 @@ int rtSHAProgressCallback(unsigned uPercent, void *pvUser)
pData->pvUser);
}
+
/*******************************************************************************
* Public functions
*******************************************************************************/
@@ -252,10 +254,13 @@ RTR3DECL(int) RTManifestWriteFiles(const char *pszManifestFile, RTDIGESTTYPE enm
/* Cleanup */
if (pvBuf)
RTMemFree(pvBuf);
- for (size_t i = 0; i < cFiles; ++i)
- if (paFiles[i].pszTestDigest)
- RTStrFree((char*)paFiles[i].pszTestDigest);
- RTMemFree(paFiles);
+ if (paFiles)
+ {
+ for (size_t i = 0; i < cFiles; ++i)
+ if (paFiles[i].pszTestDigest)
+ RTStrFree((char*)paFiles[i].pszTestDigest);
+ RTMemFree(paFiles);
+ }
/* Delete the manifest file on failure */
if (RT_FAILURE(rc))
@@ -264,6 +269,67 @@ RTR3DECL(int) RTManifestWriteFiles(const char *pszManifestFile, RTDIGESTTYPE enm
return rc;
}
+
+RTR3DECL(int) RTManifestVerifyDigestType(void const *pvBuf, size_t cbSize, RTDIGESTTYPE *penmDigestType)
+{
+ /* Validate input */
+ AssertPtrReturn(pvBuf, VERR_INVALID_POINTER);
+ AssertReturn(cbSize > 0, VERR_INVALID_PARAMETER);
+ AssertPtrReturn(penmDigestType, VERR_INVALID_POINTER);
+
+ int rc = VINF_SUCCESS;
+
+ char const *pcBuf = (char *)pvBuf;
+ size_t cbRead = 0;
+ /* Parse the manifest file line by line */
+ for (;;)
+ {
+ if (cbRead >= cbSize)
+ return VERR_MANIFEST_UNSUPPORTED_DIGEST_TYPE;
+
+ size_t cch = rtManifestIndexOfCharInBuf(pcBuf, cbSize - cbRead, '\n') + 1;
+
+ /* Skip empty lines (UNIX/DOS format) */
+ if ( ( cch == 1
+ && pcBuf[0] == '\n')
+ || ( cch == 2
+ && pcBuf[0] == '\r'
+ && pcBuf[1] == '\n'))
+ {
+ pcBuf += cch;
+ cbRead += cch;
+ continue;
+ }
+
+/** @todo r=bird: Missing space check here. */
+ /* Check for the digest algorithm */
+ if ( pcBuf[0] == 'S'
+ && pcBuf[1] == 'H'
+ && pcBuf[2] == 'A'
+ && pcBuf[3] == '1')
+ {
+ *penmDigestType = RTDIGESTTYPE_SHA1;
+ break;
+ }
+ if ( pcBuf[0] == 'S'
+ && pcBuf[1] == 'H'
+ && pcBuf[2] == 'A'
+ && pcBuf[3] == '2'
+ && pcBuf[4] == '5'
+ && pcBuf[5] == '6')
+ {
+ *penmDigestType = RTDIGESTTYPE_SHA256;
+ break;
+ }
+
+ pcBuf += cch;
+ cbRead += cch;
+ }
+
+ return rc;
+}
+
+
RTR3DECL(int) RTManifestVerifyFilesBuf(void *pvBuf, size_t cbSize, PRTMANIFESTTEST paTests, size_t cTests, size_t *piFailed)
{
/* Validate input */
@@ -307,7 +373,7 @@ RTR3DECL(int) RTManifestVerifyFilesBuf(void *pvBuf, size_t cbSize, PRTMANIFESTTE
/** @todo r=bird:
* -# Better deal with this EOF line platform dependency
- * -# The SHA1 test should probably include a blank space check.
+ * -# The SHA1 and SHA256 tests should probably include a blank space check.
* -# If there is a specific order to the elements in the string, it would be
* good if the delimiter searching checked for it.
* -# Deal with filenames containing delimiter characters.
@@ -315,10 +381,19 @@ RTR3DECL(int) RTManifestVerifyFilesBuf(void *pvBuf, size_t cbSize, PRTMANIFESTTE
/* Check for the digest algorithm */
if ( cch < 4
- || !( pcBuf[0] == 'S'
- && pcBuf[1] == 'H'
- && pcBuf[2] == 'A'
- && pcBuf[3] == '1'))
+ || ( !( pcBuf[0] == 'S'
+ && pcBuf[1] == 'H'
+ && pcBuf[2] == 'A'
+ && pcBuf[3] == '1')
+ &&
+ !( pcBuf[0] == 'S'
+ && pcBuf[1] == 'H'
+ && pcBuf[2] == 'A'
+ && pcBuf[3] == '2'
+ && pcBuf[4] == '5'
+ && pcBuf[5] == '6')
+ )
+ )
{
/* Digest unsupported */
rc = VERR_MANIFEST_UNSUPPORTED_DIGEST_TYPE;
@@ -363,6 +438,7 @@ RTR3DECL(int) RTManifestVerifyFilesBuf(void *pvBuf, size_t cbSize, PRTMANIFESTTE
pszDigestEnd = rtManifestPosOfCharInBuf(pcBuf, cch, '\n');
if (!pszDigestEnd)
{
+ RTMemTmpFree(pszName);
rc = VERR_MANIFEST_WRONG_FILE_FORMAT;
break;
}
@@ -371,6 +447,7 @@ RTR3DECL(int) RTManifestVerifyFilesBuf(void *pvBuf, size_t cbSize, PRTMANIFESTTE
char *pszDigest = (char *)RTMemTmpAlloc(cchDigest + 1);
if (!pszDigest)
{
+ RTMemTmpFree(pszName);
rc = VERR_NO_MEMORY;
break;
}
@@ -381,7 +458,8 @@ RTR3DECL(int) RTManifestVerifyFilesBuf(void *pvBuf, size_t cbSize, PRTMANIFESTTE
bool fFound = false;
for (size_t i = 0; i < cTests; ++i)
{
- if (!RTStrCmp(RTPathFilename(paFiles[i].pTestPattern->pszTestFile), RTStrStrip(pszName)))
+ /** @todo r=bird: Using RTStrStr here looks bogus. */
+ if (RTStrStr(paFiles[i].pTestPattern->pszTestFile, RTStrStrip(pszName)) != NULL)
{
/* Add the data of the manifest file to the file list */
paFiles[i].pszManifestFile = RTStrDup(RTStrStrip(pszName));
@@ -418,7 +496,7 @@ RTR3DECL(int) RTManifestVerifyFilesBuf(void *pvBuf, size_t cbSize, PRTMANIFESTTE
break;
}
- /* Do the manifest SHA1 digest match against the actual digest? */
+ /* Do the manifest SHA digest match against the actual digest? */
if (RTStrICmp(paFiles[i].pszManifestDigest, paFiles[i].pTestPattern->pszTestDigest))
{
if (piFailed)
@@ -439,7 +517,6 @@ RTR3DECL(int) RTManifestVerifyFilesBuf(void *pvBuf, size_t cbSize, PRTMANIFESTTE
}
RTMemTmpFree(paFiles);
- RTPrintf("rc = %Rrc\n", rc);
return rc;
}
@@ -468,7 +545,7 @@ RTR3DECL(int) RTManifestWriteFilesBuf(void **ppvBuf, size_t *pcbSize, RTDIGESTTY
for (size_t i = 0; i < cFiles; ++i)
{
size_t cbTmp = strlen(RTPathFilename(paFiles[i].pszTestFile))
- + strlen(paFiles[i].pszTestDigest)
+ + strlen(paFiles[i].pszTestDigest)
+ strlen(pcszDigestType)
+ 6;
cbMaxSize = RT_MAX(cbMaxSize, cbTmp);
diff --git a/src/VBox/Runtime/common/checksum/manifest2.cpp b/src/VBox/Runtime/common/checksum/manifest2.cpp
index a6450627..84cdb039 100644
--- a/src/VBox/Runtime/common/checksum/manifest2.cpp
+++ b/src/VBox/Runtime/common/checksum/manifest2.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2010 Oracle Corporation
+ * Copyright (C) 2010-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
diff --git a/src/VBox/Runtime/common/checksum/manifest3.cpp b/src/VBox/Runtime/common/checksum/manifest3.cpp
index c0b5e855..9ff67f23 100644
--- a/src/VBox/Runtime/common/checksum/manifest3.cpp
+++ b/src/VBox/Runtime/common/checksum/manifest3.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2010 Oracle Corporation
+ * Copyright (C) 2010-2011 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
diff --git a/src/VBox/Runtime/common/checksum/md5.cpp b/src/VBox/Runtime/common/checksum/md5.cpp
index 0bd8afb6..05aff4a0 100644
--- a/src/VBox/Runtime/common/checksum/md5.cpp
+++ b/src/VBox/Runtime/common/checksum/md5.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2006-2007 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -30,7 +30,7 @@
/*
* This code implements the MD5 message-digest algorithm.
- * The algorithm is due to Ron Rivest. This code was
+ * The algorithm is due to Ron Rivest. This code was
* written by Colin Plumb in 1993, no copyright is claimed.
* This code is in the public domain; do with it what you wish.
*
@@ -51,7 +51,7 @@
#include <iprt/md5.h>
#include "internal/iprt.h"
-#include <iprt/string.h> /* for memcpy() */
+#include <iprt/string.h> /* for memcpy() */
#if defined(RT_BIG_ENDIAN)
# include <iprt/asm.h> /* RT_LE2H_U32 uses ASMByteSwapU32. */
#endif
@@ -239,7 +239,7 @@ RTDECL(void) RTMd5Update(PRTMD5CONTEXT ctx, const void *pvBuf, size_t len)
ctx->bits[1]++; /* Carry from low to high */
ctx->bits[1] += (uint32_t)(len >> 29);
- t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */
+ t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */
/* Handle any leading odd-sized chunks */
if (t)
diff --git a/src/VBox/Runtime/common/checksum/md5str.cpp b/src/VBox/Runtime/common/checksum/md5str.cpp
index 40dbb8ba..288d6eb7 100644
--- a/src/VBox/Runtime/common/checksum/md5str.cpp
+++ b/src/VBox/Runtime/common/checksum/md5str.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2009 Oracle Corporation
+ * Copyright (C) 2009-2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
diff --git a/src/VBox/Runtime/common/checksum/sha1.cpp b/src/VBox/Runtime/common/checksum/sha1.cpp
index e448a479..9db75a2b 100644
--- a/src/VBox/Runtime/common/checksum/sha1.cpp
+++ b/src/VBox/Runtime/common/checksum/sha1.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2009 Oracle Corporation
+ * Copyright (C) 2009-2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
diff --git a/src/VBox/Runtime/common/checksum/sha1str.cpp b/src/VBox/Runtime/common/checksum/sha1str.cpp
index 730d0bee..22261034 100644
--- a/src/VBox/Runtime/common/checksum/sha1str.cpp
+++ b/src/VBox/Runtime/common/checksum/sha1str.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2009 Oracle Corporation
+ * Copyright (C) 2009-2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
diff --git a/src/VBox/Runtime/common/checksum/sha256.cpp b/src/VBox/Runtime/common/checksum/sha256.cpp
index c78e22e2..da2a70ed 100644
--- a/src/VBox/Runtime/common/checksum/sha256.cpp
+++ b/src/VBox/Runtime/common/checksum/sha256.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2009 Oracle Corporation
+ * Copyright (C) 2009-2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
diff --git a/src/VBox/Runtime/common/checksum/sha256str.cpp b/src/VBox/Runtime/common/checksum/sha256str.cpp
index 43e668e1..4ca92a2e 100644
--- a/src/VBox/Runtime/common/checksum/sha256str.cpp
+++ b/src/VBox/Runtime/common/checksum/sha256str.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2009 Oracle Corporation
+ * Copyright (C) 2009-2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
diff --git a/src/VBox/Runtime/common/checksum/sha512.cpp b/src/VBox/Runtime/common/checksum/sha512.cpp
index ee38f368..570c0a7e 100644
--- a/src/VBox/Runtime/common/checksum/sha512.cpp
+++ b/src/VBox/Runtime/common/checksum/sha512.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2009 Oracle Corporation
+ * Copyright (C) 2009-2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
diff --git a/src/VBox/Runtime/common/checksum/sha512str.cpp b/src/VBox/Runtime/common/checksum/sha512str.cpp
index 13373421..5329f4d2 100644
--- a/src/VBox/Runtime/common/checksum/sha512str.cpp
+++ b/src/VBox/Runtime/common/checksum/sha512str.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2009 Oracle Corporation
+ * Copyright (C) 2009-2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;