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>
This commit is contained in:
parent
77a3ba9197
commit
3d3283411c
1 changed files with 2 additions and 2 deletions
|
@ -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 a new issue