Digest mismatch (VERR_NOT_EQUAL) with correct file (#17357)

This is for discussing general topics about how to use VirtualBox.
SergeyBelov
Posts: 3
Joined: 6. Sep 2016, 21:15

Digest mismatch (VERR_NOT_EQUAL) with correct file (#17357)

Post by SergeyBelov »


[ModEdit; related ticket: #17357: Import OVF fails with Digest mismatch (VERR_NOT_EQUAL): Attribute 'SHA1']
I get an error when importing OVA (Kaspersky Secure Mail Gateway):

Code: Select all

Digest mismatch (VERR_NOT_EQUAL): Attribute 'SHA1' on 'ksmg-1.0.0-557.x86_64.ovf' does not match ('FFAF6942EEBEBF68C991F53363B071038E874656' vs. 'ffaf6942eebebf68c991f53363b071038e874656').

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

Is this a bug?

I try VirtualBox 5.1.4 at Windows 7 SP1 x86.
Last edited by socratis on 8. Dec 2017, 00:23, edited 2 times in total.
Reason: Added ticket related information.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Digest mismatch (VERR_NOT_EQUAL) with correct file

Post by scottgus1 »

I haven't imported an appliance in a long while. Do you have to provide one of those hashes? If so, just go through the hash value you provide and replace every letter with the opposite case and try again. If you don't provide the hash, maybe it's in the files describing the appliance and you could change the hash in some sort of configuration file.

The hash values appear to be in the hexadecimal range, 0-9, A-F. Case isn't supposed to matter, but the two hashes in your error message do in fact not technically match because, for example, F is not f in computer codes. Higher-level programming languages have commands to automatically switch case on the letters to handle such case issues. Maybe someone forgot to throw in a "Ucase()"?
SergeyBelov
Posts: 3
Joined: 6. Sep 2016, 21:15

Re: Digest mismatch (VERR_NOT_EQUAL) with correct file

Post by SergeyBelov »

Thanks for your reply.

I can't change OVA because it's signeg. All hashes in OVA (in ksmg-1.0.0-557.x86_64.mf) are correct but written capital.

Code: Select all

SHA1(ksmg-1.0.0-557.x86_64.ovf)= FFAF6942EEBEBF68C991F53363B071038E874656
SHA1(ksmg-1.0.0-557.x86_64-disk1.vmdk)= B34834ADFFEEE4FA43479026ABDC6AD0E6EC31C6
SHA1(ksmg-1.0.0-557.x86_64-disk2.vmdk)= E16BA1F6DCA824B84B6A01E94A05F3DB76DCEFC7
SHA1(ksmg-1.0.0-557.x86_64-disk3.vmdk)= 5251A1E9A679371C0BFBF70178F5321BB91E613E
SHA1(ksmg-1.0.0-557.x86_64-disk4.vmdk)= C915EF32279F42747765952FDB21BFB26F7F86A5
SHA1(ksmg-1.0.0-557.x86_64-disk5.vmdk)= 7EC5C11137CC02F4BCCCAAD35BD7E7226B34E23D
scottgus1 wrote:Maybe someone forgot to throw in a "Ucase()"?
I think so.
SergeyBelov
Posts: 3
Joined: 6. Sep 2016, 21:15

Re: Digest mismatch (VERR_NOT_EQUAL) with correct file

Post by SergeyBelov »

Should I write bug report?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Digest mismatch (VERR_NOT_EQUAL) with correct file

Post by scottgus1 »

Sounds like a good idea. See Bugtracker

Meanwhile, you might look into how to extract all the info within the appliance - the virtual disk file and settings information - and try to set up a Virtualbox guest maually.
MarcT
Posts: 3
Joined: 7. Dec 2017, 21:50

Re: Digest mismatch (VERR_NOT_EQUAL) with correct file

Post by MarcT »

I ran into the same issue and have just opened ticket 17357

Kind Regards,

Marc
Last edited by socratis on 8. Dec 2017, 00:21, edited 1 time in total.
Reason: Added missing URL.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Digest mismatch (VERR_NOT_EQUAL) with correct file

Post by socratis »

Thank you for including the ticket number. I added the ticket information in the first post.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
MarcT
Posts: 3
Joined: 7. Dec 2017, 21:50

Re: Digest mismatch (VERR_NOT_EQUAL) with correct file (#17357)

Post by MarcT »

I added a 1 line "potential patch/fix" for this issue to ticket https://www.virtualbox.org/ticket/17357

Unfortunately I can't easily test it myself as I don't have the Qt5 libraries required to build VirtualBox from source.
If anyone here can test/improve & report back, we might get some progress.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Digest mismatch (VERR_NOT_EQUAL) with correct file (#17357)

Post by socratis »

The fix that you added (CaSe InSeNsItIvE comparison) is pretty easy to test. As long as we have an OVA that has the issue. Do you have a link to the OVA that fails? I could try and build it and see if the patch "fixes" the issue or not...

The patch that you submitted, just for completion:
MarcT on [url=https://www.virtualbox.org/ticket/17357#comment:2]#17357:2[/url] wrote:

Code: Select all

--- ./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,
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Dani_3xton
Posts: 1
Joined: 8. May 2018, 15:39

Re: Digest mismatch (VERR_NOT_EQUAL) with correct file (#17357)

Post by Dani_3xton »

Hello,

Any progress with that? I have an OVF file that I cannot import because of this error.

Code: Select all

Digest mismatch (VERR_NOT_EQUAL): Attribute 'SHA1' on 'eFramework-2.8.8.ovf' does not match ('F33C5B7E74C552360722CF9B22943D30F4E122D1' vs. 'f33c5b7e74c552360722cf9b22943d30f4e122d1').
You can download it here: http://ova-efw.midasolutions.com

Thank you,

Dani
Last edited by socratis on 8. May 2018, 16:36, edited 1 time in total.
Reason: Fixed obfuscated URLs.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Digest mismatch (VERR_NOT_EQUAL) with correct file (#17357)

Post by socratis »

Are you talking about the "eFramework-2.8.8.ova"? The one that's about 4.5 GB?
Couldn't you try something smaller? :D
I'll download it and try it out. I am building VirtualBox locally, so I could test the patch...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Digest mismatch (VERR_NOT_EQUAL) with correct file (#17357)

Post by socratis »

OVA downloaded, it failed. Patch applied, it worked. More details on the ticket...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
MilenkoMaletic
Posts: 1
Joined: 10. Jul 2018, 17:54
Primary OS: Mac OS X other
VBox Version: OSE Debian
Guest OSses: Windows, Linux
Location: Slovenia

Re: Digest mismatch (VERR_NOT_EQUAL) with correct file (#17357)

Post by MilenkoMaletic »

If you get error message like this:

Failed to import appliance /Volumes/USB500BLACK/myAppliance.ovf.

Digest mismatch (VERR_NOT_EQUAL): Attribute 'SHA256'on 'my-disc1.vmdk'does not match ('c8b7a316f6e4a7b4c06e025a6d3ccdd0971a9126f6999b16c48d8bdd33d0a441'vs. 'b3896b6bb0a5ef3926ffa4a0829534c023e50464c331b93583be657642e21b0b').

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

try creating/editing myAppliance.mf file and change guid for disc from c8b7a316f6e4a7b4c06e025a6d3ccdd0971a9126f6999b16c48d8bdd33d0a441 to b3896b6bb0a5ef3926ffa4a0829534c023e50464c331b93583be657642e21b0b

so the final file content looks like this:

SHA256(myAppliance.ovf)= 6e9dc368f3e4c9c210d0fd6bc1fa2c81b360c5d367606d5f3ada5796fb49edf0
SHA256(my-disc1.vmdk)= b3896b6bb0a5ef3926ffa4a0829534c023e50464c331b93583be657642e21b0b

Save .mf file and try to import OVF appliance again.

Of course, you will have different OVF appliance, disc names and guids. That solution helped me to reimport long time unused appliance. Any other hint I found on the net didn't work.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Digest mismatch (VERR_NOT_EQUAL) with correct file (#17357)

Post by socratis »

MilenkoMaletic wrote:Of course, you will have different OVF appliance, disc names and guids.
And that's why your case is not the same as this thread's discussion.
MilenkoMaletic wrote:That solution helped me to reimport long time unused appliance.
Good to hear it! ;)
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Digest mismatch (VERR_NOT_EQUAL) with correct file (#17357)

Post by socratis »

After a friendly ping to the devs (thanks!), I've been told that the "strcasecmp" function is not part of the C standard, only the POSIX/BSD standard (see "strcasecmp() : A Non-Standard Function?"). That's why my testing of the patch worked; I'm on OSX, the function is available. But it will fail on a Windows compiler. :o

Test Builds >= 5.2.15 r123596 should contain the fix. I tested the OVA (mentioned by Dan), and it worked. If you can test the fix, that'd be great!
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply