Commit graph

27 commits

Author SHA1 Message Date
Sergio Arroutbi fd27ca2d20
Include correct usage and show decrypt option
Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
2023-05-11 09:29:56 +02:00
Patrick Uiterwijk 2622fc93ea
feat: rebase to tss-esapi 7.0
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2022-04-20 13:58:45 +02:00
Antonio Murdaca 8631be7b50
relicense to MIT
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2021-12-09 12:12:37 +01:00
Patrick Uiterwijk 27ef7e77c0
Just ignore the alg parameter
Right now, this must be Dir in order to not crash, but after [1] gets
merged, it will have to be A256GCM.
Since we know the algorithm, let's just ignore it.

[1]: https://github.com/hidekatsu-izuno/josekit-rs/pull/12
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2021-12-08 15:28:20 +01:00
Patrick Uiterwijk 9068cd1c07
Fix warnings
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2021-12-08 13:18:27 +01:00
Patrick Uiterwijk 0767310e85
feat: switch to josekit
This patch changes from using biscuit to josekit for JWE.
josekit uses OpenSSL for its crypto instead of ring.

Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2021-12-08 11:18:55 +01:00
Patrick Uiterwijk 3811bffc67
fix: use hash for name oject hash alg
This makes sure we actually use the correct hash algorithm for name alg.

Fixes: #9
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2021-11-03 10:25:49 +01:00
Patrick Uiterwijk 3465c80729
fix: stop assuming the payload is utf8
Previously, we were expecting that the input is always utf8 encoded
text.
Since we just convert it to bytes, and print it back out as bytes, we
can just skip the unicode parsing, and accept any provided input.

Fixes: #5
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2021-09-29 13:46:49 +02:00
Patrick Uiterwijk 50babf9b9c Rebase on tss-esapi 5.0 and tpm2-policy 0.4
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2021-04-06 09:45:14 +02:00
Patrick Uiterwijk 8ac7857957 Remove extern crate statements
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2020-12-03 16:46:44 +00:00
Patrick Uiterwijk 3dcb2874e0 Add defaults for policy path and pubkey path
This should send people strongly to use the defaults, so that other
tools can easily determine whether policies are in use and what their
values are.
It still allows overriding them.

Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2020-12-03 16:42:52 +00:00
Patrick Uiterwijk ec1770cdb5 Rebase on tss-esapi 4.0.10-alpha and tpm2-policy 0.3.0
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2020-12-03 14:28:06 +00:00
Patrick Uiterwijk 14d91c28d1 Reformat code with rust fmt
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2020-11-10 10:54:34 +01:00
Patrick Uiterwijk 06b2cd9335 Add fix for extra argument from clevis v15
Clevis v15 added an additional argument, which is either an empty string
or the string "-y".
This argument is not used in this PIN, but we checked the exact number of
arguments to parse, which got changed.
This also accepts more additional arguments, and just ignores them.

Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2020-11-10 10:54:01 +01:00
Patrick Uiterwijk e2f32d0fa0 Support some more weird pcr_id specifications
This change makes it pass all the different possible values provided by the clevis tpm2
pin test suite.

Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2020-08-27 14:04:33 +02:00
Patrick Uiterwijk b7f8d115a7 Use u32 for 32-bit architectures
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2020-08-21 09:52:36 +02:00
Patrick Uiterwijk d2aa6b3d9e Rebase to tss-esapi-4.0.6 and tpm2-policy-0.2.0
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2020-08-13 10:42:18 +02:00
Patrick Uiterwijk e10391c4fb Split some code into different files
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2020-08-03 17:07:04 +02:00
Patrick Uiterwijk 387826aef7 Move tpm_objects functions to other module
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2020-08-03 16:47:21 +02:00
Patrick Uiterwijk 98ae987519 Use the kernel TABRMD
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2020-08-03 15:42:07 +02:00
Patrick Uiterwijk cac6aacde4 Strip out the Policy components into a separate crate
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2020-08-03 12:11:43 +02:00
Patrick Uiterwijk 76e880d806 Add a --help option
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2020-08-03 11:03:36 +02:00
Patrick Uiterwijk 2a9a579033 Use the Device TCTI if there is no TPMRM
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2020-08-03 10:57:12 +02:00
Patrick Uiterwijk 8c1524f1b9 Add --sumary and help for compatibility with old pin
Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2020-08-03 10:52:05 +02:00
Patrick Uiterwijk ef0489d9d5 Deserialize the RSA modulus with standard base64
It was decided to use standard base64 instead of base64-url because
that's what the Go implementation did by default for a []byte.

Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2020-07-17 11:55:51 +02:00
Patrick Uiterwijk 1b5c15a992 Use AES128 to be compatible with hardware TPMs
My hardware TPM only supports AES128, so let's use that for now to
be more compatible.

The tpm_sym_def function does take a mutable ctx borrow, so that in
the future it can automatically detect the best supported symdef.

Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
2020-07-17 10:42:06 +02:00
Patrick Uiterwijk a2650d5234 Initial commit 2020-07-16 16:22:34 +02:00