From e6e04dd1738d57a5cce192450bc412afd4b234aa Mon Sep 17 00:00:00 2001 From: Guillaume Endignoux Date: Thu, 12 Mar 2020 18:35:08 +0100 Subject: [PATCH 1/4] Sync upstream kernel to get reproducible builds. --- third_party/tock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/tock b/third_party/tock index 7e47e6f1..3139864d 160000 --- a/third_party/tock +++ b/third_party/tock @@ -1 +1 @@ -Subproject commit 7e47e6f1a9b279b6458edeb0fa24af381f5a1572 +Subproject commit 3139864d391ab654bfb9c27ca8dcd3e4e9a2d58e From 3deca37699069b056d13bc50cc6ca8b384e46bda Mon Sep 17 00:00:00 2001 From: Guillaume Endignoux Date: Thu, 12 Mar 2020 18:53:16 +0100 Subject: [PATCH 2/4] Add SHA-256 sum computation to CI. --- .github/workflows/opensk_build.yml | 8 ++++++++ run_desktop_tests.sh | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/opensk_build.yml b/.github/workflows/opensk_build.yml index a99438ac..f51637df 100644 --- a/.github/workflows/opensk_build.yml +++ b/.github/workflows/opensk_build.yml @@ -24,8 +24,16 @@ jobs: - name: Set up OpenSK run: ./setup.sh + - name: Building sha256sum tool + uses: actions-rs/cargo@v1 + with: + command: build + args: --manifest-path third_party/tock/tools/sha256sum/Cargo.toml + - name: Building OpenSK uses: actions-rs/cargo@v1 with: command: build args: --release --target=thumbv7em-none-eabi --features with_ctap1 + - name: Compute SHA-256 sum + run: ./third_party/tock/tools/sha256sum/target/debug/sha256sum target/thumbv7em-none-eabi/release/ctap2 diff --git a/run_desktop_tests.sh b/run_desktop_tests.sh index 33b20901..0c887ff0 100755 --- a/run_desktop_tests.sh +++ b/run_desktop_tests.sh @@ -24,6 +24,9 @@ cd libraries/crypto cargo fmt --all -- --check cd ../.. +echo "Building sha256sum tool..." +cargo build --manifest-path third_party/tock/tools/sha256sum/Cargo.toml + echo "Checking that CTAP2 builds properly..." cargo check --release --target=thumbv7em-none-eabi cargo check --release --target=thumbv7em-none-eabi --features with_ctap1 @@ -39,6 +42,7 @@ cargo check --release --target=thumbv7em-none-eabi --examples echo "Checking that CTAP2 builds and links properly (1 set of features)..." cargo build --release --target=thumbv7em-none-eabi --features with_ctap1 +./third_party/tock/tools/sha256sum/target/debug/sha256sum target/thumbv7em-none-eabi/release/ctap2 echo "Checking that supported boards build properly..." make -C third_party/tock/boards/nordic/nrf52840dk From 6f8b8e7a64f7bc2e683923ea4458b883292b8d93 Mon Sep 17 00:00:00 2001 From: Guillaume Endignoux Date: Thu, 12 Mar 2020 19:08:05 +0100 Subject: [PATCH 3/4] Sync nrf52840_mdk_dfu with upstream and add DFU-based boards to run_desktop_tests.sh --- boards/nrf52840_mdk_dfu/src/main.rs | 12 ++++++------ run_desktop_tests.sh | 4 ++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/boards/nrf52840_mdk_dfu/src/main.rs b/boards/nrf52840_mdk_dfu/src/main.rs index 0dc58d8a..7c9d476b 100644 --- a/boards/nrf52840_mdk_dfu/src/main.rs +++ b/boards/nrf52840_mdk_dfu/src/main.rs @@ -22,9 +22,9 @@ const LED1_B_PIN: Pin = Pin::P0_24; const BUTTON_PIN: Pin = Pin::P0_18; const BUTTON_RST_PIN: Pin = Pin::P0_02; -const UART_RTS: Pin = Pin::P0_21; +const UART_RTS: Option = Some(Pin::P0_21); const UART_TXD: Pin = Pin::P0_20; -const UART_CTS: Pin = Pin::P0_03; +const UART_CTS: Option = Some(Pin::P0_03); const UART_RXD: Pin = Pin::P0_19; const SPI_MOSI: Pin = Pin::P0_05; @@ -76,7 +76,7 @@ pub unsafe fn reset_handler() { let button = components::button::ButtonComponent::new(board_kernel).finalize( components::button_component_helper!(( &nrf52840::gpio::PORT[BUTTON_PIN], - capsules::button::GpioMode::LowWhenPressed, + kernel::hil::ActivationMode::ActiveLow, kernel::hil::gpio::FloatingState::PullUp )), ); @@ -84,15 +84,15 @@ pub unsafe fn reset_handler() { let led = components::led::LedsComponent::new().finalize(components::led_component_helper!( ( &nrf52840::gpio::PORT[LED1_R_PIN], - capsules::led::ActivationMode::ActiveLow + kernel::hil::gpio::ActivationMode::ActiveLow ), ( &nrf52840::gpio::PORT[LED1_G_PIN], - capsules::led::ActivationMode::ActiveLow + kernel::hil::gpio::ActivationMode::ActiveLow ), ( &nrf52840::gpio::PORT[LED1_B_PIN], - capsules::led::ActivationMode::ActiveLow + kernel::hil::gpio::ActivationMode::ActiveLow ) )); let chip = static_init!(nrf52840::chip::Chip, nrf52840::chip::new()); diff --git a/run_desktop_tests.sh b/run_desktop_tests.sh index 0c887ff0..864b8fec 100755 --- a/run_desktop_tests.sh +++ b/run_desktop_tests.sh @@ -48,6 +48,10 @@ echo "Checking that supported boards build properly..." make -C third_party/tock/boards/nordic/nrf52840dk make -C third_party/tock/boards/nordic/nrf52840_dongle +echo "Checking that other boards build properly..." +make -C boards/nrf52840_dongle_dfu +make -C boards/nrf52840_mdk_dfu + if [ -z "${TRAVIS_OS_NAME}" -o "${TRAVIS_OS_NAME}" = "linux" ] then echo "Running unit tests on the desktop (release mode)..." From 4b1d5d2645c6d854669b2dfcf35e4f14fd383f6c Mon Sep 17 00:00:00 2001 From: Guillaume Endignoux Date: Thu, 12 Mar 2020 19:11:49 +0100 Subject: [PATCH 4/4] Typo. --- boards/nrf52840_mdk_dfu/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/nrf52840_mdk_dfu/src/main.rs b/boards/nrf52840_mdk_dfu/src/main.rs index 7c9d476b..1777bc3c 100644 --- a/boards/nrf52840_mdk_dfu/src/main.rs +++ b/boards/nrf52840_mdk_dfu/src/main.rs @@ -76,7 +76,7 @@ pub unsafe fn reset_handler() { let button = components::button::ButtonComponent::new(board_kernel).finalize( components::button_component_helper!(( &nrf52840::gpio::PORT[BUTTON_PIN], - kernel::hil::ActivationMode::ActiveLow, + kernel::hil::gpio::ActivationMode::ActiveLow, kernel::hil::gpio::FloatingState::PullUp )), );