forked from TrueCloudLab/frostfs-sdk-go
Revert "[#261] session: Make failed Sign
pure on failed signature calculation"
This reverts commit 458c882ff4
.
If `issuerSet` is set after signature calculation then issuer ID isn't
written to signed data, in other words not signed.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
bf8312a547
commit
67ff996dc3
1 changed files with 1 additions and 2 deletions
|
@ -157,6 +157,7 @@ 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
|
||||||
|
|
||||||
|
@ -165,8 +166,6 @@ 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