From 5a66301eba378de9b59de4eebb4d7cf3774befc9 Mon Sep 17 00:00:00 2001 From: cuav-chen2 Date: Wed, 4 Jun 2025 15:23:18 +0800 Subject: [PATCH] Tools: specify pymonocypher version in more places and confirm version when running tools --- scripts/generate_keys.py | 5 ++++- scripts/install_build_env.sh | 2 +- scripts/secure_command.py | 2 +- scripts/sign_fw.py | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/generate_keys.py b/scripts/generate_keys.py index 5da4388c..57d6b1d6 100755 --- a/scripts/generate_keys.py +++ b/scripts/generate_keys.py @@ -9,9 +9,12 @@ try: import monocypher except ImportError: - print("Please install monocypher with: python3 -m pip install pymonocypher") + Logs.error("Please install monocypher with: python3 -m pip install pymonocypher==3.1.3.2") sys.exit(1) +if monocypher.__version__ != "3.1.3.2": + Logs.error("must use monocypher 3.1.3.2, please run: python3 -m pip install pymonocypher==3.1.3.2") + sys.exit(1) if len(sys.argv) != 2: print("Usage: generate_keys.py BASENAME") diff --git a/scripts/install_build_env.sh b/scripts/install_build_env.sh index cdf2b5d9..b7482aea 100755 --- a/scripts/install_build_env.sh +++ b/scripts/install_build_env.sh @@ -5,7 +5,7 @@ python3 -m pip install pymavlink python3 -m pip install dronecan python3 -m pip install pyserial python3 -m pip install pexpect -python3 -m pip install pymonocypher +python3 -m pip install pymonocypher==3.1.3.2 wget https://downloads.arduino.cc/arduino-cli/arduino-cli_0.27.1_Linux_64bit.tar.gz mkdir -p bin diff --git a/scripts/secure_command.py b/scripts/secure_command.py index 7d87f5f1..1ead22b2 100755 --- a/scripts/secure_command.py +++ b/scripts/secure_command.py @@ -10,7 +10,7 @@ try: import monocypher except ImportError: - print("Please install monocypher with: python3 -m pip install pymonocypher") + print("Please install monocypher with: python3 -m pip install pymonocypher==3.1.3.2") sys.exit(1) diff --git a/scripts/sign_fw.py b/scripts/sign_fw.py index 41d5d981..f11c5071 100755 --- a/scripts/sign_fw.py +++ b/scripts/sign_fw.py @@ -10,7 +10,7 @@ try: import monocypher except ImportError: - print("Please install monocypher with: python3 -m pip install pymonocypher") + print("Please install monocypher with: python3 -m pip install pymonocypher==3.1.3.2") sys.exit(1) key_len = 32