@@ -41,7 +41,7 @@ func (cp *Processor) processContainerPut(req containerEvent.CreateContainerReque
4141 return
4242 }
4343
44- err := cp .checkPutContainer (req , cnr )
44+ err := cp .checkPutContainer (cnr , req . Container , req . SessionToken , req . InvocationScript , req . VerificationScript , req . DomainName , req . DomainZone )
4545 if err != nil {
4646 cp .log .Error ("put container check failed" ,
4747 zap .Error (err ),
@@ -65,7 +65,7 @@ var allowedSystemAttributes = map[string]struct{}{
6565 sysAttrChainMeta : {},
6666}
6767
68- func (cp * Processor ) checkPutContainer (req containerEvent. CreateContainerRequest , cnr containerSDK.Container ) error {
68+ func (cp * Processor ) checkPutContainer (cnr containerSDK.Container , cnrBytes , sessionToken , invocScript , verifScript [] byte , domainName , domainZone string ) error {
6969 for k := range cnr .Attributes () {
7070 if strings .HasPrefix (k , sysAttrPrefix ) {
7171 if _ , ok := allowedSystemAttributes [k ]; ! ok {
@@ -89,10 +89,10 @@ func (cp *Processor) checkPutContainer(req containerEvent.CreateContainerRequest
8989 err := cp .verifySignature (signatureVerificationData {
9090 ownerContainer : cnr .Owner (),
9191 verb : session .VerbContainerPut ,
92- binTokenSession : req . SessionToken ,
93- verifScript : req . VerificationScript ,
94- invocScript : req . InvocationScript ,
95- signedData : req . Container ,
92+ binTokenSession : sessionToken ,
93+ verifScript : verifScript ,
94+ invocScript : invocScript ,
95+ signedData : cnrBytes ,
9696 })
9797 if err != nil {
9898 return fmt .Errorf ("auth container creation: %w" , err )
@@ -108,8 +108,8 @@ func (cp *Processor) checkPutContainer(req containerEvent.CreateContainerRequest
108108 return fmt .Errorf ("incorrect homomorphic hashing setting: %w" , err )
109109 }
110110
111- if req . DomainName != "" { // if PutNamed event => check if values in-container domain name and zone correspond to args
112- err = checkNNS (cnr , req . DomainName , req . DomainZone )
111+ if domainZone != "" { // if PutNamed event => check if values in-container domain name and zone correspond to args
112+ err = checkNNS (cnr , domainName , domainZone )
113113 if err != nil {
114114 return fmt .Errorf ("NNS: %w" , err )
115115 }
0 commit comments