forked from TrueCloudLab/frostfs-sdk-go
[#261] session: Make failed Sign
pure on failed signature calculation
Make `Sign` method implementation to not modify `issuerSet` state variable after signature calculation's failures. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
0bb40b3245
commit
458c882ff4
1 changed files with 2 additions and 1 deletions
|
@ -157,7 +157,6 @@ func (x commonData) signedData(w contextWriter) []byte {
|
||||||
|
|
||||||
func (x *commonData) sign(key ecdsa.PrivateKey, w contextWriter) error {
|
func (x *commonData) sign(key ecdsa.PrivateKey, w contextWriter) error {
|
||||||
user.IDFromKey(&x.issuer, key.PublicKey)
|
user.IDFromKey(&x.issuer, key.PublicKey)
|
||||||
x.issuerSet = true
|
|
||||||
|
|
||||||
var sig neofscrypto.Signature
|
var sig neofscrypto.Signature
|
||||||
|
|
||||||
|
@ -166,6 +165,8 @@ func (x *commonData) sign(key ecdsa.PrivateKey, w contextWriter) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
x.issuerSet = true
|
||||||
|
|
||||||
sig.WriteToV2(&x.sig)
|
sig.WriteToV2(&x.sig)
|
||||||
x.sigSet = true
|
x.sigSet = true
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue