Commit graph

798 commits

Author SHA1 Message Date
Nora Widdecke
9dd4f3ab56
opgpcard: Make the KeySlots type safe 2022-10-25 14:44:44 +02:00
Heiko
af9d4f49ad Merge branch 'nora/subplot-cache' into 'main'
ci: Use separate cache for subplot job

See merge request openpgp-card/openpgp-card!15
2022-10-25 12:16:19 +00:00
Nora Widdecke
a9d6c11bcc
ci: Use separate cache for subplot job
- Some subplot tests require a virtual card. Those are not always
    available on a system, so subplot uses the
    tests/virtual-card-available file to note whether a virtual card is
    available, and only generates those tests if it is.

  - That file is included in the cache, so the cache should not be
    shared.
2022-10-25 14:09:24 +02:00
Heiko Schaefer
708a8b2707
opgpcard: remove dependencies on lower level openpgp-card (use only the openpgp-card-sequoia API) 2022-10-25 12:53:37 +02:00
Heiko Schaefer
9723ae40b6
openpgp-card-sequoia: add re-exports 2022-10-25 12:52:49 +02:00
Heiko Schaefer
d2ac526523
openpgp-card-sequoia: add key_information() 2022-10-25 12:52:49 +02:00
Heiko Schaefer
1f7aa97df5
openpgp-card-sequoia: add ca_fingerprints() 2022-10-25 12:52:49 +02:00
Heiko Schaefer
5dae8e5758
openpgp-card-sequoia: add getters for uif_* 2022-10-25 12:52:49 +02:00
Heiko Schaefer
5fbe9186cb
openpgp-card-sequoia: add wrapper fn for set_identity() 2022-10-25 12:52:48 +02:00
Heiko Schaefer
37a99b63cf
openpgp-card-sequoia: update doc comments 2022-10-25 12:52:48 +02:00
Heiko
fe61a398a9 Merge branch 'nora/subplot-ci' into 'main'
CI fixes

See merge request openpgp-card/openpgp-card!13
2022-10-25 10:51:28 +00:00
Nora Widdecke
7113de821e
ci: Remove superflous workaround 2022-10-25 12:13:50 +02:00
Nora Widdecke
baf7895024
ci: Report rust and cargo versions 2022-10-25 12:13:50 +02:00
Nora Widdecke
e82d30b956
ci: Extract subplot into its own job
- Subplot requires the presence of virtual cards, so it needs an image
    where they are present. However this interferes with the intentions
    of the cargo-test and cargo-test-debian-bookworm jobs.

  - Revert the cargo-test and cargo-test-debian-bookworm jobs to the
    environments they used to test, rust:latest and
    debain:bookworm-slim, respectively.

  - Add a test "subplot" that runs the subplot tests as part of the
    virtual-test stage.
2022-10-25 12:13:47 +02:00
Lars Wirzenius
257a21cc43 Merge branch 'card-service-data' into 'main'
opgpcard: adjust handling of card_service_data

See merge request openpgp-card/openpgp-card!12
2022-10-25 09:18:47 +00:00
Heiko Schaefer
fff5b18310
opgpcard: adjust handling of card_service_data 2022-10-25 10:37:37 +02:00
Heiko
44c73a154b Merge branch 'liw/json' into 'main'
Add JSON and YAML output to opgpcard

Closes #36

See merge request openpgp-card/openpgp-card!9
2022-10-24 17:54:21 +00:00
Lars Wirzenius
bfb7449686 add an example for scripting use of opgpcard
Sponsored-by: NLnet Foundation; NGI Assure
2022-10-24 20:30:14 +03:00
Lars Wirzenius
dd02a29497 add integration/acceptance test with Subplot
These need to be run with the virtual smartcard emulation in the
Docker container specified in .gitlab-ci.yml for tests.

The tests are a little simplistic, as it turned out that making
changes to the smart card results in flaky tests. Thus only parts of
opgpcard that don't change the card are tested.

Sponsored-by: NLnet Foundation; NGI Assure
2022-10-24 20:30:14 +03:00
Lars Wirzenius
0b616e7b6e implement output formats, version
This is where we actually implement support for the new, versioned
JSON/YAML output formatting.
2022-10-24 19:33:21 +03:00
Lars Wirzenius
dd6950e5fe add command line options to specify output format, version
In this change, these have no effect, but they will have soon. Very soon.

Sponsored-by: NLnet Foundation; NGI Assure
2022-10-24 19:33:21 +03:00
Lars Wirzenius
eb0ad179f6 output: add module that models output for various subcommands
Each subcommand has its own model, and models for each major version
of the output. This isn't used yet, but soon will be.

Sponsored-by: author
2022-10-24 19:33:21 +03:00
Lars Wirzenius
dd0b74c43b versioned_output.rs: add scaffolding for versioned JSON
JSON and other structured output needs to be versioned so that
consumers can rely on it long term. Add a module for specifying output
format and version, as well as traits for implementing things. This
doesn't do anything on its own, but future changes will build on it.

Sponsored-by: NLnet Foundation; NGI Assure
2022-10-24 19:33:21 +03:00
Lars Wirzenius
326aa23dba tools/Cargo.toml: add dependencies for upcoming changes
These dependencies aren't used yet, but are added in preparation for
upcoming changes.

Sponsored-by: NLnet Foundation; NGI Assure
2022-10-24 19:33:21 +03:00
Lars Wirzenius
9e4f57f191 deny.toml: allow the Subplot license
We will be using Subplot (https://subplot.tech/) for integration
tests. Allow its licence.

Sponsored-by: NLnet Foundation; NGI Assure
2022-10-24 19:05:24 +03:00
Lars Wirzenius
264a5a7c90 .gitlab-ci.yml: use container with virtual smartcard for tests
This doesn't change anything for existing tests but allows testing
opgpcard against a virtual smartcard later on.

Sponsored-by: NLnet Foundation; NGI Assure
2022-10-24 19:05:24 +03:00
Heiko
86c3be6c8b Merge branch 'nora/ci' into 'main'
Do not run the hardware tests on forks.

See merge request openpgp-card/openpgp-card!10
2022-10-24 12:32:02 +00:00
puzzlewolf
28b0956916 Do not run the hardware tests on forks.
- Forks of this project do not have access to cookiejar's hardware
    keys. They do not have a gitlab CI runner that can pick up those
    jobs, so the pipeline eventually fails with a timeout.

  - Prevent hardware related jobs from being created for forked
    projects.
2022-10-24 13:30:40 +02:00
Heiko Schaefer
e09fc63d56
Use simplified start script for all virtual cards. 2022-10-21 18:07:25 +02:00
Heiko Schaefer
0d978f8dcb
card-functionality: use virtual 'opcard-rs' card in CI 2022-10-21 18:07:24 +02:00
Heiko Schaefer
4181c2d66c
Clean up error handing for unexpected length of 'Digital signature counter' DO 2022-10-17 15:15:11 +02:00
Heiko Schaefer
cf04d1d3a1
Make version requirement explicit 2022-10-01 15:53:36 +02:00
Heiko Schaefer
4dfaadc5ad
Release openpgp-card 0.3.2 2022-10-01 15:39:08 +02:00
Heiko Schaefer
35f6240608
Bump versions.
This fixes a mistake with the openpgp-card-pcsc 0.2.2 release: openpgp-card-pcsc 0.2.2 depends on openpgp-card 0.3. However, this results in an (accidental) semver break, because openpgp-card-pcsc exposes parts of the openpgp-card API.
See https://gitlab.com/openpgp-card/openpgp-card/-/issues/41
2022-10-01 15:36:17 +02:00
Heiko
aa754dfcc1 Merge branch 'feature-mse' into 'main'
Implement support for the MANAGE SECURITY ENVIRONMENT command

See merge request openpgp-card/openpgp-card!8
2022-09-30 13:56:38 +00:00
Sosthène Guédon
0c7fae8ef9
openpgp-card-sequoia: Implement MANAGE SECURITY ENVIRONMENT command 2022-09-30 14:24:39 +02:00
Sosthène Guédon
3ca6a514f4
openpgp-card: Add manage security environment command 2022-09-30 14:24:39 +02:00
Heiko Schaefer
dc72a9c6c2
Clarify version requirement 2022-09-28 21:03:03 +02:00
Heiko Schaefer
efc2aefcc9
Bump versions 2022-09-28 20:48:14 +02:00
Heiko Schaefer
13b2b62f07
Simplify: use the changed CardBackend handling and the new openpgp-card-sequoia Card struct 2022-09-28 20:44:34 +02:00
Heiko Schaefer
15e7241807
Add Card to the openpgp-card-sequoia API, as a wrapper around a CardBackend/OpenPgp.
This allows using the openpgp-card-sequoia API without needing the crate openpgp-card.
2022-09-28 20:43:57 +02:00
Heiko Schaefer
c96377c9df
OpenPGP owns CardBackend (instead of holding a &mut CardBackend).
When OpenPgp holds a &mut CardBackend, clients of this library need to keep track of the CardBackend (which adds unnecessary complexity).
2022-09-28 20:42:27 +02:00
Heiko Schaefer
3ccfff42a9
Doc syntax 2022-09-28 20:37:09 +02:00
Heiko Schaefer
4b16a0bf63
Bump version 2022-09-27 22:13:47 +02:00
Heiko Schaefer
f87ce5e53d
openpgp-card-sequoia:
add cardholder_name()
2022-09-18 23:18:28 +02:00
Heiko Schaefer
3756521141
openpgp-card-sequoia: Fix make_cert()
[The primary key was missing its CS Key Flags after the changes in 4557c40b, both in the User ID selfsigs, and the DirectKey signature]
2022-09-18 23:18:28 +02:00
Heiko Schaefer
9fe1ca31c0
Bump version 2022-09-18 15:30:50 +02:00
Heiko Schaefer
b32cf67196
Don't implicitly add a User ID for the cardholder name, in make_cert() 2022-09-18 15:30:35 +02:00
Heiko Schaefer
9734ed5dc9
Bump version 2022-09-08 19:30:31 +02:00
Heiko Schaefer
8cadded9f0
opgpcard: rename parameter "user-id" to "userid" to match sq 2022-09-08 19:30:05 +02:00