RangerDigital / senko

🦊 Simplest OTA update solution for your Micropython projects.
GNU General Public License v3.0
95 stars 21 forks source link

OSError: only one active hash operation is permitted at a time #6

Open nznobody opened 2 years ago

nznobody commented 2 years ago

def _check_hash(self, x, y) should calculate sha one at a time to support certain implementations (Pycom MicroPython 1.20.3.b4 [v1.11-95ab8f63] on 2021-09-10; FiPy with ESP32)

https://github.com/RangerDigital/senko/blob/3e69507708cfe471cf40eaef479238fbdbbe4ea4/senko/senko.py#L26

Suggest simply doing them one after another:

        x_hash = sha(x.encode())
        x = x_hash.digest()
        y_hash = sha(y.encode())
        y = y_hash.digest()