qwj / python-vpn

VPN Server implemented in pure Python. (For Research Purposes Only)
MIT License
362 stars 102 forks source link

Internal bugs in code (unsupported Android 12?) #10

Open amaxcz opened 2 years ago

amaxcz commented 2 years ago

Error log:

Serving on UDP :500 :4500... IKE_SA_INIT(spi_i=2158a8c77dbd4a0f, spi_r=0000000000000000, version=2.0, flag=MsgFlag.Initiator, message_id=0, SA(IKE:1(spi=None, ENCR_AES_CTR(keylen=256), ENCR_AES_CBC(keylen=256), ENCR_AES_CTR(keylen=192), ENCR_AES_CBC(keylen=192), ENCR_AES_CTR(keylen=128), ENCR_AES_CBC(keylen=128), AUTH_HMAC_SHA2_512_256, AUTH_HMAC_SHA2_384_192, AUTH_HMAC_SHA2_256_128, AUTH_AES_XCBC_96, AUTH_AES_CMAC_96, DH_16, DH_31, DH_15, DH_14, PRF_HMAC_SHA1, PRF_AES128_XCBC, PRF_HMAC_SHA2_256, PRF_HMAC_SHA2_384, PRF_HMAC_SHA2_512, PRF_AES128_CMAC), IKE:2(spi=None, ENCR_CHACHA20_POLY1305, ENCR_AES_GCM_16(keylen=256), ENCR_AES_GCM_12(keylen=256), ENCR_AES_GCM_8(keylen=256), ENCR_AES_GCM_16(keylen=192), ENCR_AES_GCM_12(keylen=192), ENCR_AES_GCM_8(keylen=192), ENCR_AES_GCM_16(keylen=128), ENCR_AES_GCM_12(keylen=128), ENCR_AES_GCM_8(keylen=128), DH_16, DH_31, DH_15, DH_14, PRF_HMAC_SHA1, PRF_AES128_XCBC, PRF_HMAC_SHA2_256, PRF_HMAC_SHA2_384, PRF_HMAC_SHA2_512, PRF_AES128_CMAC)), KE(16, 797162594ca822f4f801fa370c9a1934bc8def08eba1d75d86f74f2d78de76d2af692d22f89e5ff19c9e57b0f4f59e9af37cf2c0a486cd68ff2007fff03243ceaaf8b568a55f1a322dcc8a27ec18891a7986f37c3924070eb044756e5390306b2ab08df773fa44ca63811bb7e47642c7e71298f091027fbe7868c15ba8953750fd22455fbaac9929af4ba75c088fab5a5dc8d3f0b44c7e81becbb32de935e3f8c2326759d007d06e38531d87698f20d4c75285d44b1fd288a567960dd32f9a0c087f20ae7cfa64ad6eeaa1b200f70ce6177484e3f8ba126b284dbf2419056f711a9a92fa03d8a95a56f980a34af9dcf16ed529c4be55576464a7f478b207b823fa27eebe0d317fb0ff69b476da0868736bc9f643203d0c3dce4a33535ea79ab50466fc210abd89f0cc56179474456c043b2be934d753c85e1b285465cd3442132ac4072cdf9c2c6a366b98ab582a3496eead4684c16e61bc9c1414a390a6842aca44322f0fdc8b5eb7c381b69a6b2a9f5324f8d98f0e672605b4dacbdfbac6547a6b1d07594c00d6621351512d73102f47fa48d1fdbef5a7cb942c97efdb5ba4db2d90f1ff39ecd210b4df46e40e2640f54d9a986a8f64569f190fe66b803555e9c0942b072adf27c11ef19a6e1d7418cb96ff1b36b4c1367a329dbab2b302eda029fdc62453612461f5c52fbd09e931aa4d89e2b1f36c99db388bd482dab4f6), NONCE(43be6e3e8038e4856c1d6c9a880e470af81c7617ec9438255accd2d3e9ecf706), NOTIFY(NAT_DETECTION_SOURCE_IP(data=fdf1696fb2bea54b07d0ecd321732b7908a4a2a8)), NOTIFY(NAT_DETECTION_DESTINATION_IP(data=c773baab886de0438d356628f66e2c2d344bbfcc)), NOTIFY(IKEV2_FRAGMENTATION_SUPPORTED()), NOTIFY(SIGNATURE_HASH_ALGORITHMS(data=0001000200030004))) Exception in callback _SelectorDatagramTransport._read_ready() handle: <Handle _SelectorDatagramTransport._read_ready()> Traceback (most recent call last): File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run self._context.run(self._callback, self._args) File "/usr/lib/python3.10/asyncio/selector_events.py", line 1026, in _read_ready self._protocol.datagram_received(data, addr) File "/usr/local/lib/python3.10/dist-packages/pvpn/server.py", line 394, in datagram_received session.process(request, stream, addr[:2], lambda response: self.transport.sendto(response_header+response, addr)) File "/usr/local/lib/python3.10/dist-packages/pvpn/server.py", line 273, in process prefered_dh = chosen_proposal.get_transform(enums.Transform.DH).id AttributeError: 'NoneType' object has no attribute 'get_transform' IKE_SA_INIT(spi_i=2158a8c77dbd4a0f, spi_r=0000000000000000, version=2.0, flag=MsgFlag.Initiator, message_id=0, SA(IKE:1(spi=None, ENCR_AES_CTR(keylen=256), ENCR_AES_CBC(keylen=256), ENCR_AES_CTR(keylen=192), ENCR_AES_CBC(keylen=192), ENCR_AES_CTR(keylen=128), ENCR_AES_CBC(keylen=128), AUTH_HMAC_SHA2_512_256, AUTH_HMAC_SHA2_384_192, AUTH_HMAC_SHA2_256_128, AUTH_AES_XCBC_96, AUTH_AES_CMAC_96, DH_16, DH_31, DH_15, DH_14, PRF_HMAC_SHA1, PRF_AES128_XCBC, PRF_HMAC_SHA2_256, PRF_HMAC_SHA2_384, PRF_HMAC_SHA2_512, PRF_AES128_CMAC), IKE:2(spi=None, ENCR_CHACHA20_POLY1305, ENCR_AES_GCM_16(keylen=256), ENCR_AES_GCM_12(keylen=256), ENCR_AES_GCM_8(keylen=256), ENCR_AES_GCM_16(keylen=192), ENCR_AES_GCM_12(keylen=192), ENCR_AES_GCM_8(keylen=192), ENCR_AES_GCM_16(keylen=128), ENCR_AES_GCM_12(keylen=128), ENCR_AES_GCM_8(keylen=128), DH_16, DH_31, DH_15, DH_14, PRF_HMAC_SHA1, PRF_AES128_XCBC, PRF_HMAC_SHA2_256, PRF_HMAC_SHA2_384, PRF_HMAC_SHA2_512, PRF_AES128_CMAC)), KE(16, 797162594ca822f4f801fa370c9a1934bc8def08eba1d75d86f74f2d78de76d2af692d22f89e5ff19c9e57b0f4f59e9af37cf2c0a486cd68ff2007fff03243ceaaf8b568a55f1a322dcc8a27ec18891a7986f37c3924070eb044756e5390306b2ab08df773fa44ca63811bb7e47642c7e71298f091027fbe7868c15ba8953750fd22455fbaac9929af4ba75c088fab5a5dc8d3f0b44c7e81becbb32de935e3f8c2326759d007d06e38531d87698f20d4c75285d44b1fd288a567960dd32f9a0c087f20ae7cfa64ad6eeaa1b200f70ce6177484e3f8ba126b284dbf2419056f711a9a92fa03d8a95a56f980a34af9dcf16ed529c4be55576464a7f478b207b823fa27eebe0d317fb0ff69b476da0868736bc9f643203d0c3dce4a33535ea79ab50466fc210abd89f0cc56179474456c043b2be934d753c85e1b285465cd3442132ac4072cdf9c2c6a366b98ab582a3496eead4684c16e61bc9c1414a390a6842aca44322f0fdc8b5eb7c381b69a6b2a9f5324f8d98f0e672605b4dacbdfbac6547a6b1d07594c00d6621351512d73102f47fa48d1fdbef5a7cb942c97efdb5ba4db2d90f1ff39ecd210b4df46e40e2640f54d9a986a8f64569f190fe66b803555e9c0942b072adf27c11ef19a6e1d7418cb96ff1b36b4c1367a329dbab2b302eda029fdc62453612461f5c52fbd09e931aa4d89e2b1f36c99db388bd482dab4f6), NONCE(43be6e3e8038e4856c1d6c9a880e470af81c7617ec9438255accd2d3e9ecf706), NOTIFY(NAT_DETECTION_SOURCE_IP(data=fdf1696fb2bea54b07d0ecd321732b7908a4a2a8)), NOTIFY(NAT_DETECTION_DESTINATION_IP(data=c773baab886de0438d356628f66e2c2d344bbfcc)), NOTIFY(IKEV2_FRAGMENTATION_SUPPORTED()), NOTIFY(SIGNATURE_HASH_ALGORITHMS(data=0001000200030004))) Exception in callback _SelectorDatagramTransport._read_ready() handle: <Handle _SelectorDatagramTransport._read_ready()> Traceback (most recent call last): File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run self._context.run(self._callback, self._args) File "/usr/lib/python3.10/asyncio/selector_events.py", line 1026, in _read_ready self._protocol.datagram_received(data, addr) File "/usr/local/lib/python3.10/dist-packages/pvpn/server.py", line 394, in datagram_received session.process(request, stream, addr[:2], lambda response: self.transport.sendto(response_header+response, addr)) File "/usr/local/lib/python3.10/dist-packages/pvpn/server.py", line 273, in process prefered_dh = chosen_proposal.get_transform(enums.Transform.DH).id AttributeError: 'NoneType' object has no attribute 'get_transform' IKE_SA_INIT(spi_i=2158a8c77dbd4a0f, spi_r=0000000000000000, version=2.0, flag=MsgFlag.Initiator, message_id=0, SA(IKE:1(spi=None, ENCR_AES_CTR(keylen=256), ENCR_AES_CBC(keylen=256), ENCR_AES_CTR(keylen=192), ENCR_AES_CBC(keylen=192), ENCR_AES_CTR(keylen=128), ENCR_AES_CBC(keylen=128), AUTH_HMAC_SHA2_512_256, AUTH_HMAC_SHA2_384_192, AUTH_HMAC_SHA2_256_128, AUTH_AES_XCBC_96, AUTH_AES_CMAC_96, DH_16, DH_31, DH_15, DH_14, PRF_HMAC_SHA1, PRF_AES128_XCBC, PRF_HMAC_SHA2_256, PRF_HMAC_SHA2_384, PRF_HMAC_SHA2_512, PRF_AES128_CMAC), IKE:2(spi=None, ENCR_CHACHA20_POLY1305, ENCR_AES_GCM_16(keylen=256), ENCR_AES_GCM_12(keylen=256), ENCR_AES_GCM_8(keylen=256), ENCR_AES_GCM_16(keylen=192), ENCR_AES_GCM_12(keylen=192), ENCR_AES_GCM_8(keylen=192), ENCR_AES_GCM_16(keylen=128), ENCR_AES_GCM_12(keylen=128), ENCR_AES_GCM_8(keylen=128), DH_16, DH_31, DH_15, DH_14, PRF_HMAC_SHA1, PRF_AES128_XCBC, PRF_HMAC_SHA2_256, PRF_HMAC_SHA2_384, PRF_HMAC_SHA2_512, PRF_AES128_CMAC)), KE(16, 797162594ca822f4f801fa370c9a1934bc8def08eba1d75d86f74f2d78de76d2af692d22f89e5ff19c9e57b0f4f59e9af37cf2c0a486cd68ff2007fff03243ceaaf8b568a55f1a322dcc8a27ec18891a7986f37c3924070eb044756e5390306b2ab08df773fa44ca63811bb7e47642c7e71298f091027fbe7868c15ba8953750fd22455fbaac9929af4ba75c088fab5a5dc8d3f0b44c7e81becbb32de935e3f8c2326759d007d06e38531d87698f20d4c75285d44b1fd288a567960dd32f9a0c087f20ae7cfa64ad6eeaa1b200f70ce6177484e3f8ba126b284dbf2419056f711a9a92fa03d8a95a56f980a34af9dcf16ed529c4be55576464a7f478b207b823fa27eebe0d317fb0ff69b476da0868736bc9f643203d0c3dce4a33535ea79ab50466fc210abd89f0cc56179474456c043b2be934d753c85e1b285465cd3442132ac4072cdf9c2c6a366b98ab582a3496eead4684c16e61bc9c1414a390a6842aca44322f0fdc8b5eb7c381b69a6b2a9f5324f8d98f0e672605b4dacbdfbac6547a6b1d07594c00d6621351512d73102f47fa48d1fdbef5a7cb942c97efdb5ba4db2d90f1ff39ecd210b4df46e40e2640f54d9a986a8f64569f190fe66b803555e9c0942b072adf27c11ef19a6e1d7418cb96ff1b36b4c1367a329dbab2b302eda029fdc62453612461f5c52fbd09e931aa4d89e2b1f36c99db388bd482dab4f6), NONCE(43be6e3e8038e4856c1d6c9a880e470af81c7617ec9438255accd2d3e9ecf706), NOTIFY(NAT_DETECTION_SOURCE_IP(data=fdf1696fb2bea54b07d0ecd321732b7908a4a2a8)), NOTIFY(NAT_DETECTION_DESTINATION_IP(data=c773baab886de0438d356628f66e2c2d344bbfcc)), NOTIFY(IKEV2_FRAGMENTATION_SUPPORTED()), NOTIFY(SIGNATURE_HASH_ALGORITHMS(data=0001000200030004))) Exception in callback _SelectorDatagramTransport._read_ready() handle: <Handle _SelectorDatagramTransport._read_ready()> Traceback (most recent call last): File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run self._context.run(self._callback, *self._args) File "/usr/lib/python3.10/asyncio/selector_events.py", line 1026, in _read_ready self._protocol.datagram_received(data, addr) File "/usr/local/lib/python3.10/dist-packages/pvpn/server.py", line 394, in datagram_received session.process(request, stream, addr[:2], lambda response: self.transport.sendto(response_header+response, addr)) File "/usr/local/lib/python3.10/dist-packages/pvpn/server.py", line 273, in process prefered_dh = chosen_proposal.get_transform(enums.Transform.DH).id AttributeError: 'NoneType' object has no attribute 'get_transform'

