* Add Feitian OpenSK USB Dongle (#257) (#258)
Co-authored-by: superskybird <skybird.le@gmail.com>
Co-authored-by: Geoffrey <geoffrey@ftsafe.com>
Co-authored-by: superskybird <skybird.le@gmail.com>
* Bugfix (#304)
* Add Feitian OpenSK USB Dongle (#257)
Co-authored-by: superskybird <skybird.le@gmail.com>
* 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 <geoffrey@ftsafe.com>
Co-authored-by: superskybird <skybird.le@gmail.com>
Co-authored-by: kaczmarczyck <43844792+kaczmarczyck@users.noreply.github.com>
* Compare all timestamps in UTC timezone. (#309)
* Merge bugfix into stable (#324)
* Add Feitian OpenSK USB Dongle (#257)
Co-authored-by: superskybird <skybird.le@gmail.com>
* 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 <geoffrey@ftsafe.com>
Co-authored-by: superskybird <skybird.le@gmail.com>
Co-authored-by: kaczmarczyck <43844792+kaczmarczyck@users.noreply.github.com>
* 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 <43844792+kaczmarczyck@users.noreply.github.com>
* 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 <jmichel@google.com>
Co-authored-by: Geoffrey <geoffrey@ftsafe.com>
Co-authored-by: superskybird <skybird.le@gmail.com>
Co-authored-by: Julien Cretin <cretin@google.com>
61 lines
1.7 KiB
Python
61 lines
1.7 KiB
Python
import argparse
|
|
import json
|
|
import os.path
|
|
|
|
# Creates a directory containing seed inputs from a json file having
|
|
# the following structure:
|
|
# [
|
|
# {
|
|
# "hex": "a901a1182a182a02a3626964781a6d616b655f6261645f7...",
|
|
# "cbor": "{1: h'42', 2: {\"id\": \"make.example.com\", ...",
|
|
# "description": "make credential parameters"
|
|
# },
|
|
# ...
|
|
# ]
|
|
#
|
|
# Usage:
|
|
# - pass the resulting corpus directory path as the first argument
|
|
# - pass the json file path to make the corpus from as the second argument
|
|
# Example:
|
|
# python make_corpus.py ./corpus ./corpus_file.json
|
|
|
|
|
|
# Creates a corpus directory to the given path from the given json file.
|
|
def make_corpus(corpus_dir, corpus_json):
|
|
if not os.path.exists(corpus_dir):
|
|
os.makedirs(corpus_dir)
|
|
elif not os.path.isdir(corpus_dir):
|
|
raise NotADirectoryError
|
|
|
|
if os.path.isfile(corpus_json) and \
|
|
os.path.splitext(corpus_json)[-1] == ".json":
|
|
with open(corpus_json, encoding="utf-8") as corpus_file:
|
|
corpus = json.load(corpus_file)
|
|
else:
|
|
raise TypeError
|
|
|
|
for i, seed_file in enumerate(corpus):
|
|
seed_file_name = "seed_file_" + str(i)
|
|
raw_hex = seed_file["hex"].decode("hex")
|
|
with open(os.path.join(corpus_dir, seed_file_name), "wb") as f:
|
|
f.write(raw_hex)
|
|
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument(
|
|
"corpus_directory", help="the resulting corpus directory path")
|
|
parser.add_argument(
|
|
"corpus_json", help="the json file path to make the corpus from")
|
|
args = parser.parse_args()
|
|
try:
|
|
make_corpus(args.corpus_directory, args.corpus_json)
|
|
except NotADirectoryError:
|
|
print(args.corpus_directory, " is not a directory.\n")
|
|
except TypeError:
|
|
print(args.corpus_json, " must be a json file.\n")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|