[strongSwan-dev] python vici load-conn - possible bug

Vijaya Venkatachalam vlakshmi at rocketmail.com
Wed Apr 26 14:42:20 CEST 2017


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strongswan.org/pipermail/dev/attachments/20170426/176e33ca/attachment.html>


More information about the Dev mailing list