Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream Nitrokey contributions #7

Merged
merged 211 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
211 commits
Select commit Hold shift + click to select a range
b9c6ce4
Run cargo fmt
sosthene-nitrokey Oct 24, 2022
53076d7
Update dependencies
sosthene-nitrokey Oct 24, 2022
ce939ee
Fix clippy warnings
sosthene-nitrokey Oct 24, 2022
1a65eb8
Use latest trussed commit
sosthene-nitrokey Oct 24, 2022
65fd2b4
Use trussed's virt module
sosthene-nitrokey Oct 24, 2022
89d8410
Add vsmartcard example
sosthene-nitrokey Oct 25, 2022
3b42f0b
Use recent method for macro import
sosthene-nitrokey Oct 25, 2022
c9a6249
Add infrastructure for command-response tests (taken from opcard-rs)
sosthene-nitrokey Oct 25, 2022
4bb20fe
Log commands
sosthene-nitrokey Oct 25, 2022
98fa36f
Add test with default PIN
sosthene-nitrokey Oct 25, 2022
cc989dc
Add select command support and test
sosthene-nitrokey Oct 26, 2022
3e8fc3e
Fix fasc-n encoding
sosthene-nitrokey Oct 26, 2022
e076633
Add convinience make targets
sosthene-nitrokey Oct 31, 2022
fd23a9f
Remove the unused apdu from the select command
sosthene-nitrokey Oct 31, 2022
0ac5cc5
Improve documentation of default FASC_N
sosthene-nitrokey Oct 31, 2022
34a9629
Fix pivy-tool list
sosthene-nitrokey Oct 31, 2022
aab5302
Fix remaining warnings
sosthene-nitrokey Oct 31, 2022
0dc602c
Remove command chaining
sosthene-nitrokey Oct 31, 2022
d1fac72
Use full names for cryptosystems
sosthene-nitrokey Oct 31, 2022
04d8ea1
Return FunctionNotSupported rather than NotFound for unimplemeted Get…
sosthene-nitrokey Oct 31, 2022
d4c68e7
Remove outdated comments
sosthene-nitrokey Oct 31, 2022
8477aa1
Add yubico commands
sosthene-nitrokey Nov 1, 2022
b9164b5
Add gitlab ci
sosthene-nitrokey Nov 3, 2022
253b0e4
Use hex! for constants
sosthene-nitrokey Nov 3, 2022
ce76bcc
test ci
Nov 4, 2022
53b0e71
test ci
Nov 4, 2022
46267de
test webhook
Nov 4, 2022
0f1aa82
set initial-refacto as main branch for the ci
Nov 4, 2022
ec6fd21
Merge branch 'initial-refacto' into ci
Nov 4, 2022
f325e14
move the checkmark call to the top of the after_script section
Nov 4, 2022
9ffff5c
Fix boilerplate for GENERAL AUTHENTICATE
sosthene-nitrokey Nov 3, 2022
3f93ae1
Remove trussed from the persistent state
sosthene-nitrokey Nov 4, 2022
f06a746
Fix clippy warning
sosthene-nitrokey Nov 4, 2022
42c1e73
Remove const generic in state
sosthene-nitrokey Nov 4, 2022
0bc75ec
Use macros to have one source of KeyReferences
sosthene-nitrokey Nov 4, 2022
7818fe6
Remove the iso command from yubico handler
sosthene-nitrokey Nov 4, 2022
573808a
Remove the need for const generics in the respond implementations
sosthene-nitrokey Nov 4, 2022
5341fc1
Remove opcard's tlv impl and use the existing derp module
sosthene-nitrokey Nov 4, 2022
f6eeff7
Add Nitrokey to authors
sosthene-nitrokey Nov 4, 2022
2d2de43
Fix opcard -> piv-authenticator
sosthene-nitrokey Nov 4, 2022
36b09af
Differenciate loading errors from empty filesystem
sosthene-nitrokey Nov 4, 2022
9640780
Make the use of persistent state easier
sosthene-nitrokey Nov 4, 2022
c5098fd
Fix warnings
sosthene-nitrokey Nov 4, 2022
622fb5a
Relicense to LGPL and comply with reuse
sosthene-nitrokey Nov 8, 2022
043094f
Add README
sosthene-nitrokey Nov 8, 2022
5473ccc
Fix initial parsing of GENERAL AUTHENTICATE
sosthene-nitrokey Nov 9, 2022
3ab233b
Implement request for challenge
sosthene-nitrokey Nov 10, 2022
2e62982
Implemet GENERAL AUTHENTICATE get response support
sosthene-nitrokey Nov 10, 2022
124d334
Check that command algorithm corresponds with state
sosthene-nitrokey Nov 10, 2022
050da53
Add test for admin auth
sosthene-nitrokey Nov 10, 2022
d21a04d
Fix set management key to accept any length
sosthene-nitrokey Nov 15, 2022
38b7a5a
Add support for Aes key management in tests
sosthene-nitrokey Nov 15, 2022
af7340b
Set the management algorithm with the key
sosthene-nitrokey Nov 16, 2022
0e6dbe5
Add support for AES keys in SET MANAGEMENT KEY and test AES keys for …
sosthene-nitrokey Nov 21, 2022
c036f5c
Add basic pivy test
sosthene-nitrokey Nov 21, 2022
1c9a505
Fix reuse compliance
sosthene-nitrokey Nov 22, 2022
1e1d990
Merge pull request #2 from Nitrokey/initial-refacto
sosthene-nitrokey Dec 2, 2022
ec5e758
Add pivy to CI docker image
sosthene-nitrokey Dec 16, 2022
ce366b6
Use Nitrokey trussed tag
sosthene-nitrokey Dec 16, 2022
22a6011
Fix clippy warning
sosthene-nitrokey Dec 16, 2022
d7d1a17
Fix documentation compilation
sosthene-nitrokey Dec 16, 2022
bfd80a4
WIP: Implement key generation
sosthene-nitrokey Nov 22, 2022
dfe8964
Rename keys to match standard
sosthene-nitrokey Nov 22, 2022
6faea4b
Add part of generate asymmetric keypair
sosthene-nitrokey Nov 23, 2022
bd6b2e6
Import `Reply` struct from opcard
sosthene-nitrokey Nov 23, 2022
a385ed0
Add support for generate asymmetric keypair
sosthene-nitrokey Nov 23, 2022
88f82bd
Accept multiple general authenticate fields
sosthene-nitrokey Dec 1, 2022
37bcd13
Make the PIV authentication key mandatory
sosthene-nitrokey Dec 1, 2022
0d6580c
Add support for with PIV authentication key
sosthene-nitrokey Dec 1, 2022
ce28dcb
Add test for key generation
sosthene-nitrokey Dec 1, 2022
25bd7c1
Add Put DATA parsing support
sosthene-nitrokey Dec 2, 2022
22f4669
Reuse generic container approach from Opcard
sosthene-nitrokey Dec 2, 2022
f8030fc
Remove unused warning
sosthene-nitrokey Dec 5, 2022
b6c745f
Use hex! macro
sosthene-nitrokey Dec 5, 2022
43b1a99
Implement generic PUT/GET DATA
sosthene-nitrokey Dec 5, 2022
6bc3ca7
Return NotFound when data object in not avalaible
sosthene-nitrokey Dec 5, 2022
ddb3132
Verify access permissions for PUT/GET DATA
sosthene-nitrokey Dec 5, 2022
a7d9b21
Add key generation test
sosthene-nitrokey Dec 5, 2022
1704d55
Add basic opensc test
sosthene-nitrokey Dec 7, 2022
a43f971
Add support for witness authentication
sosthene-nitrokey Dec 7, 2022
f77c780
Add admin test with opensc
sosthene-nitrokey Dec 7, 2022
07bd2dc
Fix generation of RSA keys
sosthene-nitrokey Dec 7, 2022
15a34f3
Fix make check
sosthene-nitrokey Dec 7, 2022
bd02b3d
Add configurability to tests
sosthene-nitrokey Dec 7, 2022
1b3f578
Fix put data command parsing
sosthene-nitrokey Dec 8, 2022
0b847c9
Fix get data
sosthene-nitrokey Dec 8, 2022
632120c
Validate PIN authentication before signing
sosthene-nitrokey Dec 8, 2022
0bbd13e
Remove outdated comment
sosthene-nitrokey Dec 8, 2022
cbf42d2
Add command_response tests for PUT DATA
sosthene-nitrokey Dec 8, 2022
6f5a82a
Generalize AsymetricKeyReference
sosthene-nitrokey Dec 8, 2022
a1f7c70
Add support for RESET RETRY COUNTER
sosthene-nitrokey Dec 8, 2022
f536bfc
Rename padded_pin => pin
sosthene-nitrokey Dec 8, 2022
5180c6b
Support all keys in GENERAL AUTHENTICATE
sosthene-nitrokey Dec 9, 2022
6dfbbb7
Implement exponentiation
sosthene-nitrokey Dec 9, 2022
ba1fe71
Copy instead of using references
sosthene-nitrokey Dec 9, 2022
7dd8b75
Add pivy test for ECDH
sosthene-nitrokey Dec 9, 2022
630482d
Use expect instead of check in tests for accurate testing
sosthene-nitrokey Dec 9, 2022
bf17ce6
Run cargo fmt
sosthene-nitrokey Dec 13, 2022
74085d3
Remove dbg!
sosthene-nitrokey Dec 13, 2022
be9a69d
Fix GENERAL AUTHENTICATE for agreement mechanisms
sosthene-nitrokey Dec 14, 2022
17e470a
Fix Rsa serialization order
sosthene-nitrokey Jan 4, 2023
4ac7f29
Fix clippy warning
sosthene-nitrokey Jan 4, 2023
8d79178
Add usbip example runner
sosthene-nitrokey Jan 6, 2023
a2a5768
Comment out failing test
sosthene-nitrokey Jan 6, 2023
b6b2822
Make apdu-dispatch a required feature for usbip
sosthene-nitrokey Jan 16, 2023
901cc67
Fix key history object
sosthene-nitrokey Jan 16, 2023
94fd398
Fix compilation in no-std
sosthene-nitrokey Jan 23, 2023
cd62aae
Add RSA to supported algorithms
sosthene-nitrokey Jan 26, 2023
4abb354
Fix memory leak
sosthene-nitrokey Jan 26, 2023
a6c4197
Strip PKCS padding
sosthene-nitrokey Jan 26, 2023
34d4e37
Fix tests
sosthene-nitrokey Feb 8, 2023
b280f49
Fix warnings
sosthene-nitrokey Feb 8, 2023
181c685
Use test_log
sosthene-nitrokey Feb 8, 2023
bb821d0
Use upstream usbd-ccid
sosthene-nitrokey Feb 8, 2023
6f6854d
Rename runtime to volatile
sosthene-nitrokey Feb 8, 2023
16e3e24
Migrate to trussed-rsa-backend
sosthene-nitrokey Feb 14, 2023
7cca1f0
Rework GENERAL AUTHENTICATE implementation
sosthene-nitrokey Feb 14, 2023
db20174
makefile: rename check to lint
sosthene-nitrokey Feb 16, 2023
98a7123
Use rsa backend in tests
sosthene-nitrokey Feb 28, 2023
17d9565
Add pivy rsa test
sosthene-nitrokey Feb 28, 2023
9a4d0ba
Merge branch 'put-data'
sosthene-nitrokey Mar 20, 2023
84f7db3
Use nitrokey trussed fork
sosthene-nitrokey Mar 23, 2023
930fb5d
Add options to the authenticator
sosthene-nitrokey Mar 23, 2023
cac4038
Store all persistent data according to the option
sosthene-nitrokey Mar 23, 2023
daf3da6
Remove RUSTFLAGS in make lint
sosthene-nitrokey Mar 24, 2023
370d8d6
Merge pull request #8 from Nitrokey/storage
sosthene-nitrokey Mar 29, 2023
d8a36c1
Remove todo
sosthene-nitrokey Mar 24, 2023
eedae52
Merge pull request #10 from Nitrokey/todo
sosthene-nitrokey Mar 29, 2023
cda99c9
Merge pull request #11 from Nitrokey/rustflags-opt
sosthene-nitrokey Mar 29, 2023
d25cd72
Rename virtual to vpicc
sosthene-nitrokey Mar 30, 2023
23af6c5
Rename example target in makefile
sosthene-nitrokey Mar 30, 2023
34a8674
Merge pull request #13 from Nitrokey/virtual-vpicc
sosthene-nitrokey Apr 5, 2023
83a4ac0
Remove yubico certificates
sosthene-nitrokey Apr 6, 2023
0a1c3eb
Remove yubico reference for discovery object
sosthene-nitrokey Apr 6, 2023
790a7a8
Remove old default management key
sosthene-nitrokey Apr 6, 2023
1c0dc83
Remove unneeded constants
sosthene-nitrokey Apr 6, 2023
1a8f36c
Fix clippy warnings
sosthene-nitrokey Apr 6, 2023
dcda206
Reuse constants
sosthene-nitrokey Apr 6, 2023
925d6fe
Make application url and label configurable
sosthene-nitrokey Apr 6, 2023
e9b8077
Add trussed-auth as backend dependency
sosthene-nitrokey Apr 5, 2023
29bf6cc
Use trussed-auth for pin verification
sosthene-nitrokey Apr 5, 2023
9ecc8a5
Merge pull request #16 from Nitrokey/constants-cleanup
sosthene-nitrokey Apr 11, 2023
2964c04
Merge pull request #14 from Nitrokey/trussed-auth
sosthene-nitrokey Apr 13, 2023
2af596d
Fix compilation
sosthene-nitrokey Apr 13, 2023
e249f2f
Add reading of large data objects
sosthene-nitrokey Mar 29, 2023
ddc67d7
Implement writing of large data objects
sosthene-nitrokey Mar 29, 2023
ac6097a
Add test with large certificate
sosthene-nitrokey Mar 30, 2023
6e2a893
Use correct length in advance when loading files
sosthene-nitrokey Mar 30, 2023
bcb4b2e
Remove duplicated certificate
sosthene-nitrokey Mar 30, 2023
e5fd7df
Update to flushing streaming api
sosthene-nitrokey Apr 4, 2023
fffbe77
Use trussed's util for writing large files
sosthene-nitrokey Apr 4, 2023
9362e9f
Fix compilation
sosthene-nitrokey Apr 13, 2023
aeeafba
Fix reuse compliance
sosthene-nitrokey Apr 13, 2023
d5b01d5
Use tagged version of trussed
sosthene-nitrokey Apr 13, 2023
cb74991
Merge pull request #12 from Nitrokey/streaming
sosthene-nitrokey Apr 13, 2023
c60ede1
Prepare release 0.1.0
sosthene-nitrokey Apr 13, 2023
ca6daf3
Merge pull request #18 from Nitrokey/release-010
sosthene-nitrokey Apr 13, 2023
3bb5715
Fix dependency on trussed-rsa-alloc to use [patch.crates-io] and a tag
sosthene-nitrokey Apr 17, 2023
b91ad2c
Merge pull request #20 from Nitrokey/fix-duplicate
sosthene-nitrokey Apr 17, 2023
25060e3
Bump changelog
sosthene-nitrokey Apr 17, 2023
0e5152a
Fix typo
sosthene-nitrokey Apr 19, 2023
9aeff14
Update README
sosthene-nitrokey Apr 19, 2023
3980187
Use RsaPublicParts::deserialize
robin-nitrokey Apr 23, 2023
b5ccdd8
Merge pull request #22 from Nitrokey/postcard
robin-nitrokey Apr 25, 2023
590e685
Migrate to upstream trussed and trussed-staging for streaming writes
sosthene-nitrokey Apr 26, 2023
8fac0a7
Merge pull request #24 from Nitrokey/upstream-trussed
sosthene-nitrokey Apr 27, 2023
76479ec
Merge pull request #21 from Nitrokey/readme
sosthene-nitrokey Apr 27, 2023
776f014
Prepare release 0.2
sosthene-nitrokey Apr 27, 2023
3bcde9c
Merge pull request #25 from Nitrokey/release-0-2
sosthene-nitrokey Apr 27, 2023
5caf009
Add nlnet funding
sosthene-nitrokey May 22, 2023
01e7128
Merge pull request #28 from Nitrokey/ngi
jans23 May 22, 2023
2a45590
Fix reset
sosthene-nitrokey May 26, 2023
3debc9e
Make uuid configurable
sosthene-nitrokey May 26, 2023
974bc27
Merge pull request #30 from Nitrokey/uuid-config
sosthene-nitrokey May 30, 2023
99155f6
Fix reset check for pin lock and att tests
sosthene-nitrokey May 30, 2023
4628bb8
Merge pull request #29 from Nitrokey/reset
sosthene-nitrokey May 31, 2023
286f291
Prepare release 0.3.0
sosthene-nitrokey Jun 1, 2023
883d936
Merge pull request #31 from Nitrokey/release-030
sosthene-nitrokey Jun 2, 2023
870ee43
Add a setter for the UUID in the builder
sosthene-nitrokey Jun 2, 2023
9fca9c5
Prepare release 0.3.1
sosthene-nitrokey Jun 2, 2023
0cd9981
Merge pull request #32 from Nitrokey/uuid-config
sosthene-nitrokey Jun 2, 2023
f4d9c64
Fix format of p256 signatures
sosthene-nitrokey Jun 8, 2023
9b2c92a
Add tests for signature
sosthene-nitrokey Jun 8, 2023
c576c8a
Merge pull request #33 from Nitrokey/p256-signature
sosthene-nitrokey Jun 9, 2023
ca97511
Fix trailing whitespace preventing rustfmt formatting
sosthene-nitrokey Jun 9, 2023
824b7aa
Merge pull request #34 from Nitrokey/fmt-fixes
sosthene-nitrokey Jun 12, 2023
a2fb609
Prepare release 0.3.2
sosthene-nitrokey Jun 13, 2023
69f6b65
Merge pull request #35 from Nitrokey/release-032
sosthene-nitrokey Jun 13, 2023
9b15e35
Update command support information in README.md
sosthene-nitrokey Aug 14, 2023
83f36a5
Fix typo
sosthene-nitrokey Aug 14, 2023
e7b60fb
Clarify supported features
sosthene-nitrokey Aug 14, 2023
d7a2bed
Run cargo fmt
sosthene-nitrokey Aug 30, 2023
b0552e0
Fix clippy lints
sosthene-nitrokey Aug 30, 2023
553b4c0
Relicense to Apache + MIT for upstreaming
sosthene-nitrokey Aug 30, 2023
0ed2a0e
Remove unneeded direct `interchange` dependency
sosthene-nitrokey Sep 13, 2023
e509dce
Mention only partial funding from NGI ASSURE
sosthene-nitrokey Sep 13, 2023
1fd257e
Put RSA behind a feature flag
sosthene-nitrokey Sep 13, 2023
9ee9b03
Fix licence mention in README
sosthene-nitrokey Sep 13, 2023
a639b0f
Use moved trussed-staging and trussed-rsa-alloc
sosthene-nitrokey Sep 13, 2023
76bb22d
Remove reuse compliance headers
sosthene-nitrokey Sep 15, 2023
c01678f
Update apdu-dispatch and reject NFC requests
sosthene-nitrokey Nov 8, 2023
6a1f877
Update changelog
sosthene-nitrokey Nov 8, 2023
f55520b
Merge pull request #39 from Nitrokey/adpu-dispatch-020
sosthene-nitrokey Nov 8, 2023
d5abe17
Prepare release 0.3.3
sosthene-nitrokey Nov 8, 2023
1a5e7e5
Prepare release v0.3.3
sosthene-nitrokey Nov 8, 2023
caed9e4
Merge pull request #40 from Nitrokey/release-033
sosthene-nitrokey Nov 8, 2023
e959556
Fix puk change
sosthene-nitrokey Sep 26, 2023
c0efb7b
Add test for PUK and PIN change
sosthene-nitrokey Sep 26, 2023
7b6942c
Merge pull request #38 from Nitrokey/change-puk
sosthene-nitrokey Dec 13, 2023
b476466
Prepare release 0.3.4
sosthene-nitrokey Jan 2, 2024
2c948a9
Merge pull request #45 from Nitrokey/release-034
sosthene-nitrokey Jan 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/target
Cargo.lock
tarpaulin-report.html
cobertura.xml
47 changes: 47 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
include: 'https://raw.githubusercontent.com/Nitrokey/common-ci-jobs/master/common_jobs.yml'