IKE_SA_INIT(spi_i=2158a8c77dbd4a0f, spi_r=0000000000000000, version=2.0, flag=MsgFlag.Initiator, message_id=0, SA(IKE:1(spi=None, ENCR_AES_CTR(keylen=256), ENCR_AES_CBC(keylen=256), ENCR_AES_CTR(keylen=192), ENCR_AES_CBC(keylen=192), ENCR_AES_CTR(keylen=128), ENCR_AES_CBC(keylen=128), AUTH_HMAC_SHA2_512_256, AUTH_HMAC_SHA2_384_192, AUTH_HMAC_SHA2_256_128, AUTH_AES_XCBC_96, AUTH_AES_CMAC_96, DH_16, DH_31, DH_15, DH_14, PRF_HMAC_SHA1, PRF_AES128_XCBC, PRF_HMAC_SHA2_256, PRF_HMAC_SHA2_384, PRF_HMAC_SHA2_512, PRF_AES128_CMAC), IKE:2(spi=None, ENCR_CHACHA20_POLY1305, ENCR_AES_GCM_16(keylen=256), ENCR_AES_GCM_12(keylen=256), ENCR_AES_GCM_8(keylen=256), ENCR_AES_GCM_16(keylen=192), ENCR_AES_GCM_12(keylen=192), ENCR_AES_GCM_8(keylen=192), ENCR_AES_GCM_16(keylen=128), ENCR_AES_GCM_12(keylen=128), ENCR_AES_GCM_8(keylen=128), DH_16, DH_31, DH_15, DH_14, PRF_HMAC_SHA1, PRF_AES128_XCBC, PRF_HMAC_SHA2_256, PRF_HMAC_SHA2_384, PRF_HMAC_SHA2_512, PRF_AES128_CMAC)), KE(16, 797162594ca822f4f801fa370c9a1934bc8def08eba1d75d86f74f2d78de76d2af692d22f89e5ff19c9e57b0f4f59e9af37cf2c0a486cd68ff2007fff03243ceaaf8b568a55f1a322dcc8a27ec18891a7986f37c3924070eb044756e5390306b2ab08df773fa44ca63811bb7e47642c7e71298f091027fbe7868c15ba8953750fd22455fbaac9929af4ba75c088fab5a5dc8d3f0b44c7e81becbb32de935e3f8c2326759d007d06e38531d87698f20d4c75285d44b1fd288a567960dd32f9a0c087f20ae7cfa64ad6eeaa1b200f70ce6177484e3f8ba126b284dbf2419056f711a9a92fa03d8a95a56f980a34af9dcf16ed529c4be55576464a7f478b207b823fa27eebe0d317fb0ff69b476da0868736bc9f643203d0c3dce4a33535ea79ab50466fc210abd89f0cc56179474456c043b2be934d753c85e1b285465cd3442132ac4072cdf9c2c6a366b98ab582a3496eead4684c16e61bc9c1414a390a6842aca44322f0fdc8b5eb7c381b69a6b2a9f5324f8d98f0e672605b4dacbdfbac6547a6b1d07594c00d6621351512d73102f47fa48d1fdbef5a7cb942c97efdb5ba4db2d90f1ff39ecd210b4df46e40e2640f54d9a986a8f64569f190fe66b803555e9c0942b072adf27c11ef19a6e1d7418cb96ff1b36b4c1367a329dbab2b302eda029fdc62453612461f5c52fbd09e931aa4d89e2b1f36c99db388bd482dab4f6), NONCE(43be6e3e8038e4856c1d6c9a880e470af81c7617ec9438255accd2d3e9ecf706), NOTIFY(NAT_DETECTION_SOURCE_IP(data=fdf1696fb2bea54b07d0ecd321732b7908a4a2a8)), NOTIFY(NAT_DETECTION_DESTINATION_IP(data=c773baab886de0438d356628f66e2c2d344bbfcc)), NOTIFY(IKEV2_FRAGMENTATION_SUPPORTED()), NOTIFY(SIGNATURE_HASH_ALGORITHMS(data=0001000200030004))) Exception in callback _SelectorDatagramTransport._read_ready() handle: <Handle _SelectorDatagramTransport._read_ready()> Traceback (most recent call last): File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run self._context.run(self._callback, self._args) File "/usr/lib/python3.10/asyncio/selector_events.py", line 1026, in _read_ready self._protocol.datagram_received(data, addr) File "/usr/local/lib/python3.10/dist-packages/pvpn/server.py", line 394, in datagram_received session.process(request, stream, addr[:2], lambda response: self.transport.sendto(response_header+response, addr)) File "/usr/local/lib/python3.10/dist-packages/pvpn/server.py", line 273, in process prefered_dh = chosen_proposal.get_transform(enums.Transform.DH).id AttributeError: 'NoneType' object has no attribute 'get_transform' IKE_SA_INIT(spi_i=2158a8c77dbd4a0f, spi_r=0000000000000000, version=2.0, flag=MsgFlag.Initiator, message_id=0, SA(IKE:1(spi=None, ENCR_AES_CTR(keylen=256), ENCR_AES_CBC(keylen=256), ENCR_AES_CTR(keylen=192), ENCR_AES_CBC(keylen=192), ENCR_AES_CTR(keylen=128), ENCR_AES_CBC(keylen=128), AUTH_HMAC_SHA2_512_256, AUTH_HMAC_SHA2_384_192, AUTH_HMAC_SHA2_256_128, AUTH_AES_XCBC_96, AUTH_AES_CMAC_96, DH_16, DH_31, DH_15, DH_14, PRF_HMAC_SHA1, PRF_AES128_XCBC, PRF_HMAC_SHA2_256, PRF_HMAC_SHA2_384, PRF_HMAC_SHA2_512, PRF_AES128_CMAC), IKE:2(spi=None, ENCR_CHACHA20_POLY1305, ENCR_AES_GCM_16(keylen=256), ENCR_AES_GCM_12(keylen=256), ENCR_AES_GCM_8(keylen=256), ENCR_AES_GCM_16(keylen=192), ENCR_AES_GCM_12(keylen=192), ENCR_AES_GCM_8(keylen=192), ENCR_AES_GCM_16(keylen=128), ENCR_AES_GCM_12(keylen=128), ENCR_AES_GCM_8(keylen=128), DH_16, DH_31, DH_15, DH_14, PRF_HMAC_SHA1, PRF_AES128_XCBC, PRF_HMAC_SHA2_256, PRF_HMAC_SHA2_384, PRF_HMAC_SHA2_512, PRF_AES128_CMAC)), KE(16, 797162594ca822f4f801fa370c9a1934bc8def08eba1d75d86f74f2d78de76d2af692d22f89e5ff19c9e57b0f4f59e9af37cf2c0a486cd68ff2007fff03243ceaaf8b568a55f1a322dcc8a27ec18891a7986f37c3924070eb044756e5390306b2ab08df773fa44ca63811bb7e47642c7e71298f091027fbe7868c15ba8953750fd22455fbaac9929af4ba75c088fab5a5dc8d3f0b44c7e81becbb32de935e3f8c2326759d007d06e38531d87698f20d4c75285d44b1fd288a567960dd32f9a0c087f20ae7cfa64ad6eeaa1b200f70ce6177484e3f8ba126b284dbf2419056f711a9a92fa03d8a95a56f980a34af9dcf16ed529c4be55576464a7f478b207b823fa27eebe0d317fb0ff69b476da0868736bc9f643203d0c3dce4a33535ea79ab50466fc210abd89f0cc56179474456c043b2be934d753c85e1b285465cd3442132ac4072cdf9c2c6a366b98ab582a3496eead4684c16e61bc9c1414a390a6842aca44322f0fdc8b5eb7c381b69a6b2a9f5324f8d98f0e672605b4dacbdfbac6547a6b1d07594c00d6621351512d73102f47fa48d1fdbef5a7cb942c97efdb5ba4db2d90f1ff39ecd210b4df46e40e2640f54d9a986a8f64569f190fe66b803555e9c0942b072adf27c11ef19a6e1d7418cb96ff1b36b4c1367a329dbab2b302eda029fdc62453612461f5c52fbd09e931aa4d89e2b1f36c99db388bd482dab4f6), NONCE(43be6e3e8038e4856c1d6c9a880e470af81c7617ec9438255accd2d3e9ecf706), NOTIFY(NAT_DETECTION_SOURCE_IP(data=fdf1696fb2bea54b07d0ecd321732b7908a4a2a8)), NOTIFY(NAT_DETECTION_DESTINATION_IP(data=c773baab886de0438d356628f66e2c2d344bbfcc)), NOTIFY(IKEV2_FRAGMENTATION_SUPPORTED()), NOTIFY(SIGNATURE_HASH_ALGORITHMS(data=0001000200030004))) Exception in callback _SelectorDatagramTransport._read_ready() handle: <Handle _SelectorDatagramTransport._read_ready()> Traceback (most recent call last): File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run self._context.run(self._callback, self._args) File "/usr/lib/python3.10/asyncio/selector_events.py", line 1026, in _read_ready self._protocol.datagram_received(data, addr) File "/usr/local/lib/python3.10/dist-packages/pvpn/server.py", line 394, in datagram_received session.process(request, stream, addr[:2], lambda response: self.transport.sendto(response_header+response, addr)) File "/usr/local/lib/python3.10/dist-packages/pvpn/server.py", line 273, in process prefered_dh = chosen_proposal.get_transform(enums.Transform.DH).id AttributeError: 'NoneType' object has no attribute 'get_transform'

`

LinuxSushi commented 1 year ago

I'm having the same issue. Also Android 12.

eyotang commented 8 months ago

same issue