<html><head></head><body><div style="color:#000; background-color:#fff; font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1493210450145_8569">Hi,</div><div id="yui_3_16_0_ym19_1_1493210450145_8570"><br id="yui_3_16_0_ym19_1_1493210450145_8571"></div><div dir="ltr" id="yui_3_16_0_ym19_1_1493210450145_8572">I am looking at the python vici implementation for strongswan and there seems to be a bug in protocol.py in the Packet class.<br id="yui_3_16_0_ym19_1_1493210450145_8573"></div><div dir="ltr" id="yui_3_16_0_ym19_1_1493210450145_8574"><br id="yui_3_16_0_ym19_1_1493210450145_8575"></div><div dir="ltr" id="yui_3_16_0_ym19_1_1493210450145_8576">@classmethod                                     <br id="yui_3_16_0_ym19_1_1493210450145_8577">    def _named_request(cls, request_type, request, message=None):<br id="yui_3_16_0_ym19_1_1493210450145_8578">        requestdata = request.encode("UTF-8")                    <br id="yui_3_16_0_ym19_1_1493210450145_8579">        payload = struct.pack("!BB", request_type, len(request)) + request<br id="yui_3_16_0_ym19_1_1493210450145_8580">        if message is not None:                                               <br id="yui_3_16_0_ym19_1_1493210450145_8581">            return payload + message                                          <br id="yui_3_16_0_ym19_1_1493210450145_8582">        else:                                                                 <br id="yui_3_16_0_ym19_1_1493210450145_8583">            return payload</div><div dir="ltr" id="yui_3_16_0_ym19_1_1493210450145_8584"><br id="yui_3_16_0_ym19_1_1493210450145_8585"></div><div dir="ltr" id="yui_3_16_0_ym19_1_1493210450145_8586">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.</div><div dir="ltr" id="yui_3_16_0_ym19_1_1493210450145_8587">And I realized that this is because in the _named_request method above, we are packing request instead of requestdata.</div><div dir="ltr" id="yui_3_16_0_ym19_1_1493210450145_8588">Possibly we need to change the length being passed to pack also.<br id="yui_3_16_0_ym19_1_1493210450145_8589"></div><div dir="ltr" id="yui_3_16_0_ym19_1_1493210450145_8590"><br id="yui_3_16_0_ym19_1_1493210450145_8591"></div><div dir="ltr" id="yui_3_16_0_ym19_1_1493210450145_8592">When
 I replace request with requestdata, the error goes away and it proceeds
 with the trying to parse/load the connection from configuration.</div><div dir="ltr" id="yui_3_16_0_ym19_1_1493210450145_8593"><br id="yui_3_16_0_ym19_1_1493210450145_8594"></div><div dir="ltr" id="yui_3_16_0_ym19_1_1493210450145_8595">Thanks,</div>vijaya</div></body></html>