We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b30fc0d + 39e170c commit a4465a7Copy full SHA for a4465a7
1 file changed
broadlink/__init__.py
@@ -179,8 +179,16 @@ def auth(self):
179
aes = AES.new(bytes(self.key), AES.MODE_CBC, bytes(self.iv))
180
payload = aes.decrypt(bytes(enc_payload))
181
182
+ if not payload:
183
+ return False
184
+
185
+ key = payload[0x04:0x14]
186
+ if len(key) % 16 != 0:
187
188
189
self.id = payload[0x00:0x04]
- self.key = payload[0x04:0x14]
190
+ self.key = key
191
+ return True
192
193
def get_type(self):
194
return self.type
0 commit comments