postlund / pyatv

A client library for Apple TV and AirPlay devices
https://pyatv.dev
MIT License
895 stars 100 forks source link

Pairing failed #2257

Open JoechiaoPshan opened 1 year ago

JoechiaoPshan commented 1 year ago

What do you need help with?

pyatv version : 0.14.2

Error Logs

> atvremote -s 192.168.31.106 --debug --protocol companion pair

2023-10-20 00:06:57 DEBUG [pyatv.scripts]: Running with pyatv 0.14.2
2023-10-20 00:06:57 DEBUG [pyatv.storage.file_storage]: Loading settings from /home/joechiao/.pyatv.conf
2023-10-20 00:06:57 DEBUG [pyatv.support.knock]: Knocking at port 3689 on 192.168.31.106
2023-10-20 00:06:57 DEBUG [pyatv.support.knock]: Knocking at port 7000 on 192.168.31.106
2023-10-20 00:06:57 DEBUG [pyatv.support.knock]: Knocking at port 49152 on 192.168.31.106
2023-10-20 00:06:57 DEBUG [pyatv.support.knock]: Knocking at port 32498 on 192.168.31.106
2023-10-20 00:06:57 DEBUG [pyatv.core.scan]: Auto-discovered Joechiao 的 Apple TV 4K at 192.168.31.106:49153 via Protocol.Companion ({'rpmac': '2', 'rphn': 'b3579e9e9235', 'rpfl': '0xB6782', 'rpha': '9b248aa60109', 'rpmd': 'AppleTV11,1', 'rpvr': '500.61.7', 'rpad': '5775a2d957e6', 'rphi': '9cb40e17196c', 'rpba': '5C:89:11:30:F7:CE', 'rpmrtid': 'C54FC051-3FFA-4FEC-B33A-266EF2256BB9'})
2023-10-20 00:06:57 DEBUG [pyatv.core.scan]: Auto-discovered Joechiao 的 Apple TV 4K at 192.168.31.106:7000 via Protocol.AirPlay ({'acl': '0', 'btaddr': '00:00:00:00:00:00', 'deviceid': 'F0:B3:EC:45:A9:BB', 'fex': '1d9/St5/F7w4oQY', 'features': '0x4A7FDFD5,0xBC177FDE', 'flags': '0x18644', 'gid': 'F6CF21EB-8650-4B46-954F-399B0CBCF2B6', 'igl': '1', 'gcgl': '1', 'model': 'AppleTV11,1', 'protovers': '1.1', 'pi': '5c1ac541-225e-4df9-8132-7b89de9faf8f', 'psi': 'C54FC051-3FFA-4FEC-B33A-266EF2256BB9', 'pk': 'b61ff632f50cd8a8e1d1e073e2484006292a7320fc93aa9367476b26fe94634d', 'srcvers': '710.79.1', 'osvers': '17.0', 'vv': '1'})
2023-10-20 00:06:57 DEBUG [pyatv.core.scan]: Auto-discovered F0B3EC45A9BB@Joechiao 的 Apple TV 4K at 192.168.31.106:7000 via Protocol.RAOP ({'cn': '0,1,2,3', 'da': 'true', 'et': '0,3,5', 'ft': '0x4A7FDFD5,0xBC177FDE', 'sf': '0x18644', 'md': '0,1,2', 'am': 'AppleTV11,1', 'pk': 'b61ff632f50cd8a8e1d1e073e2484006292a7320fc93aa9367476b26fe94634d', 'tp': 'UDP', 'vn': '65537', 'vs': '710.79.1', 'ov': '17.0', 'vv': '1'})
2023-10-20 00:06:57 DEBUG [pyatv.protocols.companion.pairing]: Start pairing Companion
2023-10-20 00:06:57 DEBUG [pyatv.protocols.companion.connection]: Connected to companion device 192.168.31.106:49153
2023-10-20 00:06:57 DEBUG [pyatv.protocols.companion.protocol]: Companion credentials: None
2023-10-20 00:06:57 DEBUG [pyatv.protocols.companion.protocol]: Exchange OPACK: {'_pd': b'\x00\x01\x00\x06\x01\x01', '_pwTy': 1}
2023-10-20 00:06:57 DEBUG [pyatv.protocols.companion.protocol]: Send OPACK: {'_pd': b'\x00\x01\x00\x06\x01\x01', '_pwTy': 1, '_x': 14288}
2023-10-20 00:06:57 DEBUG [pyatv.protocols.companion.connection]: >> Send data (Data=e3435f706476000100060101455f7077547909425f7831d037, FrameType=03)
2023-10-20 00:06:57 DEBUG [pyatv.protocols.companion.connection]: Received data (Data=040001a4e1435f7064929c0106010202106278ff9f0d50ec8d3cb92f9e4d31677603ff84d3a5a093a4ebfcfe5f0e621cbed2b39771a95330bd06467993c59a72b73ec1318726460e9a4f33b9fe11a098c8434f130aea5ed19df832d1d4a50ad823cec052548bfaba9696a8c01494440492bdd392ab718463174dfab2319c7488f0afa164161eecfb01cb3225d151482b2cf6cc0806a5905d21d1bfc12d47708d95d88c0d1ecd3248be5d40a8957f64134602ee38b2a0b05494d4f8ccb978f11ec6e5c023393029f1c6f85924cb92b4ed28dfcd9f2db57cbc433c06dc4656eaa3e192c737af8e38ad71350d5d2292596a1ce7b5f877029c6e717c836910c76...)
2023-10-20 00:06:57 DEBUG [pyatv.protocols.companion.protocol]: Received frame FrameType.PS_Next: b'\xe1C_pd\x92\x9c\x01\x06\x01\x02\x02\x10bx\xff\x9f\rP\xec\x8d<\xb9/\x9eM1gv\x03\xff\x84\xd3\xa5\xa0\x93\xa4\xeb\xfc\xfe_\x0eb\x1c\xbe\xd2\xb3\x97q\xa9S0\xbd\x06Fy\x93\xc5\x9ar\xb7>\xc11\x87&F\x0e\x9aO3\xb9\xfe\x11\xa0\x98\xc8CO\x13\n\xea^\xd1\x9d\xf82\xd1\xd4\xa5\n\xd8#\xce\xc0RT\x8b\xfa\xba\x96\x96\xa8\xc0\x14\x94D\x04\x92\xbd\xd3\x92\xabq\x84c\x17M\xfa\xb21\x9ct\x88\xf0\xaf\xa1d\x16\x1e\xec\xfb\x01\xcb2%\xd1QH+,\xf6\xcc\x08\x06\xa5\x90]!\xd1\xbf\xc1-Gp\x8d\x95\xd8\x8c\r\x1e\xcd2H\xbe]@\xa8\x95\x7fd\x13F\x02\xee8\xb2\xa0\xb0T\x94\xd4\xf8\xcc\xb9x\xf1\x1e\xc6\xe5\xc0#90)\xf1\xc6\xf8Y$\xcb\x92\xb4\xed(\xdf\xcd\x9f-\xb5|\xbcC<\x06\xdcFV\xea\xa3\xe1\x92\xc77\xaf\x8e8\xadq5\r]"\x92Yj\x1c\xe7\xb5\xf8w\x02\x9cnq|\x83i\x10\xc7g\x98\xaei\'\x99\xe45L\x04\x80\x9d\xb00\x1fB* \xe3k\x1bp\xb9\x95\xa1\xd4\xa0\xf4|O\xad\x05\xa8\x9e\xc5c\x03\x81\x99\x0f\x99\xb5\x9fk\xdc\xd1\xbf\x97#\x90$/\x89\x9a\xf6\xf25r\xf1:%\xfe\xf9 \xcf+\x0e\xc5\xb7\x96\x87;\r\xcf 1\xb2\x81\xdc\xfdaC\xe5\xae\xdb\xb3\xbc9X[\xe2S\xdc\xe4\t\xa3Z,\x93\x98\xd3y\x9at\xbe<\xc1\xd06\x1e\xae\xf9\xf5\xd1\xdc\xed\xf4\x88!\xb8/_\x17_\x00\x00\xa6\x10.;\xb6\x1e\xdb \xa4\xf3\xa4\xd2}G\x97\xd9X\x9a\xf5\x05\xb9\x0c6\x17\x85(=F\x05\xba\x1a\xcd\x87\xc00\xb3\xff2\xf5\x7f\x9a\x1b\x01\x01'
2023-10-20 00:06:57 DEBUG [pyatv.protocols.companion.protocol]: Process incoming auth frame (FrameType.PS_Next): {'_pd': b'\x06\x01\x02\x02\x10bx\xff\x9f\rP\xec\x8d<\xb9/\x9eM1gv\x03\xff\x84\xd3\xa5\xa0\x93\xa4\xeb\xfc\xfe_\x0eb\x1c\xbe\xd2\xb3\x97q\xa9S0\xbd\x06Fy\x93\xc5\x9ar\xb7>\xc11\x87&F\x0e\x9aO3\xb9\xfe\x11\xa0\x98\xc8CO\x13\n\xea^\xd1\x9d\xf82\xd1\xd4\xa5\n\xd8#\xce\xc0RT\x8b\xfa\xba\x96\x96\xa8\xc0\x14\x94D\x04\x92\xbd\xd3\x92\xabq\x84c\x17M\xfa\xb21\x9ct\x88\xf0\xaf\xa1d\x16\x1e\xec\xfb\x01\xcb2%\xd1QH+,\xf6\xcc\x08\x06\xa5\x90]!\xd1\xbf\xc1-Gp\x8d\x95\xd8\x8c\r\x1e\xcd2H\xbe]@\xa8\x95\x7fd\x13F\x02\xee8\xb2\xa0\xb0T\x94\xd4\xf8\xcc\xb9x\xf1\x1e\xc6\xe5\xc0#90)\xf1\xc6\xf8Y$\xcb\x92\xb4\xed(\xdf\xcd\x9f-\xb5|\xbcC<\x06\xdcFV\xea\xa3\xe1\x92\xc77\xaf\x8e8\xadq5\r]"\x92Yj\x1c\xe7\xb5\xf8w\x02\x9cnq|\x83i\x10\xc7g\x98\xaei\'\x99\xe45L\x04\x80\x9d\xb00\x1fB* \xe3k\x1bp\xb9\x95\xa1\xd4\xa0\xf4|O\xad\x05\xa8\x9e\xc5c\x03\x81\x99\x0f\x99\xb5\x9fk\xdc\xd1\xbf\x97#\x90$/\x89\x9a\xf6\xf25r\xf1:%\xfe\xf9 \xcf+\x0e\xc5\xb7\x96\x87;\r\xcf 1\xb2\x81\xdc\xfdaC\xe5\xae\xdb\xb3\xbc9X[\xe2S\xdc\xe4\t\xa3Z,\x93\x98\xd3y\x9at\xbe<\xc1\xd06\x1e\xae\xf9\xf5\xd1\xdc\xed\xf4\x88!\xb8/_\x17_\x00\x00\xa6\x10.;\xb6\x1e\xdb \xa4\xf3\xa4\xd2}G\x97\xd9X\x9a\xf5\x05\xb9\x0c6\x17\x85(=F\x05\xba\x1a\xcd\x87\xc00\xb3\xff2\xf5\x7f\x9a\x1b\x01\x01'}
2023-10-20 00:06:57 DEBUG [pyatv.protocols.companion.auth]: Got pub key and salt (PubKey=84d3a5a093a4ebfcfe5f0e621cbed2b39771a95330bd06467993c59a72b73ec1318726460e9a4f33b9fe11a098c8434f130aea5ed19df832d1d4a50ad823cec052548bfaba9696a8c01494440492bdd392ab718463174dfab2319c7488f0afa164161eecfb01cb3225d151482b2cf6cc0806a5905d21d1bfc12d47708d95d88c0d1ecd3248be5d40a8957f64134602ee38b2a0b05494d4f8ccb978f11ec6e5c023393029f1c6f85924cb92b4ed28dfcd9f2db57cbc433c06dc4656eaa3e192c737af8e38ad71350d5d2292596a1ce7b5f877029c6e717c836910c76798ae692799e4354c04809db0301f422a20e36b1b70b995a1d4a0f47c4fad05a89ec56..., Salt=6278ff9f0d50ec8d3cb92f9e4d316776)
Enter PIN on screen: 7082
2023-10-20 00:07:01 DEBUG [pyatv.protocols.companion.pairing]: Companion PIN changed to 7082
2023-10-20 00:07:01 DEBUG [pyatv.protocols.companion.pairing]: Finish pairing Companion
2023-10-20 00:07:02 DEBUG [pyatv.auth.hap_srp]: Client (Proof=b19c8138b7536352e51c250ac19cd63b070819a0854cc44c1c36fccc89123205f60e0b583d673e7c87d7cb56ca976b59d487442c21129b0f32ebf18f1029bdce, Public=8c68bb84634b70633e409e33514e54457ec9fdb679bafa2b2a24825d8590634d5ddaf5bd8562c5cd37329ac1e6111ff132146fb6ea6b0619b88bd40647f4f684d91bac6032ddc588a1036912beec473d58539b368399c68ee58be20178196f4ca828cd43888ab87ab25fc3eb9916be4af9fb190952f7e6d5d7812662cabc71e60514ab2ccc8a12eed70afcfe73705f9c1dda376592a26f62f0d23975a029e9ae044a2faf11e798bd5028ecd0c1a37bc1bcb8fe8418747e9edbd0a3a95411d2bc7fbf3902fa7587cc2fe9d0eecf240ec653dc4c26a04eaf180f93ec357c5441423910e261eee93d5a63398d74b7ba66033d94bf2f800b31981796c5c73625b...)
2023-10-20 00:07:02 DEBUG [pyatv.protocols.companion.protocol]: Exchange OPACK: {'_pd': b"\x06\x01\x03\x03\xff\x8ch\xbb\x84cKpc>@\x9e3QNTE~\xc9\xfd\xb6y\xba\xfa+*$\x82]\x85\x90cM]\xda\xf5\xbd\x85b\xc5\xcd72\x9a\xc1\xe6\x11\x1f\xf12\x14o\xb6\xeak\x06\x19\xb8\x8b\xd4\x06G\xf4\xf6\x84\xd9\x1b\xac`2\xdd\xc5\x88\xa1\x03i\x12\xbe\xecG=XS\x9b6\x83\x99\xc6\x8e\xe5\x8b\xe2\x01x\x19oL\xa8(\xcdC\x88\x8a\xb8z\xb2_\xc3\xeb\x99\x16\xbeJ\xf9\xfb\x19\tR\xf7\xe6\xd5\xd7\x81&b\xca\xbcq\xe6\x05\x14\xab,\xcc\x8a\x12\xee\xd7\n\xfc\xfesp_\x9c\x1d\xda7e\x92\xa2ob\xf0\xd29u\xa0)\xe9\xae\x04J/\xaf\x11\xe7\x98\xbdP(\xec\xd0\xc1\xa3{\xc1\xbc\xb8\xfe\x84\x18t~\x9e\xdb\xd0\xa3\xa9T\x11\xd2\xbc\x7f\xbf9\x02\xfau\x87\xcc/\xe9\xd0\xee\xcf$\x0e\xc6S\xdcL&\xa0N\xaf\x18\x0f\x93\xec5|TAB9\x10\xe2a\xee\xe9=Zc9\x8dt\xb7\xbaf\x03=\x94\xbf/\x80\x0b1\x98\x17\x96\xc5\xc76%\xb7\x03\x81\x19Ag\x183\xa8\x04+\xfb\xb6#\x85p\xa2\xb8\xd1\x10q\x1b\x85A\x18Y\x1d&\xc60Tlil\xc9V]))\x1b6\xa8\xe3Y\xcb$\xb0/@\xe9\xc1\x1b\xf0\xef5{\xad7\xfa\xdcr\xa4Ch\xd3,,Q/\x11\xd4\xfa\xa3wP\x1c6\xb3\xf9\x94\xf2\n\xea\xae\x8664`\x10b=Rt'\xdc\xfd\\\xb9\x9c\xa8\x91\t&\x87v6aq\xfe\xf0>\xca\x0bozd\xc0\x81\xbaw\xec\xfe\x03\xc3\xbf\xf9\xc5\xb8U<S\xe8\x04@\xb1\x9c\x818\xb7ScR\xe5\x1c%\n\xc1\x9c\xd6;\x07\x08\x19\xa0\x85L\xc4L\x1c6\xfc\xcc\x89\x122\x05\xf6\x0e\x0bX=g>|\x87\xd7\xcbV\xca\x97kY\xd4\x87D,!\x12\x9b\x0f2\xeb\xf1\x8f\x10)\xbd\xce", '_pwTy': 1}
2023-10-20 00:07:02 DEBUG [pyatv.protocols.companion.protocol]: Send OPACK: {'_pd': b"\x06\x01\x03\x03\xff\x8ch\xbb\x84cKpc>@\x9e3QNTE~\xc9\xfd\xb6y\xba\xfa+*$\x82]\x85\x90cM]\xda\xf5\xbd\x85b\xc5\xcd72\x9a\xc1\xe6\x11\x1f\xf12\x14o\xb6\xeak\x06\x19\xb8\x8b\xd4\x06G\xf4\xf6\x84\xd9\x1b\xac`2\xdd\xc5\x88\xa1\x03i\x12\xbe\xecG=XS\x9b6\x83\x99\xc6\x8e\xe5\x8b\xe2\x01x\x19oL\xa8(\xcdC\x88\x8a\xb8z\xb2_\xc3\xeb\x99\x16\xbeJ\xf9\xfb\x19\tR\xf7\xe6\xd5\xd7\x81&b\xca\xbcq\xe6\x05\x14\xab,\xcc\x8a\x12\xee\xd7\n\xfc\xfesp_\x9c\x1d\xda7e\x92\xa2ob\xf0\xd29u\xa0)\xe9\xae\x04J/\xaf\x11\xe7\x98\xbdP(\xec\xd0\xc1\xa3{\xc1\xbc\xb8\xfe\x84\x18t~\x9e\xdb\xd0\xa3\xa9T\x11\xd2\xbc\x7f\xbf9\x02\xfau\x87\xcc/\xe9\xd0\xee\xcf$\x0e\xc6S\xdcL&\xa0N\xaf\x18\x0f\x93\xec5|TAB9\x10\xe2a\xee\xe9=Zc9\x8dt\xb7\xbaf\x03=\x94\xbf/\x80\x0b1\x98\x17\x96\xc5\xc76%\xb7\x03\x81\x19Ag\x183\xa8\x04+\xfb\xb6#\x85p\xa2\xb8\xd1\x10q\x1b\x85A\x18Y\x1d&\xc60Tlil\xc9V]))\x1b6\xa8\xe3Y\xcb$\xb0/@\xe9\xc1\x1b\xf0\xef5{\xad7\xfa\xdcr\xa4Ch\xd3,,Q/\x11\xd4\xfa\xa3wP\x1c6\xb3\xf9\x94\xf2\n\xea\xae\x8664`\x10b=Rt'\xdc\xfd\\\xb9\x9c\xa8\x91\t&\x87v6aq\xfe\xf0>\xca\x0bozd\xc0\x81\xbaw\xec\xfe\x03\xc3\xbf\xf9\xc5\xb8U<S\xe8\x04@\xb1\x9c\x818\xb7ScR\xe5\x1c%\n\xc1\x9c\xd6;\x07\x08\x19\xa0\x85L\xc4L\x1c6\xfc\xcc\x89\x122\x05\xf6\x0e\x0bX=g>|\x87\xd7\xcbV\xca\x97kY\xd4\x87D,!\x12\x9b\x0f2\xeb\xf1\x8f\x10)\xbd\xce", '_pwTy': 1, '_x': 14289}
2023-10-20 00:07:02 DEBUG [pyatv.protocols.companion.connection]: >> Send data (Data=e3435f706492c90106010303ff8c68bb84634b70633e409e33514e54457ec9fdb679bafa2b2a24825d8590634d5ddaf5bd8562c5cd37329ac1e6111ff132146fb6ea6b0619b88bd40647f4f684d91bac6032ddc588a1036912beec473d58539b368399c68ee58be20178196f4ca828cd43888ab87ab25fc3eb9916be4af9fb190952f7e6d5d7812662cabc71e60514ab2ccc8a12eed70afcfe73705f9c1dda376592a26f62f0d23975a029e9ae044a2faf11e798bd5028ecd0c1a37bc1bcb8fe8418747e9edbd0a3a95411d2bc7fbf3902fa7587cc2fe9d0eecf240ec653dc4c26a04eaf180f93ec357c5441423910e261eee93d5a63398d74b7ba66033d9..., FrameType=04)
2023-10-20 00:07:02 DEBUG [pyatv.protocols.companion.connection]: Received data (Data=0400004ce1435f70649145060104044071d4d868f48b695f214cd54c0a75cf6e9a888d1e74c0cd7dcee503c1d0171bc9616a6df8f0bffd1a710a82f7ee93689cfd91df4e8ac70ac9525791e62a8d72b3)
2023-10-20 00:07:02 DEBUG [pyatv.protocols.companion.protocol]: Received frame FrameType.PS_Next: b'\xe1C_pd\x91E\x06\x01\x04\x04@q\xd4\xd8h\xf4\x8bi_!L\xd5L\nu\xcfn\x9a\x88\x8d\x1et\xc0\xcd}\xce\xe5\x03\xc1\xd0\x17\x1b\xc9ajm\xf8\xf0\xbf\xfd\x1aq\n\x82\xf7\xee\x93h\x9c\xfd\x91\xdfN\x8a\xc7\n\xc9RW\x91\xe6*\x8dr\xb3'
2023-10-20 00:07:02 DEBUG [pyatv.protocols.companion.protocol]: Process incoming auth frame (FrameType.PS_Next): {'_pd': b'\x06\x01\x04\x04@q\xd4\xd8h\xf4\x8bi_!L\xd5L\nu\xcfn\x9a\x88\x8d\x1et\xc0\xcd}\xce\xe5\x03\xc1\xd0\x17\x1b\xc9ajm\xf8\xf0\xbf\xfd\x1aq\n\x82\xf7\xee\x93h\x9c\xfd\x91\xdfN\x8a\xc7\n\xc9RW\x91\xe6*\x8dr\xb3'}
2023-10-20 00:07:02 DEBUG [pyatv.protocols.companion.auth]: Device (Proof=71d4d868f48b695f214cd54c0a75cf6e9a888d1e74c0cd7dcee503c1d0171bc9616a6df8f0bffd1a710a82f7ee93689cfd91df4e8ac70ac9525791e62a8d72b3)
2023-10-20 00:07:02 ERROR [pyatv.scripts.atvremote]: Pairing failed
Traceback (most recent call last):
  File "/home/joechiao/.local/lib/python3.9/site-packages/pyatv/support/__init__.py", line 71, in error_handler
    return await func(*args, **kwargs)
  File "/home/joechiao/.local/lib/python3.9/site-packages/pyatv/protocols/companion/auth.py", line 99, in finish_pairing
    encrypted_data = self.srp.step3(name=display_name)
  File "/home/joechiao/.local/lib/python3.9/site-packages/pyatv/auth/hap_srp.py", line 203, in step3
    encrypted_data = chacha.encrypt(write_tlv(tlv), nonce="PS-Msg05".encode())
  File "/home/joechiao/.local/lib/python3.9/site-packages/pyatv/support/chacha20.py", line 49, in encrypt
    return self._enc_out.encrypt(nonce, data, aad)
  File "src/chacha20poly1305_reuseable/__init__.py", line 102, in chacha20poly1305_reuseable.ChaCha20Poly1305Reusable.encrypt
  File "src/chacha20poly1305_reuseable/__init__.py", line 120, in chacha20poly1305_reuseable.ChaCha20Poly1305Reusable.encrypt
