From cb41214e59cafb1405010cd3357d2eddc2cf88ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Fri, 9 Oct 2020 01:13:32 -0300 Subject: [PATCH] Install cbc-file in bin. Allows it to be used as a system utility. --- README.md | 2 +- encrypt-otp.in | 2 +- get-otp.in | 2 +- makefile | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2ddc64a..a6412d6 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ $ encrypt-otp otp_accounts.json ## cbc-file -Hidden utility, does the encryption magic. Despite the name, uses +Mostly hidden utility, does the encryption magic. Despite the name, uses [ChaCha20+Poly1305](https://tools.ietf.org/html/rfc7539) for encryption, as implemented by [BearSSL](https://www.bearssl.org/), together with [argon2](https://github.com/p-h-c/phc-winner-argon2) for key derivation. diff --git a/encrypt-otp.in b/encrypt-otp.in index 4adb127..52d6829 100644 --- a/encrypt-otp.in +++ b/encrypt-otp.in @@ -7,7 +7,7 @@ if [ ! -e "$file" ]; then exit 1 fi -if @PREFIX@/libexec/cbc-file lock "$file" > "$dest"; then +if @PREFIX@/bin/cbc-file lock "$file" > "$dest"; then echo "'$dest' successfully generated!" exit 0 else diff --git a/get-otp.in b/get-otp.in index 584edaa..01ecb89 100644 --- a/get-otp.in +++ b/get-otp.in @@ -1,6 +1,6 @@ #!/bin/sh file="${OTP_ACCOUNTS:-$HOME/.local/share/otp_accounts}" -json="$(@PREFIX@/libexec/cbc-file unlock "$file")" +json="$(@PREFIX@/bin/cbc-file unlock "$file")" [ -z "$json" ] && exit 1 label="$(printf %s "$json" | diff --git a/makefile b/makefile index f7fd7f9..3e4cb75 100644 --- a/makefile +++ b/makefile @@ -14,8 +14,7 @@ encrypt-otp: encrypt-otp.in install: all mkdir -p $(DESTDIR)$(PREFIX)/bin - mkdir -p $(DESTDIR)$(PREFIX)/libexec - install -Dm755 cbc-file $(DESTDIR)$(PREFIX)/libexec/ + install -Dm755 cbc-file $(DESTDIR)$(PREFIX)/bin/ install -Dm755 get-otp $(DESTDIR)$(PREFIX)/bin/ install -Dm755 encrypt-otp $(DESTDIR)$(PREFIX)/bin/