Vijaya Venkatachalam
2017-04-26 12:42:20 UTC
Hi,
I am looking at the python vici implementation for strongswan and there seems to be a bug in protocol.py in the Packet class.
@classmethod                                   Â
   def _named_request(cls, request_type, request, message=None):
       requestdata = request.encode("UTF-8")                  Â
       payload = struct.pack("!BB", request_type, len(request)) + request
       if message is not None:                                             Â
           return payload + message                                        Â
       else:                                                               Â
           return payload
So when I create a dictionary for the ipsec config and do a load_conn I got the error as unable to concat bytes and string.And I realized that this is because in the _named_request method above, we are packing request instead of requestdata.Possibly we need to change the length being passed to pack also.
When I replace request with requestdata, the error goes away and it proceeds with the trying to parse/load the connection from configuration.
Thanks,vijaya
I am looking at the python vici implementation for strongswan and there seems to be a bug in protocol.py in the Packet class.
@classmethod                                   Â
   def _named_request(cls, request_type, request, message=None):
       requestdata = request.encode("UTF-8")                  Â
       payload = struct.pack("!BB", request_type, len(request)) + request
       if message is not None:                                             Â
           return payload + message                                        Â
       else:                                                               Â
           return payload
So when I create a dictionary for the ipsec config and do a load_conn I got the error as unable to concat bytes and string.And I realized that this is because in the _named_request method above, we are packing request instead of requestdata.Possibly we need to change the length being passed to pack also.
When I replace request with requestdata, the error goes away and it proceeds with the trying to parse/load the connection from configuration.
Thanks,vijaya