forked from TrueCloudLab/frostfs-sdk-go
[#211] object: Fix setIDWithSignature
* Calculate and set checksum before ID is calculated. * Add header verification for parts in unit-test. Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
425d48f68b
commit
ec0cb2169f
2 changed files with 11 additions and 2 deletions
|
@ -44,12 +44,12 @@ func (c *Constructor) Split(obj *objectSDK.Object, key *ecdsa.PrivateKey) ([]*ob
|
|||
}
|
||||
|
||||
func setIDWithSignature(obj *objectSDK.Object, key *ecdsa.PrivateKey) error {
|
||||
objectSDK.CalculateAndSetPayloadChecksum(obj)
|
||||
|
||||
if err := objectSDK.CalculateAndSetID(obj); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
objectSDK.CalculateAndSetPayloadChecksum(obj)
|
||||
|
||||
if key == nil {
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue