File tree 3 files changed +21
-1
lines changed 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 56
56
- name : Run integration tests
57
57
run : |
58
58
TCTI=swtpm: SKIP_CLEVIS=true cargo test -- --nocapture
59
+ echo "### Shell integration tests" >&2
60
+ TCTI=swtpm: SKIP_CLEVIS=true ./tests/integration-test.sh
59
61
- name : Run policy tests
60
62
run : |
61
63
TCTI=swtpm: ./tests/test_policy
Original file line number Diff line number Diff line change @@ -177,7 +177,10 @@ struct ClevisInner {
177
177
}
178
178
179
179
fn perform_decrypt ( input : Vec < u8 > ) -> Result < ( ) > {
180
- let input = String :: from_utf8 ( input) . context ( "Error reading input" ) ?;
180
+ let input = String :: from_utf8 ( input)
181
+ . context ( "Error reading input" ) ?
182
+ . trim ( )
183
+ . to_string ( ) ;
181
184
let hdr = josekit:: jwt:: decode_header ( & input) . context ( "Error decoding header" ) ?;
182
185
let hdr_clevis = hdr. claim ( "clevis" ) . context ( "Error getting clevis claim" ) ?;
183
186
let hdr_clevis: ClevisInner =
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ die () {
4
+ echo " ERROR: ${1} " >&2
5
+ exit 1
6
+ }
7
+
8
+ PLAINTEXT=foobar
9
+ jwe=" $( echo " ${PLAINTEXT} " | ./target/debug/clevis-pin-tpm2 encrypt {}) "
10
+
11
+ dec=" $( echo " $jwe " | ./target/debug/clevis-pin-tpm2 decrypt) " \
12
+ || die " Unable to decrypt JWE passed with newline added"
13
+
14
+ [ " ${dec} " = " ${PLAINTEXT} " ] \
15
+ || die " Decrypted JWE (${dec} ) does not match PLAINTEXT (${PLAINTEXT} )"
You can’t perform that action at this time.
0 commit comments