Page 1 of 1

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

PostPosted: 6. Sep 2016, 21:40
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   Expand viewCollapse view
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.

Re: Digest mismatch (VERR_NOT_EQUAL) with correct file

PostPosted: 7. Sep 2016, 18:00
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()"?

Re: Digest mismatch (VERR_NOT_EQUAL) with correct file

PostPosted: 8. Sep 2016, 18:08
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   Expand viewCollapse view
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.

Re: Digest mismatch (VERR_NOT_EQUAL) with correct file

PostPosted: 8. Sep 2016, 18:10
by SergeyBelov
Should I write bug report?

Re: Digest mismatch (VERR_NOT_EQUAL) with correct file

PostPosted: 8. Sep 2016, 18:55
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.

Re: Digest mismatch (VERR_NOT_EQUAL) with correct file

PostPosted: 7. Dec 2017, 21:52
by MarcT
I ran into the same issue and have just opened ticket 17357

Kind Regards,

Marc

Re: Digest mismatch (VERR_NOT_EQUAL) with correct file

PostPosted: 8. Dec 2017, 00:22
by socratis
Thank you for including the ticket number. I added the ticket information in the first post.

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

PostPosted: 27. Feb 2018, 20:34
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.

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

PostPosted: 27. Feb 2018, 21:04
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 #17357:2 wrote:
Code: Select all   Expand viewCollapse view
--- ./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,

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

PostPosted: 8. May 2018, 15:45
by Dani_3xton
Hello,

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

Code: Select all   Expand viewCollapse view
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

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

PostPosted: 8. May 2018, 16:34
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...

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

PostPosted: 8. May 2018, 22:35
by socratis
OVA downloaded, it failed. Patch applied, it worked. More details on the ticket...

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

PostPosted: 10. Jul 2018, 18:36
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.

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

PostPosted: 10. Jul 2018, 20:10
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! ;)

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

PostPosted: 11. Jul 2018, 01:39
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!