forked from TrueCloudLab/frostfs-sdk-go
[#257] Upgrade NeoFS API Go module
New version contains fix for `object.GetRangeResponse` message type. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
3953c2166e
commit
6cb513c976
31 changed files with 46 additions and 139 deletions
|
@ -55,13 +55,8 @@ func VerifyPayloadChecksum(obj *Object) error {
|
|||
|
||||
// CalculateID calculates identifier for the object.
|
||||
func CalculateID(obj *Object) (oid.ID, error) {
|
||||
data, err := obj.ToV2().GetHeader().StableMarshal(nil)
|
||||
if err != nil {
|
||||
return oid.ID{}, err
|
||||
}
|
||||
|
||||
var id oid.ID
|
||||
id.SetSHA256(sha256.Sum256(data))
|
||||
id.SetSHA256(sha256.Sum256(obj.ToV2().GetHeader().StableMarshal(nil)))
|
||||
|
||||
return id, nil
|
||||
}
|
||||
|
@ -131,15 +126,10 @@ func (o *Object) VerifyIDSignature() bool {
|
|||
return false
|
||||
}
|
||||
|
||||
data, err := idV2.StableMarshal(nil)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
var sig neofscrypto.Signature
|
||||
sig.ReadFromV2(*sigV2)
|
||||
|
||||
return sig.Verify(data)
|
||||
return sig.Verify(idV2.StableMarshal(nil))
|
||||
}
|
||||
|
||||
// SetIDWithSignature sets object identifier and signature.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue