def open_secure_channel(self, algohdr, seqhdr, body): request = ua.OpenSecureChannelRequest.from_binary(body) self._connection.select_policy(algohdr.SecurityPolicyURI, algohdr.SenderCertificate, request.Parameters.SecurityMode) channel = self._connection.open(request.Parameters, self.iserver) # send response response = ua.OpenSecureChannelResponse() response.Parameters = channel self.send_response(request.RequestHeader.RequestHandle, None, seqhdr, response, ua.MessageType.SecureOpen)
def open_secure_channel(self, body): algohdr = ua.AsymmetricAlgorithmHeader.from_binary(body) seqhdr = ua.SequenceHeader.from_binary(body) request = ua.OpenSecureChannelRequest.from_binary(body) channel = self._open_secure_channel(request.Parameters) # send response response = ua.OpenSecureChannelResponse() response.Parameters = channel self.send_response(request.RequestHeader.RequestHandle, algohdr, seqhdr, response, ua.MessageType.SecureOpen)
def open_secure_channel(self, algohdr, seqhdr, body): request = struct_from_binary(ua.OpenSecureChannelRequest, body) if not self._connection.is_open(): # Only call select_policy if the channel isn't open. Otherwise # it will break the Secure channel renewal. self._connection.select_policy(algohdr.SecurityPolicyURI, algohdr.SenderCertificate, request.Parameters.SecurityMode) channel = self._connection.open(request.Parameters, self.iserver) # send response response = ua.OpenSecureChannelResponse() response.Parameters = channel self.send_response(request.RequestHeader.RequestHandle, seqhdr, response, ua.MessageType.SecureOpen)