Fixed key import ranges in ecc sign.py

Same fix as wolfcrypt-py/b79527f876385ecfc23ff47696c32eaf74ff792c

The array slicing in ecc.decode_key_raw() call wrongly assumed array as
inclusive (i.e. [0:31] to include from 0 to 31, instead of the correct
form [0:32]).
pull/149/head
Daniele Lacamera 2021-09-27 19:19:31 +02:00
parent 0a2433a7a8
commit 157a03edd3
1 changed files with 1 additions and 1 deletions

View File

@ -409,7 +409,7 @@ elif not sha_only and not manual_sign:
if sign == 'ecc256':
ecc = ciphers.EccPrivate()
ecc.decode_key_raw(wolfboot_key_buffer[0:31], wolfboot_key_buffer[32:63], wolfboot_key_buffer[64:])
ecc.decode_key_raw(wolfboot_key_buffer[0:32], wolfboot_key_buffer[32:64], wolfboot_key_buffer[64:])
pubkey = wolfboot_key_buffer[0:64]
if sign == 'rsa2048':