1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

Add sanity check so we do not trigger an update from wrong data

This commit is contained in:
Me No Dev
2015-11-09 01:47:51 +02:00
parent 14bb946896
commit 13b8cc0a27
2 changed files with 20 additions and 2 deletions

View File

@ -34,6 +34,7 @@ import hashlib
# Commands
FLASH = 0
SPIFFS = 100
AUTH = 200
def serve(remoteAddr, remotePort, password, filename, command = FLASH):
@ -78,7 +79,7 @@ def serve(remoteAddr, remotePort, password, filename, command = FLASH):
result = hashlib.md5(result_text).hexdigest()
sys.stderr.write('Authenticating...')
sys.stderr.flush()
message = '%s %s\n' % (cnonce, result)
message = '%d %s %s\n' % (AUTH, cnonce, result)
sock2.sendto(message, remote_address)
sock2.settimeout(10)
try: