Commit Graph

1052 Commits

Author SHA1 Message Date
Miguel Pires
75ee3114a4 many: fix formatting w/ latest go version 2021-12-08 14:08:48 +00:00
Samuele Pedroni
b33f472060 devicestate: Unregister deletes the device key pair as well
* daemon,tests: support forgetting device serial via API

this is done by posting {"action":"forget"} to /v2/model/serial

a flag no-registration-until-reboot is also supported

* many: more consistent naming Delete => DeleteByName on keypair mgrs

we actually want to introduce a Delete by key id on some of them now

* asserts: implement KeypairManager.Delete

* devicestate: Unregister deletes the device key pair as well

* tests: test device key deletion in generic-unregister

* asserts: avoid skipping the GPGKeypairManager.Delete test

pair --yes to --batch in the test
2021-12-02 18:05:02 +01:00
Paweł Stołowski
37e4b217c4 Use Ref().PrimaryKey instead of At().PrimaryKey (thanks pedronis). 2021-09-17 09:38:32 +02:00
Paweł Stołowski
b1fbca56a9 Return full validation set keys from CheckPresenceRequired and
CheckPresenceInvalid; full keys including series and sequence are
expected by store api.
2021-09-17 09:38:32 +02:00
Paweł Stołowski
8e094d70b3 Add doc comment to PresenceConstraintError. 2021-07-27 08:18:29 +02:00
Paweł Stołowski
cc9cf4dfdf Fix format. 2021-07-27 08:12:37 +02:00
Paweł Stołowski
9b47121247 Introduce PresenceConstraintError. 2021-07-27 08:12:37 +02:00
Paweł Stołowski
b8afc08fe1 Return an error from CheckPresenceRequired and CheckPresenceInvalid if
the presence if opposite to what the function is about.
2021-07-27 08:12:37 +02:00
Paweł Stołowski
64807cb59c Implement CheckPresenceInvalid and CheckPresenceRequired methods for
ValidationSets.
2021-07-27 08:12:37 +02:00
Michael Vogt
d3a74b498d Merge remote-tracking branch 'upstream/master' into switch-to-golang-1.13 2021-07-23 16:12:45 +02:00
Paweł Stołowski
16d858b20c Simplify TestBackstore test (thanks pedronis) 2021-07-13 12:05:22 +02:00
Paweł Stołowski
d9d09f1915 Add test for Backstore() function. 2021-07-13 09:05:11 +02:00
Paweł Stołowski
909e34c75a Check for conflicts when refreshing and commiting validation set assertions. 2021-07-12 11:13:20 +02:00
Samuele Pedroni
d9a4499dbf c/snap,asserts: create/delete-key external keypair manager interaction
at least initially we don't support using snap commands to create/delete
keys under an external keypair manager, organize things such that though
we can produce appropriate error messages and we can implement
supporting this later if required
2021-07-08 11:39:47 +02:00
Samuele Pedroni
f8b8615476 c/snap,asserts: introduce KeypairManager.List for "snap keys"
implement it in both GPGKeypairManager and ExternalKeypairManager
2021-07-01 16:53:28 +02:00
Michael Vogt
79a93de625 Merge pull request #10370 from pedronis/ext-keymgr-1
asserts: introduce ExternalKeypairManager
2021-07-01 16:47:37 +02:00
Samuele Pedroni
226ab58974 asserts: some small cleanups and clarifications
thanks @mvo
2021-06-29 18:01:04 +02:00
Samuele Pedroni
e05c79847f asserts: clearer error messages, more robust mock command
thanks @stolowski, @degville
2021-06-24 16:58:10 +02:00
Michael Vogt
53d63d65bd many: run gofmt to match go-1.13 2021-06-24 11:42:13 +02:00
Samuele Pedroni
f2cdb6dd92 asserts,interfaces,snap: fix imports order (according to gci) 2021-06-14 20:54:41 +02:00
Samuele Pedroni
c190fd2b05 asserts: test how ExternalKeypairManager.loadAllKeys is implemented 2021-06-10 13:48:22 +02:00
Samuele Pedroni
61d41d8d81 asserts: DER public keys are expected to be PKIX
that's the case with pkcs11-tool
2021-06-10 11:58:47 +02:00
Samuele Pedroni
a97126c78e asserts: implement ExternalKeypairManager.Export 2021-06-10 09:20:58 +02:00
Samuele Pedroni
716a951c5d asserts: full ExternalKeypairManager.Get implementation
also fix/improve key caching
2021-06-10 09:20:58 +02:00
Samuele Pedroni
895e560e48 asserts: introduce ExternalKeypairManager
this supports using an external program with a simple interface to
handle key management.

this starts with minimal support to be able to perform signing.
2021-06-09 20:30:54 +02:00