-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update bugfix with changes from stable (#377)
* Add Feitian OpenSK USB Dongle (#257) (#258) Co-authored-by: superskybird <[email protected]> Co-authored-by: Geoffrey <[email protected]> Co-authored-by: superskybird <[email protected]> * Bugfix (#304) * Add Feitian OpenSK USB Dongle (#257) Co-authored-by: superskybird <[email protected]> * Fix `config.py` tool according to the new API of fido2 python package (#284) * Fix fido2 API update. Since fido2 0.8.1 the device descriptor moved to NamedTuple, breaking our configuration tool. Code is now updated accordingly and the setup script ensure we're using the correct version for fido2 package. * Make Yapf happy * Fix missing update for fido2 0.9.1 Also split the comment into 2 lines so that the touch is not hidden at the end of the screen. * adds README changes, logo and certificate (#285) Co-authored-by: Geoffrey <[email protected]> Co-authored-by: superskybird <[email protected]> Co-authored-by: kaczmarczyck <[email protected]> * Compare all timestamps in UTC timezone. (#309) * Merge bugfix into stable (#324) * Add Feitian OpenSK USB Dongle (#257) Co-authored-by: superskybird <[email protected]> * Fix `config.py` tool according to the new API of fido2 python package (#284) * Fix fido2 API update. Since fido2 0.8.1 the device descriptor moved to NamedTuple, breaking our configuration tool. Code is now updated accordingly and the setup script ensure we're using the correct version for fido2 package. * Make Yapf happy * Fix missing update for fido2 0.9.1 Also split the comment into 2 lines so that the touch is not hidden at the end of the screen. * adds README changes, logo and certificate (#285) * Fix broken parsing. (#317) * Fix broken parsing. By setting the default value before pre-parsing we ensure that the item can't be None. As an extra safety the custom action also checks for None. Co-authored-by: Geoffrey <[email protected]> Co-authored-by: superskybird <[email protected]> Co-authored-by: kaczmarczyck <[email protected]> * Coveralls workflow applied also to stable (#342) * Coveralls (#339) * Add code coverage report as part of the workflows * Remove -Clink-dead-code which seems to be problematic * Manually set features to avoid debug_* failing unit tests. * Update badges * Add libraries directory to trigger code coverage reporting. * Fix coveralls badge not pointing to the branch * Badges to stable branch * adds and links new security policy * Add erase_storage application example (#352) * Fix coveralls workflow (#356) * Return error instead of debug assert (#363) With dirty storage we hit the assert. Returning an error permits to continue to catch if the invariant is broken for normal operation while being able to continue fuzzing with dirty storage. * Remove elf2tab dev-dependency (#366) We don't use it anymore. Not sure when we used to use it. Fixes #364 Co-authored-by: kaczmarczyck <[email protected]> * Install Rust tools with stable compiler We only need the frozen nightly for Tock (and maybe the app). * fix python lint with encoding, see commit 7418196 * more encoding Co-authored-by: Jean-Michel Picod <[email protected]> Co-authored-by: Geoffrey <[email protected]> Co-authored-by: superskybird <[email protected]> Co-authored-by: Julien Cretin <[email protected]>
- Loading branch information
1 parent
107db64
commit 2f24f52
Showing
13 changed files
with
209 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
branch: true | ||
ignore-not-existing: true | ||
llvm: true | ||
filter: covered | ||
output-type: lcov | ||
output-path: ./lcov.info | ||
ignore: | ||
- "third_party/*" | ||
- "/*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
name: OpenSK code coverage report | ||
on: | ||
push: | ||
paths: | ||
- 'src/**/*.rs' | ||
- 'libraries/**/*.rs' | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
coveralls: | ||
name: OpenSK code coverage | ||
runs-on: ubuntu-18.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: "true" | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
target: thumbv7em-none-eabi | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
override: true | ||
- name: Install grcov | ||
run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo +nightly install grcov; fi | ||
- uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
- name: Install Python dependencies | ||
run: python -m pip install --upgrade pip setuptools wheel | ||
- name: Set up OpenSK | ||
run: ./setup.sh | ||
|
||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --features "with_ctap1,with_nfc,std" --no-fail-fast | ||
env: | ||
CARGO_INCREMENTAL: '0' | ||
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' | ||
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' | ||
- uses: actions-rs/[email protected] | ||
id: coverage | ||
- uses: coverallsapp/[email protected] | ||
name: upload report to coveralls | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: ${{ steps.coverage.outputs.report }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
To report a security issue, please use http://g.co/vulnz. We use | ||
http://g.co/vulnz for our intake, and do coordination and disclosure here on | ||
GitHub (including using GitHub Security Advisory). The Google Security Team will | ||
respond within 5 working days of your report on g.co/vulnz. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright 2020 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#![no_std] | ||
|
||
extern crate lang_items; | ||
|
||
use core::fmt::Write; | ||
use ctap2::embedded_flash::new_storage; | ||
use libtock_drivers::console::Console; | ||
use libtock_drivers::led; | ||
use libtock_drivers::result::FlexUnwrap; | ||
use persistent_store::{Storage, StorageIndex}; | ||
|
||
fn is_page_erased(storage: &dyn Storage, page: usize) -> bool { | ||
let index = StorageIndex { page, byte: 0 }; | ||
let length = storage.page_size(); | ||
storage | ||
.read_slice(index, length) | ||
.unwrap() | ||
.iter() | ||
.all(|&x| x == 0xff) | ||
} | ||
|
||
fn main() { | ||
led::get(1).flex_unwrap().on().flex_unwrap(); // red on dongle | ||
const NUM_PAGES: usize = 20; // should be at least ctap::storage::NUM_PAGES | ||
let mut storage = new_storage(NUM_PAGES); | ||
writeln!(Console::new(), "Erase {} pages of storage:", NUM_PAGES).unwrap(); | ||
for page in 0..NUM_PAGES { | ||
write!(Console::new(), "- Page {} ", page).unwrap(); | ||
if is_page_erased(&storage, page) { | ||
writeln!(Console::new(), "skipped (was already erased).").unwrap(); | ||
} else { | ||
storage.erase_page(page).unwrap(); | ||
writeln!(Console::new(), "erased.").unwrap(); | ||
} | ||
} | ||
writeln!(Console::new(), "Done.").unwrap(); | ||
led::get(1).flex_unwrap().off().flex_unwrap(); | ||
led::get(0).flex_unwrap().on().flex_unwrap(); // green on dongle | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.