From f00b9ba0546b51c511f05f1fef6de2de73ea11e5 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Wed, 7 Jul 2021 13:42:09 +0300 Subject: [PATCH] [#326] Fix regression after #324 Signed-off-by: Alex Vanin --- pkg/client/object.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/client/object.go b/pkg/client/object.go index 60d29705..6fd25ad9 100644 --- a/pkg/client/object.go +++ b/pkg/client/object.go @@ -1301,8 +1301,6 @@ func (c *clientImpl) attachV2SessionToken(opts *callOptions, hdr *v2session.Requ return nil } - token := new(v2session.SessionToken) - opCtx := new(v2session.ObjectSessionContext) opCtx.SetAddress(info.addr) opCtx.SetVerb(info.verb) @@ -1319,6 +1317,9 @@ func (c *clientImpl) attachV2SessionToken(opts *callOptions, hdr *v2session.Requ body.SetContext(opCtx) body.SetLifetime(lt) + token := new(v2session.SessionToken) + token.SetBody(body) + signWrapper := signature.StableMarshalerWrapper{SM: token.GetBody()} err := signer.SignDataWithHandler(opts.key, signWrapper, func(key []byte, sig []byte) {