1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-25 20:02:37 +03:00

Merge pull request #1500 from asdwsda/master

espota: fixed remaining python 3.5 incompatibility
This commit is contained in:
Ivan Grokhotkov 2016-01-26 16:22:57 +03:00
commit 017dbc037e

View File

@ -104,10 +104,10 @@ def serve(remoteAddr, localAddr, remotePort, localPort, password, filename, comm
if(data.startswith('AUTH')):
nonce = data.split()[1]
cnonce_text = '%s%u%s%s' % (filename, content_size, file_md5, remoteAddr)
cnonce = hashlib.md5(cnonce_text).hexdigest()
passmd5 = hashlib.md5(password).hexdigest()
cnonce = hashlib.md5(cnonce_text.encode()).hexdigest()
passmd5 = hashlib.md5(password.encode()).hexdigest()
result_text = '%s:%s:%s' % (passmd5 ,nonce, cnonce)
result = hashlib.md5(result_text).hexdigest()
result = hashlib.md5(result_text.encode()).hexdigest()
sys.stderr.write('Authenticating...')
sys.stderr.flush()
message = '%d %s %s\n' % (AUTH, cnonce, result)