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>
remotes/fyrchik/update-contracts
Leonard Lyubich 2022-06-04 16:46:03 +03:00 committed by fyrchik
parent bf8312a547
commit 67ff996dc3
1 changed files with 1 additions and 2 deletions

View File

@ -157,6 +157,7 @@ func (x commonData) signedData(w contextWriter) []byte {
func (x *commonData) sign(key ecdsa.PrivateKey, w contextWriter) error {
user.IDFromKey(&x.issuer, key.PublicKey)
x.issuerSet = true
var sig neofscrypto.Signature
@ -165,8 +166,6 @@ func (x *commonData) sign(key ecdsa.PrivateKey, w contextWriter) error {
return err
}
x.issuerSet = true
sig.WriteToV2(&x.sig)
x.sigSet = true