Answered by:
Leaf Node Object Data hashing
Question

Answers

Hi Kirill Paliy,
While working on pseudo code documenting the XOR Hash algorithm, we discovered that sample code containing the specific XOR Hash algorithm was made available. The sample code is meant for use with OneDrive, however the XOR Hash algorithm is the same as used in MSFSSHTTP to calculate the Leaf Node Data Hash.
The Sample is available for you to leverage in our own implementation. The Sample can be found at: Sample code to generate the OneDrive Quick XOR Hash value for a file. The primary function to review is HashCore.
The sample should help unblock you with respect to understanding the XOR Hash algorithm. However, we will be updasting the MSFSSHTTP specifications to include an appropriate pseudo code definition of the XOR Hash algorithm as well.
Will Gregg  open specifications
 Marked as answer by Kirill Paliy Wednesday, June 13, 2018 6:46 AM
 Unmarked as answer by Kirill Paliy Wednesday, June 13, 2018 8:32 AM
 Marked as answer by Kirill Paliy Wednesday, June 13, 2018 8:49 AM
All replies

Hello Kirill Paliy:
Thank you for your inquiry about Microsoft Office Specifications. We have created an incident for investigating this issue. One of the Open specifications team member will contact you shortly.
Thanks.
Tarun Chopra  Escalation Engineer  Open Specifications Support Team





Hi Kirill Paliy,
Thanks for you patience as this is getting tracked down. I apologize that this is taking so long. There were a number of complicated issues between the specification and the product functionality that we've narrowed down.
As you already know the algorithm for calculating the Data Hash of a Leaf Node Object is not referenced in the specification. We are working with the owning product team to address the issue, and the algorithm will be appropriately documented in a future release of the specification.
In the meantime. The data used to in the algorithm to calculate the Data Hash is the actual data contained within the Leaf Node.
The algorithm itself is a somewhat straight forward XOR calculation; however the specific documentation description of the algorithm is currently being reviewed and I should be able to post you the explanation tomorrow, upon completion of the review.
Will Gregg  open specifications

Hi Kirill Paliy,
While working on pseudo code documenting the XOR Hash algorithm, we discovered that sample code containing the specific XOR Hash algorithm was made available. The sample code is meant for use with OneDrive, however the XOR Hash algorithm is the same as used in MSFSSHTTP to calculate the Leaf Node Data Hash.
The Sample is available for you to leverage in our own implementation. The Sample can be found at: Sample code to generate the OneDrive Quick XOR Hash value for a file. The primary function to review is HashCore.
The sample should help unblock you with respect to understanding the XOR Hash algorithm. However, we will be updasting the MSFSSHTTP specifications to include an appropriate pseudo code definition of the XOR Hash algorithm as well.
Will Gregg  open specifications
 Marked as answer by Kirill Paliy Wednesday, June 13, 2018 6:46 AM
 Unmarked as answer by Kirill Paliy Wednesday, June 13, 2018 8:32 AM
 Marked as answer by Kirill Paliy Wednesday, June 13, 2018 8:49 AM

Hi
I have compiled and tried c# code you provided, however result does not match one I see in actual exchange captured by Fiddler. Most probably I use incorrect input data, could you please clarify what part of Leaf Node data should be used? Whole Leaf Node contains hash I tried to calculate so I guess something has to be excluded to get correct result. If necessary, I can email Fiddler response and screenshot.
edit: It seems that data used in calculation is "data" field of blob reference, which is referred via ObjectExtendedGUIArray by current leaf node's parent. If it sounds unclear and you'll need clarification before adding to documentation, I can provide example with explanation.
Also signature header (0x29 in case of 20byte hash) is added prior to calculated hash.
 Edited by Kirill Paliy Wednesday, June 13, 2018 8:55 AM