Skip to content

Commit

Permalink
Merge branch 'develop' into add_tock_v2_support
Browse files Browse the repository at this point in the history
  • Loading branch information
L0g4n authored Feb 10, 2023
2 parents 70df9bb + a222986 commit 9ffba32
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,6 @@ valid-metaclass-classmethod-first-arg=mcs

# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=StandardError,
Exception,
BaseException
overgeneral-exceptions=builtins.StandardError,
builtins.Exception,
builtins.BaseException
5 changes: 3 additions & 2 deletions deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,8 @@ def check_prerequisites(self):
nrfutil_version = __import__("nordicsemi.version").version.NRFUTIL_VERSION
if not nrfutil_version.startswith("6."):
fatal(("You need to install nrfutil python3 package v6.0 or above. "
"Found: {nrfutil_version}"))
f"Found: v{nrfutil_version}. If you use Python >= 3.11, please "
"try version 3.10."))
if not SUPPORTED_BOARDS[self.args.board].nordic_dfu:
fatal("This board doesn't support flashing over DFU.")

Expand Down Expand Up @@ -1187,7 +1188,7 @@ def main(args):

# We only need the apps_group if we have a board set
apps_group = main_parser.add_mutually_exclusive_group(
required=(partial_args.board is not None))
required=partial_args.board is not None)
apps_group.add_argument(
"--no-app",
dest="application",
Expand Down
7 changes: 5 additions & 2 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ following:
* python3 and pip (can be installed with the `python3-pip` package on Debian)
* the OpenSSL command line tool (can be installed and configured with the
`libssl-dev` and `pkg-config` packages on Debian)
* `nrfutil` (can be installed using `pip3 install nrfutil`) if you want to flash
a device with DFU
* `uuid-runtime` if you are missing the `uuidgen` command.
* `llvm` if you want to use the upgradability feature.

Expand All @@ -37,6 +35,11 @@ instructions to appropriate binaries for your system.
The scripts provided in this project have been tested under Linux and OS X. We
haven't tested them on Windows and other platforms.

If you use Python newer than 3.10, then nrfutil for flashing over DFU is
currently not supported. Please use Python 3.10, or play around with [Nordic's
new tool](https://www.nordicsemi.com/Products/Development-tools/nrf-util)
instead.

### Compiling the firmware

If this is your first time installing OpenSK, please skip directly to
Expand Down
13 changes: 13 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# General setup
tockloader == 1.5
six
intelhex

# Configure OpenSK (crypto, JTAG lockdown)
colorama
tqdm
cryptography
fido2 >= 1.0.0

# DFU install
nrfutil
5 changes: 1 addition & 4 deletions setup.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@ source tools/gen_key_materials.sh
generate_crypto_materials N

rustup show
pip3 install --user --upgrade 'tockloader==1.5.0' six intelhex
pip3 install --upgrade -r requirements.txt

# Install dependency to create applications.
mkdir -p elf2tab
rustup install stable
cargo +stable install elf2tab --version 0.10.2 --root elf2tab/

# Install python dependencies to factory configure OpenSK (crypto, JTAG lockdown)
pip3 install --user --upgrade colorama tqdm cryptography "fido2>=1.0.0"
3 changes: 1 addition & 2 deletions src/ctap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ const STATEFUL_COMMAND_TIMEOUT_DURATION: Milliseconds<ClockInt> = Milliseconds(3
pub const FIDO2_VERSION_STRING: &str = "FIDO_2_0";
#[cfg(feature = "with_ctap1")]
pub const U2F_VERSION_STRING: &str = "U2F_V2";
// TODO(#106) change to final string when ready
pub const FIDO2_1_VERSION_STRING: &str = "FIDO_2_1_PRE";
pub const FIDO2_1_VERSION_STRING: &str = "FIDO_2_1";

// We currently only support one algorithm for signatures: ES256.
// This algorithm is requested in MakeCredential and advertized in GetInfo.
Expand Down
4 changes: 2 additions & 2 deletions tools/vendor_hid_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def setUpClass(cls):
def get_device(cls, usage_page) -> HidDevice:
devices = list(get_devices(usage_page))
if len(devices) != 1:
raise Exception(f'Found {len(devices)} devices')
raise RuntimeError(f'Found {len(devices)} devices')
return HidDevice(devices[0])

def setUp(self) -> None:
Expand Down Expand Up @@ -277,7 +277,7 @@ def get_fido_device() -> CtapHidDevice:
for d in CtapHidDevice.list_devices():
if d.descriptor.vid == _OPENSK_VID and d.descriptor.pid == _OPENSK_PID:
return d
raise Exception('Unable to find Fido device')
raise RuntimeError('Unable to find Fido device')


def get_fido_device_vendor() -> CtapHidDevice:
Expand Down

0 comments on commit 9ffba32

Please sign in to comment.