stages:
- pull-github
- build
- deploy

variables:
GIT_STRATEGY: clone
GIT_DEPTH: 0
GIT_SUBMODULE_STRATEGY: recursive
REPO_NAME: piv-authenticator
MAIN_BRANCH: initial-refacto
COMMON_PULL: "true"
COMMON_UPLOAD_NIGHTLY: "false"
COMMON_GITHUB_RELEASE: "false"
COMMON_UPLOAD_FILES: "false"

build:
image: registry.git.nitrokey.com/nitrokey/piv-authenticator/piv-authenticator-build:latest
rules:
- if: '$CI_PIPELINE_SHOULD_NOT_BUILD == "true"'
when: never
- if: '$CI_PIPELINE_SOURCE == "push"'
- if: '$CI_PIPELINE_SOURCE == "web"'
- if: '$CI_PIPELINE_SOURCE == "schedule"'
tags:
- docker
stage: build
before_script:
- cargo --version
script:
- make ci
after_script:
- wget $icon_server/checkmark/$CI_COMMIT_REF_NAME/$CI_COMMIT_SHA/$CI_JOB_NAME/$CI_JOB_STATUS/${CI_JOB_URL#*/*/*/}
- cp /app/.cache/scdaemon.log scdaemon.log
coverage: '/^\d+.\d+% coverage/'
artifacts:
when: always
paths:
- "scdaemon.log"
- "cobertura.xml"
- "tarpaulin-report.html"
reports:
coverage_report:
coverage_format: cobertura
path: cobertura.xml
72 changes: 72 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Changelog

## [v0.3.4][] (2024-01-02)

- Fix error when changing the PUK ([#40][])

[#40]: https://github.com/Nitrokey/piv-authenticator/pull/40

[v0.3.4]: https://github.com/Nitrokey/piv-authenticator/releases/tag/v0.3.4

## [v0.3.3][] (2023-12-08)

- Reject NFC requests ([#39][])
- Put RSA feature behind a feature flag

[#39]: https://github.com/Nitrokey/piv-authenticator/pull/39

[v0.3.3]: https://github.com/Nitrokey/piv-authenticator/releases/tag/v0.3.3

## [v0.3.2][] (2023-06-13)

- Fix P-256 signature ([#33][])

[#33]: https://github.com/Nitrokey/piv-authenticator/pull/33

[v0.3.2]: https://github.com/Nitrokey/piv-authenticator/releases/tag/v0.3.2

## [v0.3.1][] (2023-06-02)

- Add setter to the options builder for the UUID ([#32][])

[#32]: https://github.com/Nitrokey/piv-authenticator/pull/32
[v0.3.1]: https://github.com/Nitrokey/piv-authenticator/releases/tag/v0.3.1

## [v0.3.0][] (2023-05-31)

- Fix reset not checking that the key is locked ([#29][])
- Make GUID configurable ([#30][])

[#30]: https://github.com/Nitrokey/piv-authenticator/pull/30
[#29]: https://github.com/Nitrokey/piv-authenticator/pull/29

[v0.3.0]: https://github.com/Nitrokey/piv-authenticator/releases/tag/v0.3.0

## [v0.2.0][] (2023-04-27)

- Use upstream trussed and trussed-staging ([#24][])

[#24]: https://github.com/Nitrokey/piv-authenticator/pull/24

[v0.2.0]: https://github.com/Nitrokey/piv-authenticator/releases/tag/v0.2.0

## [v0.1.2][] (2023-04-24)

- Use `RsaPublicParts::deserialize` instead of `trussed::postcard_deserialize` for compatibility with recent Trussed changes.

[v0.1.2]: https://github.com/Nitrokey/piv-authenticator/releases/tag/v0.1.2

## [v0.1.1][] (2023-04-17)

- Fix dependency on trussed-rsa-alloc to use the git tag in the `[patch.crates-io]` section to avoid duplicate downstream dependencies

[v0.1.1]: https://github.com/Nitrokey/piv-authenticator/releases/tag/v0.1.1

## [v0.1.0][] (2023-04-13)

This initial release contains support for the basic PIV card functionality.
It supports basic card administration, key generation and authentication.

Supported algorithms are P-256 and RSA 2048.

[v0.1.0]: https://github.com/Nitrokey/piv-authenticator/releases/tag/v0.1.0
76 changes: 64 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,38 +1,90 @@
[package]
name = "piv-authenticator"
version = "0.0.0-unreleased"
authors = ["Nicolas Stalder <[email protected]>"]
edition = "2018"
version = "0.3.4"
authors = ["Nicolas Stalder <[email protected]>", "Nitrokey GmbH"]
edition = "2021"
license = "Apache-2.0 OR MIT"
repository = "https://github.com/solokeys/piv-authenticator"
repository = "https://github.com/nitrokey/piv-authenticator"
documentation = "https://docs.rs/piv-authenticator"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[example]]
name = "vpicc"
required-features = ["vpicc"]


[[example]]
name = "usbip"
required-features = ["apdu-dispatch", "virt"]

[dependencies]
apdu-dispatch = { version = "0.1", optional = true }
delog = "0.1.0"
delog = { version = "0.1.5", optional = true }
flexiber = { version = "0.1", features = ["derive", "heapless"] }
heapless = "0.7"
hex-literal = "0.3"
interchange = "0.2.0"
iso7816 = "0.1"
serde = { version = "1", default-features = false }
trussed = { git = "https://github.com/trussed-dev/trussed" }
# trussed = { path = "../../../trussed" }
untrusted = "0.7"
serde = { version = "1", default-features = false, features = ["derive"] }
trussed = { version = "0.1", features = ["serde-extensions"] }
trussed-auth = { version = "0.2" }
untrusted = "0.9"
vpicc = { version = "0.1.0", optional = true }
log = "0.4"
heapless-bytes = "0.3.0"
subtle = { version = "2", default-features = false }
trussed-rsa-alloc = { version = "0.1.0", features = ["raw"], optional = true }
trussed-staging = { version = "0.1.0", features = ["chunked", "encrypted-chunked"]}

[dev-dependencies]
littlefs2 = "0.3.1"
littlefs2 = "0.3.2"
rand_core = { version = "0.6", features = ["getrandom"] }
trussed = { version = "0.1.0", features = ["virt"] }
env_logger = "0.9"
serde = { version = "1", features = ["derive"] }
serde_cbor = { version = "0.11", features = ["std"] }
hex = "0.4"
test-log = "0.2.11"
ron = "0.8"
des = "0.8"
aes = "0.8.2"
stoppable_thread = "0.2.1"
expectrl = "0.6.0"

# Examples
# usbip
trussed-usbip = { version = "0.0.1", default-features = false, features = ["ccid"] }
usbd-ccid = { version = "0.2.0", features = ["highspeed-usb"]}
rand = "0.8.5"
asn1 = "0.15.2"

[features]
default = []
strict-pin = []
std = []
vpicc = ["std", "dep:vpicc", "virt"]
virt = ["std", "trussed/virt"]
pivy-tests = []
opensc-tests = []
alloc = []
rsa = ["trussed-rsa-alloc", "alloc"]

log-all = []
log-none = []
log-info = []
log-debug = []
log-warn = []
log-error = []

[patch.crates-io]
trussed = { git = "https://github.com/nitrokey/trussed" , tag = "v0.1.0-nitrokey.11" }
trussed-auth = { git = "https://github.com/trussed-dev/trussed-auth.git", tag = "v0.2.2"}
trussed-rsa-alloc = { git = "https://github.com/trussed-dev/trussed-rsa-backend.git", tag = "v0.1.0"}
trussed-staging = { git = "https://github.com/trussed-dev/trussed-staging", tag = "v0.1.0" }
apdu-dispatch = { git = "https://github.com/Nitrokey/apdu-dispatch", tag = "v0.1.2-nitrokey.2" }
trussed-usbip = { git = "https://github.com/Nitrokey/pc-usbip-runner.git", tag = "v0.0.1-nitrokey.1" }
usbd-ccid = { git = "https://github.com/Nitrokey/usbd-ccid", tag = "v0.2.0-nitrokey.1" }

[profile.dev.package.rsa]
opt-level = 2

[profile.dev.package.num-bigint-dig]
opt-level = 2
File renamed without changes.
121 changes: 121 additions & 0 deletions LICENSES/CC0-1.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
Creative Commons Legal Code

CC0 1.0 Universal

CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
HEREUNDER.

Statement of Purpose

The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator
and subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").

Certain owners wish to permanently relinquish those rights to a Work for
the purpose of contributing to a commons of creative, cultural and
scientific works ("Commons") that the public can reliably and without fear
of later claims of infringement build upon, modify, incorporate in other
works, reuse and redistribute as freely as possible in any form whatsoever
and for any purposes, including without limitation commercial purposes.
These owners may contribute to the Commons to promote the ideal of a free
culture and the further production of creative, cultural and scientific
works, or to gain reputation or greater distribution for their Work in
part through the use and efforts of others.

For these and/or other purposes and motivations, and without any
expectation of additional consideration or compensation, the person
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
is an owner of Copyright and Related Rights in the Work, voluntarily
elects to apply CC0 to the Work and publicly distribute the Work under its
terms, with knowledge of his or her Copyright and Related Rights in the
Work and the meaning and intended legal effect of CC0 on those rights.

1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not
limited to, the following:

i. the right to reproduce, adapt, distribute, perform, display,
communicate, and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or
likeness depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data
in a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation
thereof, including any amended or successor version of such
directive); and
vii. other similar, equivalent or corresponding rights throughout the
world based on applicable law or treaty, and any national
implementations thereof.

2. Waiver. To the greatest extent permitted by, but not in contravention
of, applicable law, Affirmer hereby overtly, fully, permanently,
irrevocably and unconditionally waives, abandons, and surrenders all of
Affirmer's Copyright and Related Rights and associated claims and causes
of action, whether now known or unknown (including existing as well as
future claims and causes of action), in the Work (i) in all territories
worldwide, (ii) for the maximum duration provided by applicable law or
treaty (including future time extensions), (iii) in any current or future
medium and for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
member of the public at large and to the detriment of Affirmer's heirs and
successors, fully intending that such Waiver shall not be subject to
revocation, rescission, cancellation, termination, or any other legal or
equitable action to disrupt the quiet enjoyment of the Work by the public
as contemplated by Affirmer's express Statement of Purpose.

3. Public License Fallback. Should any part of the Waiver for any reason
be judged legally invalid or ineffective under applicable law, then the
Waiver shall be preserved to the maximum extent permitted taking into
account Affirmer's express Statement of Purpose. In addition, to the
extent the Waiver is so judged Affirmer hereby grants to each affected
person a royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer's Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future
time extensions), (iii) in any current or future medium and for any number
of copies, and (iv) for any purpose whatsoever, including without
limitation commercial, advertising or promotional purposes (the
"License"). The License shall be deemed effective as of the date CC0 was
applied by Affirmer to the Work. Should any part of the License for any
reason be judged legally invalid or ineffective under applicable law, such
partial invalidity or ineffectiveness shall not invalidate the remainder
of the License, and in such case Affirmer hereby affirms that he or she
will not (i) exercise any of his or her remaining Copyright and Related
Rights in the Work or (ii) assert any associated claims and causes of
action with respect to the Work, in either case contrary to Affirmer's
express Statement of Purpose.

4. Limitations and Disclaimers.

a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or
warranties of any kind concerning the Work, express, implied,
statutory or otherwise, including without limitation warranties of
title, merchantability, fitness for a particular purpose, non
infringement, or the absence of latent or other defects, accuracy, or
the present or absence of errors, whether or not discoverable, all to
the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person's Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the
Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.
File renamed without changes.
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,35 @@
.NOTPARALLEL:

export RUST_LOG ?= info,cargo_tarpaulin=off
TEST_FEATURES ?=vpicc,pivy-tests,opensc-tests,rsa

.PHONY: build-cortex-m4
build-cortex-m4:
cargo build --target thumbv7em-none-eabi

.PHONY: test
test:
cargo test --features $(TEST_FEATURES)

.PHONY: check
check:
RUSTLFAGS='-Dwarnings' cargo check --all-features --all-targets

.PHONY: lint
lint:
cargo fmt --check
cargo check --all-features --all-targets
cargo clippy --all-targets --all-features -- -Dwarnings
RUSTDOCFLAGS='-Dwarnings' cargo doc --all-features

.PHONY: tarpaulin
tarpaulin:
cargo tarpaulin --features $(TEST_FEATURES) -o Html -o Xml

.PHONY: vpicc-example
vpicc-example:
cargo run --example vpicc --features vpicc

.PHONY: ci
ci: lint tarpaulin

Loading