mirror of
https://github.com/polhenarejos/pico-hsm.git
synced 2026-01-17 01:18:06 +00:00
Add support for lock chip on secure_boot.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
9fa3758dad
commit
0ce89ae968
1 changed files with 2 additions and 1 deletions
|
|
@ -143,6 +143,7 @@ def parse_args():
|
||||||
parser_otp.add_argument('subcommand', choices=['read', 'write', 'secure_boot'], help='Read, write or enable Secure Boot', nargs='?')
|
parser_otp.add_argument('subcommand', choices=['read', 'write', 'secure_boot'], help='Read, write or enable Secure Boot', nargs='?')
|
||||||
parser_otp.add_argument('--row', help='OTP row (in HEX)', required='write' in sys.argv or 'read' in sys.argv)
|
parser_otp.add_argument('--row', help='OTP row (in HEX)', required='write' in sys.argv or 'read' in sys.argv)
|
||||||
parser_otp.add_argument('-d', '--data', help='Data to write (in HEX) [e.g. 0011223344556677889900AABBCCDDEEFF]', required='write' in sys.argv)
|
parser_otp.add_argument('-d', '--data', help='Data to write (in HEX) [e.g. 0011223344556677889900AABBCCDDEEFF]', required='write' in sys.argv)
|
||||||
|
parser_otp.add_argument('--lock', help='Lock & protect (no other firmwares can be loaded)', action='store_true')
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
return args
|
return args
|
||||||
|
|
@ -498,7 +499,7 @@ def otp(picohsm, args):
|
||||||
elif (args.subcommand == 'secure_boot'):
|
elif (args.subcommand == 'secure_boot'):
|
||||||
script_path = os.path.dirname(os.path.abspath(__file__))
|
script_path = os.path.dirname(os.path.abspath(__file__))
|
||||||
boot_json = json.load(open(f'{script_path}/../pico-keys-sdk/config/rp2350/secure_boot.json'))
|
boot_json = json.load(open(f'{script_path}/../pico-keys-sdk/config/rp2350/secure_boot.json'))
|
||||||
picohsm.secure_boot(boot_json['bootkey0'])
|
picohsm.secure_boot(boot_json['bootkey0'], lock=args.lock)
|
||||||
|
|
||||||
def main(args):
|
def main(args):
|
||||||
sys.stderr.buffer.write(b'Pico HSM Tool v1.18\n')
|
sys.stderr.buffer.write(b'Pico HSM Tool v1.18\n')
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue