forked from TrueCloudLab/frostfs-api-go
[#393] signature: Do not allocate a signature explicitly
Helpers from `util/signature` already allocates it for us. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>support/v2.15
parent
77a3ba9197
commit
3d3283411c
|
@ -194,14 +194,14 @@ func SignServiceMessage(key *ecdsa.PrivateKey, msg interface{}) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func signServiceMessagePart(key *ecdsa.PrivateKey, part stableMarshaler, sigWrite func(*refs.Signature)) error {
|
func signServiceMessagePart(key *ecdsa.PrivateKey, part stableMarshaler, sigWrite func(*refs.Signature)) error {
|
||||||
sig := new(refs.Signature)
|
var sig *refs.Signature
|
||||||
|
|
||||||
// sign part
|
// sign part
|
||||||
if err := signature.SignDataWithHandler(
|
if err := signature.SignDataWithHandler(
|
||||||
key,
|
key,
|
||||||
&StableMarshalerWrapper{part},
|
&StableMarshalerWrapper{part},
|
||||||
func(s *refs.Signature) {
|
func(s *refs.Signature) {
|
||||||
*sig = *s
|
sig = s
|
||||||
},
|
},
|
||||||
); err != nil {
|
); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue