Skip to content

Commit 1af1415

Browse files
authored
Merge pull request #1483 from 0chain/fix/v1-rootsig
fix signature payload for v1
2 parents 77da154 + 51fe808 commit 1af1415

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

code/go/0chain.net/blobbercore/handler/file_command_update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func (cmd *UpdateFileCommand) ProcessContent(ctx context.Context, allocationObj
150150
if fileOutputData.ContentSize != cmd.fileChanger.Size {
151151
return result, common.NewError("upload_error", fmt.Sprintf("File size mismatch. Expected: %d, Actual: %d", cmd.fileChanger.Size, fileOutputData.ContentSize))
152152
}
153-
hash := cmd.fileChanger.ActualHash + cmd.fileChanger.ValidationRoot
153+
hash := cmd.fileChanger.ActualFileHashSignature + cmd.fileChanger.ValidationRoot
154154
if allocationObj.IsStorageV2() {
155155
hashData := fmt.Sprintf("%s:%s:%s:%s", cmd.fileChanger.ActualHash, cmd.fileChanger.ValidationRoot, cmd.fileChanger.FixedMerkleRoot, node.Self.ID)
156156
hash = encryption.Hash(hashData)

code/go/0chain.net/blobbercore/handler/file_command_upload.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func (cmd *UploadFileCommand) ProcessContent(ctx context.Context, allocationObj
162162
if fileOutputData.ContentSize != cmd.fileChanger.Size {
163163
return result, common.NewError("upload_error", fmt.Sprintf("File size mismatch. Expected: %d, Actual: %d", cmd.fileChanger.Size, fileOutputData.ContentSize))
164164
}
165-
hash := cmd.fileChanger.ActualHash + cmd.fileChanger.ValidationRoot
165+
hash := cmd.fileChanger.ActualFileHashSignature + cmd.fileChanger.ValidationRoot
166166
if allocationObj.IsStorageV2() {
167167
hashData := fmt.Sprintf("%s:%s:%s:%s", cmd.fileChanger.ActualHash, cmd.fileChanger.ValidationRoot, cmd.fileChanger.FixedMerkleRoot, node.Self.ID)
168168
hash = encryption.Hash(hashData)

0 commit comments

Comments
 (0)