diff options
-rw-r--r-- | .gitignore | 6 | ||||
-rw-r--r-- | Makefile | 10 | ||||
-rwxr-xr-x | encedit.in | 52 | ||||
-rw-r--r-- | greppw.1.in | 53 | ||||
-rw-r--r-- | passwort-tresor.1.in (renamed from encedit.1.in) | 0 | ||||
-rwxr-xr-x | passwort-tresor.in (renamed from greppw.in) | 4 | ||||
-rw-r--r-- | passwort-tresor.konf | 4 |
7 files changed, 12 insertions, 117 deletions
@@ -1,4 +1,2 @@ -encedit -encedit.1 -greppw -greppw.1 +passwort-tresor +passwort-tresor.1 @@ -26,7 +26,7 @@ MANDIR = /usr/share/man VERSION = 0.0 -all: encedit encedit.1 greppw greppw.1 +all: passwort-tresor passwort-tresor.1 %: %.in sed "s/#VERSION#/$(VERSION)/; s@#BINDIR#@$(BINDIR)@; s@#ETCDIR#@$(ETCDIR)@" $< > $@ @@ -34,14 +34,12 @@ all: encedit encedit.1 greppw greppw.1 .PHONY: install dist clean install: all - install -D -m0755 encedit $(DESTDIR)$(BINDIR)/encedit - install -D -m0644 encedit.1 $(DESTDIR)$(MANDIR)/man1/encedit.1 - install -D -m0755 greppw $(DESTDIR)$(BINDIR)/greppw - install -D -m0644 greppw.1 $(DESTDIR)$(MANDIR)/man1/greppw.1 + install -D -m0755 passwort-tresor $(DESTDIR)$(BINDIR)/passwort-tresor + install -D -m0644 passwort-tresor.1 $(DESTDIR)$(MANDIR)/man1/passwort-tresor.1 install -D -m0644 passwort-tresor.konf $(DESTDIR)$(ETCDIR)/passwort-tresor.konf clean: - rm -f encedit encedit.1 greppw greppw.1 + rm -f passwort-tresor passwort-tresor.1 dist: clean git status --porcelain 2> /dev/null | grep -q "\S" && (git add .; git commit -m"neue Version: $(VERSION)") || true diff --git a/encedit.in b/encedit.in deleted file mode 100755 index a295add..0000000 --- a/encedit.in +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash - -. #ETCDIR#/passwort-tresor.konf - -if [ "$1" == "" ] -then - s=$(dialog --stdout --fselect /mnt/141.35.50.159_home/Dokumente/todolist.gpg 14 70) - [ "$s" == "" ] && exit 1 - if [ "$(basename $s)" != "$(basename $s .gpg).gpg" ] - then - echo "File must end on \".gpg\", \"$s\" does not!" - exit 1 - fi -else - s="$1" - if [ $(basename $s) != $(basename $s .gpg).gpg ] - then - echo "Usage: etea encrypted.gpg" - echo " or: etea" - exit 1 - fi -fi - -if [ "$(dirname $s)" == "/mnt/141.35.50.159_home/Dokumente" ] -then - sha512sum -c ~/.sums/$(basename $s .gpg).512 || dialog --msgbox "Die Prüfsumme stimmt nicht!" 14 70 -fi - -i=0 -while [ -e /tmp/efile.$i ] || [ -e /tmp/emsg.$i ] || [ -e /tmp/ecrpt.$i ] -do - i=$[$i+1] -done - -gpg -o /tmp/efile.$i -d $s 2> /tmp/emsg.$i || exit 1 -if [ ! $(grep -c "Good signature from \"Erich Eckner \([^\"]*\)\?<erich@eckner.net>\"" /tmp/emsg.$i) -eq 1 ] || [ ! $(grep -c "Signature made .* using RSA key ID 0AEEC90755DA7B5A" /tmp/emsg.$i) -eq 1 ] -then - dialog --textbox /tmp/emsg.$i 14 70 -fi -touch /tmp/emsg.$i -tea /tmp/efile.$i || exit 1 -if [ ! $(ls -1t /tmp/efile.$i /tmp/emsg.$i | wc -l) -eq 2 ] || [ ! $(ls -1t /tmp/efile.$i /tmp/emsg.$i | head -n1) == "/tmp/emsg.$i" ] -then - gpg -o /tmp/ecrpt.$i -r erich@eckner.net -e -s /tmp/efile.$i || exit 1 - mv /tmp/ecrpt.$i $s 2> /dev/null || exit 1 - if [ "$(dirname $s)" == "/mnt/141.35.50.159_home/Dokumente" ] - then - sha512sum $s > ~/.sums/$(basename $s .gpg).512 - fi -fi -rm /tmp/efile.$i -rm /tmp/emsg.$i diff --git a/greppw.1.in b/greppw.1.in deleted file mode 100644 index bdfb929..0000000 --- a/greppw.1.in +++ /dev/null @@ -1,53 +0,0 @@ -.TH sendmailadvanced 1 "" "sendmailadvanced #VERSION#" "" -.SH NAME -sendmailadvanced \- wrapper for sendmail which encrypts and generates stamps -.SH SYNOPSIS -\fBsendmailadvanced [options]\fP -.SH DESCRIPTION -\fBsendmailadvanced\fP encrypts emails and generates stamps either in situ or in a pipe. For that it uses \fBhashcash\fP and \fBgnupg\fP. -.SH OPTIONS -.TP -.B "\-h, \-\-hook" -Activate specified hook. -.TP -.B "\-i, \-\-inline" -Enhance email file in situ. -\fB\-\-inline \-\fP has the same effect as option \fB\-t\fP. -Conflicts with \fB\-t, \-\-no\-inline\fP. -.TP -.B "\-t, \-\-no\-inline" -Enhance email from stdin to stdout. -Conflicts with \fB\-i, \-\-inline\fP. -.TP -.B "\-e, \-\-[no\-]encrypt" -Do (not) encrypt. -.TP -.B "\-s, \-\-[no\-]stamp" -Do (not) stamp. -.SH CONFIGURATION -The configfile \fB#ETCDIR#/sendmailadvanced.conf\fP is a bash script, which defines the following variables and routines: -.TP -.B "gpg_recipient" -default recipient to encrypt to -.TP -.B "hashcash_bits" -stamp value -.TP -.B "body_header_hook" -routine printing things to put into head of (body of) email. -Parameter \fB$1\fP was given on the console via \fB--hook $1\fP. -.TP -.B "body_footer_hook" -routine printing things to put into foot of email. -Parameter \fB$1\fP was given on the console via \fB--hook $1\fP. -.SH FILES -.TP -.B "#BINDIR#/sendmailadvanced" -program file -.TP -.B "#ETCDIR#/sendmailadvanced.conf" -contains configuration -.SH AUTHOR -.nf -Erich Eckner <opensource at eckner dot net> -.fi diff --git a/encedit.1.in b/passwort-tresor.1.in index bdfb929..bdfb929 100644 --- a/encedit.1.in +++ b/passwort-tresor.1.in diff --git a/greppw.in b/passwort-tresor.in index e0b3b03..9d6d3c6 100755 --- a/greppw.in +++ b/passwort-tresor.in @@ -5,9 +5,9 @@ echo "Dienst: " read dienst -tmpMsg=$(mktemp /tmp/emsg.XXXXXX) +tmpDir="$(mktemp -d)" -text="$(ssh 141.35.50.159 "cat ~/Dokumente/pws.gpg" | gpg -o - -d - 2> ${tmpMsg})" +text="$(${passwortDateiBefehl} | gpg -o - -d - 2> "${tmpDir}/")" if [ ! $(grep -c "Good signature from \"Erich Eckner \([^\"]*\)\?<erich@eckner.net>\"" ${tmpMsg}) -eq 1 ] || [ ! $(grep -c "Signature made .* using RSA key ID 0AEEC90755DA7B5A" ${tmpMsg}) -eq 1 ] then diff --git a/passwort-tresor.konf b/passwort-tresor.konf new file mode 100644 index 0000000..168e2e0 --- /dev/null +++ b/passwort-tresor.konf @@ -0,0 +1,4 @@ +#!/bin/bash + +passwortDateiBefehl='ssh nlopc46 "cat ~/Dokumente/pws.gpg"' +passwortSummenBefehl='ssh nlopc43 "cat .sums/pws.512"' |