jose icon indicating copy to clipboard operation
jose copied to clipboard

Possibly implement a jwe hdr subcommand

Open cbiedl opened this issue 5 years ago • 0 comments

The clevis unlockers use the idiom

read -r -d . hdr

to read the heaader of the jwe on stdin, and the header only.

Now I'd like to move that logic to jose since the above way

  • deals with jwe internals that should not be visible on this layer,
  • is therefore not easy to understand, and
  • is a bashism which is really hard to eliminate¹².

As a solution I propose a new subcommand that does the same. The above statement would be rewritten as

hdr="$(jose jwe hdr --input=- --output=-)"

and I consider that an improvement.

¹ Since all solutions that are around slurp the entire input, something I want to avoid at any cost. ² I managed to replace all the other bashsims, you'll find that as an clevis issue soon.

cbiedl avatar May 24 '20 13:05 cbiedl