OverflowError: Data too long. Max 2**32 bytes

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/joechiao/.local/lib/python3.9/site-packages/pyatv/scripts/atvremote.py", line 196, in pair
    await self._perform_pairing(pairing)
  File "/home/joechiao/.local/lib/python3.9/site-packages/pyatv/scripts/atvremote.py", line 229, in _perform_pairing
    await pairing.finish()
  File "/home/joechiao/.local/lib/python3.9/site-packages/pyatv/protocols/companion/pairing.py", line 58, in finish
    await error_handler(
  File "/home/joechiao/.local/lib/python3.9/site-packages/pyatv/support/__init__.py", line 77, in error_handler
    raise fallback(str(ex)) from ex
pyatv.exceptions.PairingError: Data too long. Max 2**32 bytes
2023-10-20 00:07:02 DEBUG [pyatv.protocols.companion.connection]: Closing connection
2023-10-20 00:07:02 DEBUG [pyatv.protocols.companion.connection]: Connection lost to remote device: None

I also tried atvremote wizard, the error logs are similar to above. Maybe OverflowError: Data too long. Max 2**32 bytes is the problem? Please help on this. Thanks a lot.

postlund commented 11 months ago

Hi and sorry for the delay! I just want to confirm if you still see this issue?

JoechiaoPshan commented 11 months ago

Hi, thanks for the reply. I just tested on 0.14.5 and the issue was still the same.

postlund commented 11 months ago

Would you be comfortable with modifying the source a bit? I would like to see the encoded TLV value around here:

https://github.com/postlund/pyatv/blob/2f7e2fd1b30e75f490171e0cb2a10592afba2546/pyatv/auth/hap_srp.py#L201

Adding something like this would be fine:

print(write_tlv(tlv))
JoechiaoPshan commented 11 months ago
b"\x01$38b263fb-03a9-4e9b-8e95-9007172ef363\x03 d\xc1\xcca\xb0S;\xf2\xef\xbb\xcd\xfd\x8d\xf7\xe8\xf1\x8fI1\xf5\x04w\xccg\x9f\xa7\x90\x92\xfc\xebG\xa8\n@z\xcb\xc3H:f\x0e\xbd\xc9\xc9p*\x0f\xd9\x02\x8e\x12\x07}\xa6A~\x0b\xce\x04=I\xc6\x0f\xf3\xee1\xb7g\x14\xfd\x81\xa3\xcan*\xfe/#\x8a\x82Z\xe5(W<J\x12'\x04\xcd\xb5O\xc6u\xbbW\x8e\x06\x11\x0c\xe1DnameEpyatv"

Here's the output value.

postlund commented 11 months ago

This doesn't make sense to me, that shouldn't be a problem. Can't you also add this:

print("length:", len(data))

here:

https://github.com/postlund/pyatv/blob/2f7e2fd1b30e75f490171e0cb2a10592afba2546/pyatv/support/chacha20.py#L48

Do you see any absurdly large lengths?

JoechiaoPshan commented 11 months ago
length: 152

It wasn't too large I suppose?

postlund commented 11 months ago

Nah, limit is 4GB (2^32). Suspecting either issues with encryption library or bug in python. Would it be possible for you to try with another/newer python version?

JoechiaoPshan commented 11 months ago

I'll try with other python version and report the result here later, thanks for the help!

postlund commented 11 months ago

Thanks for your quick help, let's hope we get good closure on this!