Add age plugin support

See https://github.com/str4d/rage/tree/main/age-plugin.

Example usage:

	RAGE_DIR=$PWD/../Rust/rage
	(cd $RAGE_DIR; cargo build --all)
	export PATH=$PATH:$RAGE_DIR/target/debug

	age-plugin-trezor -i "John Doe" | tee trezor.id
	R=$(grep recipient trezor.id | cut -f 3 -d ' ')

	date | tee msg.txt
	rage -er $R < msg.txt > enc.txt
	rage -di trezor.id < enc.txt
This commit is contained in:
Roman Zeyde
2020-12-16 20:33:50 +02:00
parent 2a6a47f400
commit f0769655ad
9 changed files with 242 additions and 7 deletions

View File

@@ -101,7 +101,7 @@ def parse_pubkey(blob):
def _decompress_ed25519(pubkey):
"""Load public key from the serialized blob (stripping the prefix byte)."""
if pubkey[:1] == b'\x00':
if pubkey[:1] in {b'\x00', b'\x01'}:
# set by Trezor fsm_msgSignIdentity() and fsm_msgGetPublicKey()
return nacl.signing.VerifyKey(pubkey[1:], encoder=nacl.encoding.RawEncoder)
else: