VirtualBox

Ticket #17357 (new defect)

Opened 4 months ago

Last modified 7 weeks ago

Import OVF fails with Digest mismatch (VERR_NOT_EQUAL): Attribute 'SHA1'

Reported by: MarcT Owned by:
Priority: major Component: OVF
Version: VirtualBox 5.2.0 Keywords: Digest mismatch VERR_NOT_EQUAL SHA1
Cc: Guest type: Linux
Host type: Linux

Description

It seems the SHA1 digest check is case sensitive when it should not be. Importing an OVF created by VMware ovftool 3.5.0.

Actual error:

Digest mismatch (VERR_NOT_EQUAL): Attribute 'SHA1' on 'XXXXXXX.ovf' does not match ('3E6C3CD5F4813E5058F2CB9AC50F9636B9D92D2F' vs. '3e6c3cd5f4813e5058f2cb9ac50f9636b9d92d2f').

Result Code: VBOX_E_FILE_ERROR (0x80BB0004) Component: ApplianceWrap Interface: IAppliance {8398f026-4add-4474-5bc3-2f9f2140b23e}

Change History

comment:1 Changed 4 months ago by socratis

comment:2 Changed 7 weeks ago by MarcT

So, I did some digging and came up with a rough patch which might solve this issue. The problem is that I can't easily test it here, as I don't have Qt5 libs (my system is using Qt4.8.7). I normally just use the pre-built VirtualBox binaries.

The patch changes all attribute matches to be case insensitive. That may not be ideal (I don't know), so some refinement may be required to check whether it's a SHA1 attribute (or other hash).

Interestingly the same issue seems to occur in VMWare ESXi 6.5 (but not 6.0).

Anyway, here's the "potential patch":

--- ./src/VBox/Runtime/common/checksum/manifest2.cpp.orig       2018-01-15 14:56:05.000000000 +0000
+++ ./src/VBox/Runtime/common/checksum/manifest2.cpp    2018-02-08 19:15:50.258686659 +0000
@@ -469,7 +469,7 @@
     /*
      * Compare them.
      */
-    if (strcmp(pAttr1->pszValue, pAttr2->pszValue))
+    if (strcasecmp(pAttr1->pszValue, pAttr2->pszValue))
     {
         if (*pEquals->pszCurEntry)
             RTStrPrintf(pEquals->pszError, pEquals->cbError,

comment:3 Changed 7 weeks ago by socratis

MarcT, I have replied to you in the forums, not sure if you've subscribed to the topic or not...

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use