Compare commits

...

6 Commits

Author SHA1 Message Date
e2151345d7 Typo: C3Reg-> c3Reg 2021-01-10 16:39:06 +01:00
8dbc8c6605 C3Reg-Renaming; adding devtal's passport 2021-01-05 19:27:13 +01:00
e675a78b10 Document: Renaming to C3Reg 2021-01-05 18:59:43 +01:00
333d5c9e3c Fix: GPG-Search 2021-01-04 22:04:43 +01:00
7bb30f09f5 Check for empty string 2021-01-04 20:36:16 +01:00
36eb4564a3 Y42: Extract the GPG part to another form 2021-01-04 20:33:52 +01:00
17 changed files with 372 additions and 102 deletions

View File

@ -1,4 +1,4 @@
# Intergalactic Registration Office # c3Reg
Fill out your hacker passport using a professional dot matrix printer. Fill out your hacker passport using a professional dot matrix printer.
## Set event name ## Set event name
@ -7,7 +7,8 @@ To set the event name, just change the `EVENT` variable in `./start` at the top.
## Supported Passports ## Supported Passports
The following passports are supported atm: The following passports are supported atm:
- CmS Junghackerpass - CmS Junghackerpass
- Adafruit (the newer ones) - Bound Diplomatic passport by Mitch Altman (TVBGone) Matthew Borgatti (har.ms)
- Stapled Diplomatic passport Mitch/Matthew and Nils-Arne Pohlandt (devtal.de)
Do you want yours to be supported, too? Do you want yours to be supported, too?
Talk to me and send me 3 example pieces. :) Talk to me and send me 3 example pieces. :)

View File

@ -60,20 +60,6 @@ function heading() {
fi fi
if [ $PAGE -eq 1 ]; then
makeLeft $NEXTPAGE $FILE
fi
makeLeft 3 $FILE
makeLeft $SPACE $FILE
italicLetters $FILE
printf "INTERGALACTIC\n" >> $FILE
if [ $PAGE -eq 1 ]; then
makeLeft $NEXTPAGE $FILE
fi
makeLeft 3 $FILE
makeLeft $SPACE $FILE
printf "REGISTRATION\n" >> $FILE
bigLetters $FILE bigLetters $FILE
if [ $PAGE -eq 1 ]; then if [ $PAGE -eq 1 ]; then
@ -85,7 +71,7 @@ function heading() {
makeLeft 1 $FILE makeLeft 1 $FILE
makeLeft $HSPACE $FILE makeLeft $HSPACE $FILE
fi fi
printf "OFFICE\n" >> $FILE printf "c3Reg\n" >> $FILE
resetLetters $FILE resetLetters $FILE
} }

View File

@ -3,7 +3,7 @@ FILE=/tmp/$RANDOM
TOP=56 TOP=56
NEXTFIELD=5 NEXTFIELD=5
LEFT=22 LEFT=22
AUTHLEFT=56 AUTHLEFT=66
DATELEFT=37 DATELEFT=37
MAXLENGTH=17 MAXLENGTH=17
@ -29,7 +29,7 @@ printf "$GIVENNAME" >> $FILE
# Authority field # Authority field
makeNewline 2 $FILE makeNewline 2 $FILE
makeLeft $AUTHLEFT $FILE makeLeft $AUTHLEFT $FILE
printf "Intergalactic Reg. Office" >> $FILE printf "C3Reg" >> $FILE
makeNewline 3 $FILE makeNewline 3 $FILE
makeLeft $LEFT $FILE makeLeft $LEFT $FILE

View File

@ -26,7 +26,7 @@
\fbox{\rule{#1in}{0pt}\rule[-0.5ex]{0pt}{4ex}}} \fbox{\rule{#1in}{0pt}\rule[-0.5ex]{0pt}{4ex}}}
\title{\textbf{Application Form A23}} \title{\textbf{Application Form A23}}
\author{Intergalactic Registration Office} \author{c3Reg}
\date{Control no. \randomnum{1000}} \date{Control no. \randomnum{1000}}
\addtolength{\topmargin}{-2cm} \addtolength{\topmargin}{-2cm}

View File

@ -26,7 +26,7 @@
\fbox{\rule{#1in}{0pt}\rule[-0.5ex]{0pt}{4ex}}} \fbox{\rule{#1in}{0pt}\rule[-0.5ex]{0pt}{4ex}}}
\title{\textbf{Application Form PKSR20}} \title{\textbf{Application Form PKSR20}}
\author{Intergalactic Registration Office} \author{c3Reg}
\date{Control no. \answerbox{1}} \date{Control no. \answerbox{1}}
\addtolength{\topmargin}{-2cm} \addtolength{\topmargin}{-2cm}

View File

@ -11,7 +11,7 @@
\title{\textbf{Privacy Policy}} \title{\textbf{Privacy Policy}}
\author{Intergalactic Registration Office} \author{c3Reg}
\date{} \date{}
\addtolength{\topmargin}{-2cm} \addtolength{\topmargin}{-2cm}
@ -36,5 +36,11 @@ This office is compliant with the GDPR.
\item The information requiring the usage of the computer are always saved volatilely for issuing the passport document. \item The information requiring the usage of the computer are always saved volatilely for issuing the passport document.
\end{itemize} \end{itemize}
\section*{Contact}
Contact information:
\begin{itemize}
\item Bandie \textless bandie at chaospott.de\textgreater, DECT: 2263
\end{itemize}
\end{document} \end{document}

View File

@ -26,7 +26,7 @@
\fbox{\rule{#1in}{0pt}\rule[-0.5ex]{0pt}{4ex}}} \fbox{\rule{#1in}{0pt}\rule[-0.5ex]{0pt}{4ex}}}
\title{\textbf{Application Form Y42}} \title{\textbf{Application Form Y42}}
\author{Intergalactic Registration Office} \author{c3Reg}
\date{Control no. \randomnum{1000}} \date{Control no. \randomnum{1000}}
\addtolength{\topmargin}{-1cm} \addtolength{\topmargin}{-1cm}
@ -72,17 +72,10 @@ This is my \ \ \ \ \answerbox{0.1} first \ \ \ \ \answerbox{0.1} second \ \ \ \
I know \ \ \ \answerbox{0.1} nothing \ \ \ \answerbox{0.1} somewhat \ \ \ \answerbox{0.1} the secret \ \ \ \ about the Chaos. I know \ \ \ \answerbox{0.1} nothing \ \ \ \answerbox{0.1} somewhat \ \ \ \answerbox{0.1} the secret \ \ \ \ about the Chaos.
\\ \\
\section*{Application for registering my GPG fingerprint - Optional} \section*{Additional hints}
I hereby applicate to register my GPG fingerprint.
I have either
\begin{itemize} \begin{itemize}
\item[1.] uploaded the public key to the \textbf{keys.openpgp.org} keyserver \textbf{using the following mail address} or \item To register your \textbf{GPG fingerprint} on your passport, please fill out \textbf{Form PKSR20}.
\item[2.] I can state the \textbf{full GPG fingerprint}, which is
\end{itemize} \end{itemize}
\
Mail address or full GPG fingerprint in the form of 1234-ABCD-5678-9012-1234-1234-1234-1234-1234
\\
\answerbox{6.5}
\end{document} \end{document}

View File

@ -60,20 +60,6 @@ function heading() {
fi fi
if [ $PAGE -eq 1 ]; then
makeLeft $NEXTPAGE $FILE
fi
makeLeft 1 $FILE
makeLeft $SPACE $FILE
italicLetters $FILE
printf "INTERGALACTIC\n" >> $FILE
if [ $PAGE -eq 1 ]; then
makeLeft $NEXTPAGE $FILE
fi
makeLeft 1 $FILE
makeLeft $SPACE $FILE
printf "REGISTRATION\n" >> $FILE
bigLetters $FILE bigLetters $FILE
if [ $PAGE -eq 1 ]; then if [ $PAGE -eq 1 ]; then
@ -87,7 +73,7 @@ function heading() {
fi fi
makeLeft $HSPACE $FILE makeLeft $HSPACE $FILE
fi fi
printf "OFFICE\n" >> $FILE printf "c3Reg\n" >> $FILE
resetLetters $FILE resetLetters $FILE
} }

View File

@ -1,30 +0,0 @@
#!/bin/bash
FILE=/tmp/$RANDOM
source ../include/nixdorf
init
echo "1
2
3
4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
0
1" > $FILE
printFile $FILE
rm $FILE

View File

@ -21,7 +21,7 @@ init
makeNewline 1 $FILE makeNewline 1 $FILE
makeLeft $(($LEFT + 12)) $FILE makeLeft $(($LEFT + 12)) $FILE
smallLetters $FILE smallLetters $FILE
printf "/ Intergal. Reg. Office" >> $FILE printf "/ C3Reg" >> $FILE
resetLetters $FILE resetLetters $FILE
makeNewline $(($TOP - 1)) $FILE makeNewline $(($TOP - 1)) $FILE

108
stapleddipl/c3reg Executable file
View File

@ -0,0 +1,108 @@
#!/bin/bash
FILE=/tmp/$RANDOM
TOP=1
LEFT=5
# Additional heading space
HEADINGNEXTPAGE=19
HEADINGLEFT=1
HEADINGRIGHT=10
# GPG Space
NEXTPAGE=34
NEXTPAGESMALL=60
NEXTFIELDBOTTOM=13
NEXTFIELDRIGHT=18
NEXTFIELDRIGHTSMALL=30
if [ $# -eq 0 ]; then
echo -e "$0: Syntax:\n$0 FIELD\n\nExample:\n$0 7\n\n\nFields:
==================
| VISAS || VISAS |
==================
| 0 | 1 || 4 | 5 |
|---|---||---|---|
| 2 | 3 || 6 | 7 |
==================
"
exit 1
fi
PAGE=$(($1 / 4))
FIELD=$(($1 % 4))
shift 1
echo "PAGE: $PAGE, FIELD: $FIELD"
function moveDown() {
for((i=0; i<$(($FIELD / 2)); i++)); do
for((j=0; j<$NEXTFIELDBOTTOM; j++)); do
printf "\n" >> $FILE
done
done
}
function heading() {
moveDown
if [ $(($FIELD % 2)) -eq 0 ]; then
HSPACE=$HEADINGLEFT
SPACE=0
else
HSPACE=$HEADINGRIGHT
SPACE=$NEXTFIELDRIGHT
fi
bigLetters $FILE
if [ $PAGE -eq 1 ]; then
makeLeft $HEADINGNEXTPAGE $FILE
if [ $(($FIELD % 2)) -eq 1 ]; then
makeLeft $(($HSPACE - 1)) $FILE
fi
else
makeLeft 1 $FILE
makeLeft $HSPACE $FILE
fi
printf "c3Reg\n" >> $FILE
resetLetters $FILE
}
function insertDate() {
if [ $(($FIELD % 2 )) -eq 0 ]; then
SPACE=0
else
SPACE=$NEXTFIELDRIGHTSMALL
fi
smallLetters $FILE
if [ $PAGE -eq 1 ]; then
makeLeft $NEXTPAGESMALL $FILE
fi
makeLeft $LEFT $FILE
makeLeft $(($SPACE + 2)) $FILE
if [ -n "$EVENT" ]; then
printf "$EVENT, $(date -I)" >> $FILE
else
printf "$(date -I)" >> $FILE
fi
}
source ../include/nixdorf
init
makeNewline $TOP $FILE
heading
insertDate
printFile $FILE
rm $FILE

134
stapleddipl/gpgkey Executable file
View File

@ -0,0 +1,134 @@
#!/bin/bash
FILE=/tmp/$RANDOM
TOP=1
LEFT=3
# Additional heading space
HEADINGNEXTPAGE=36
HEADINGLEFT=1
HEADINGRIGHT=20
# GPG Space
NEXTPAGE=62
NEXTFIELDBOTTOM=11
NEXTFIELDRIGHT=31
MAXLENGTH=22
if [ $# -eq 0 ]; then
echo -e "$0: Syntax:\n$0 FIELD GPG FINGERPRINT WITH SPACES\n\nExample:\n$0 7 1234 5678 1234 1234 1234 1234 1234 1234 1234 ABCD\n\n\nFields:
==================
| VISAS || VISAS |
==================
| 0 | 1 || 4 | 5 |
|---|---||---|---|
| 2 | 3 || 6 | 7 |
==================
"
exit 1
fi
PAGE=$(($1 / 4))
FIELD=$(($1 % 4))
shift 1
echo "PAGE: $PAGE, FIELD: $FIELD"
function moveDown() {
for((i=0; i<$(($FIELD / 2)); i++)); do
for((j=0; j<$NEXTFIELDBOTTOM; j++)); do
printf "\n" >> $FILE
done
done
}
function heading() {
moveDown
if [ $(($FIELD % 2)) -eq 0 ]; then
SPACE=$HEADINGLEFT
else
SPACE=$HEADINGRIGHT
fi
if [ $PAGE -eq 1 ]; then
makeLeft $HEADINGNEXTPAGE $FILE
fi
makeLeft $LEFT $FILE
makeLeft $SPACE $FILE
bigLetters $FILE
printf "GPG" >> $FILE
resetLetters $FILE
printf "\n" >> $FILE
}
function insertFP() {
if [ $(($FIELD % 2 )) -eq 0 ]; then
SPACE=0
else
SPACE=$NEXTFIELDRIGHT
fi
smallLetters $FILE
if [ $PAGE -eq 1 ]; then
makeLeft $NEXTPAGE $FILE
fi
makeLeft $LEFT $FILE
makeLeft $(($SPACE + 2)) $FILE
printf "$1 $2 $3 $4" >> $FILE
resetLetters $FILE
printf "\n" >> $FILE
shift 4
smallLetters $FILE
if [ $PAGE -eq 1 ]; then
makeLeft $NEXTPAGE $FILE
fi
makeLeft $LEFT $FILE
makeLeft $(($SPACE + 2)) $FILE
printf "$1 $2 $3 $4" >> $FILE
resetLetters $FILE
printf "\n" >> $FILE
shift 4
smallLetters $FILE
if [ $PAGE -eq 1 ]; then
makeLeft $NEXTPAGE $FILE
fi
makeLeft $LEFT $FILE
makeLeft $(($SPACE + 2)) $FILE
printf "$1 $2" >> $FILE
resetLetters $FILE
printf "\n" >> $FILE
shift 2
smallLetters $FILE
if [ $PAGE -eq 1 ]; then
makeLeft $NEXTPAGE $FILE
fi
makeLeft $LEFT $FILE
makeLeft $(($SPACE + 2)) $FILE
if [ -n "$EVENT" ]; then
printf "$EVENT, $(date -I)" >> $FILE
else
printf "$(date -I)" >> $FILE
fi
}
source ../include/nixdorf
init
makeNewline $TOP $FILE
heading
insertFP $@
printFile $FILE
rm $FILE

52
stapleddipl/reg Executable file
View File

@ -0,0 +1,52 @@
#!/bin/bash
FILE=/tmp/$RANDOM
TOP=54
NEXTFIELD=5
LEFT=23
AUTHLEFT=66
DATELEFT=35
MAXLENGTH=17
GIVENNAME=$1
SURNAME=$2
HOME=$3
if [ ${#GIVENNAME} -gt $MAXLENGTH ] || [ ${#SURNAME} -gt $MAXLENGTH ] || [ ${#HOME} -gt $MAXLENGTH ]; then
echo "MAXLENGTH EXCEEDED."
exit 1
fi
source ../include/nixdorf
init
smallLetters $FILE
printf "\x1b\x33\x0e" >> $FILE
makeNewline $TOP $FILE
makeLeft $LEFT $FILE
printf "$GIVENNAME" >> $FILE
# Authority field
makeNewline 2 $FILE
makeLeft $AUTHLEFT $FILE
printf "C3Reg" >> $FILE
makeNewline 3 $FILE
makeLeft $LEFT $FILE
printf "$SURNAME" >> $FILE
makeNewline $NEXTFIELD $FILE
makeLeft $LEFT $FILE
printf "$HOME" >> $FILE
makeNewline 5 $FILE
makeLeft $DATELEFT $FILE
if [ -n "$EVENT" ]; then
printf "/ $EVENT, $(date -I)" >> $FILE
else
printf "/ $(date -I)" >> $FILE
fi
printFile $FILE
rm $FILE

19
start
View File

@ -99,14 +99,21 @@ function gpgSearch() {
echo "Searching for GPG key..." echo "Searching for GPG key..."
gpg --keyserver "hkps://keys.openpgp.org" --search "$(cat $TMP)" gpg --keyserver "hkps://keys.openpgp.org" --search "$(cat $TMP)"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
export FFP=$(gpg -k "$(cat $TMP)" | head -n 2 | tail -n 1 | awk '{print $1}' | sed 's/.\{4\}/& /g;s/^\(.*\) $/\1/g') FFP=$(gpg -k "$(cat $TMP)" | head -n 2 | tail -n 1 | awk '{print $1}' | sed 's/.\{4\}/& /g;s/^\(.*\) $/\1/g')
gpg --batch --delete-key "$FFP" gpg --batch --delete-key "$FFP"
return 0 if [ "$FFP" = "" ]; then
diaBox "GPG Search" "No fingerprint has been found for $(cat $TMP)"
return 1
else
return 0
fi
else else
gpgSearch diaBox "GPG Search" "No fingerprint has been found for $(cat $TMP)"
return 1
fi fi
else else
gpgSearch diaBox "GPG Search" "This is on vaild mail address."
return 1
fi fi
fi fi
return 1 return 1
@ -133,8 +140,10 @@ function enterGPG() {
gpgSearch gpgSearch
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
enterGPG "$FFP" "no-confirm" enterGPG "$FFP" "no-confirm"
return 0
else
return 1
fi fi
return
;; ;;
esac esac

View File

@ -5,9 +5,9 @@ export TERM=vt220
export DIALOGRC=dialogrc export DIALOGRC=dialogrc
LOCKFILE=/tmp/irolock LOCKFILE=/tmp/c3reglock
TMP=/tmp/$RANDOM TMP=/tmp/$RANDOM
BT="Intergalactic Registration Office - v0.3" BT="c3Reg - v0.4"
cd $(dirname "$0") cd $(dirname "$0")
@ -133,14 +133,21 @@ function gpgSearch() {
echo "Searching for GPG key..." echo "Searching for GPG key..."
gpg --keyserver "hkps://keys.openpgp.org" --search "$(cat $TMP)" gpg --keyserver "hkps://keys.openpgp.org" --search "$(cat $TMP)"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
export FFP=$(gpg -k "$(cat $TMP)" | head -n 2 | tail -n 1 | awk '{print $1}' | sed 's/.\{4\}/& /g;s/^\(.*\) $/\1/g') FFP=$(gpg -k "$(cat $TMP)" | head -n 2 | tail -n 1 | awk '{print $1}' | sed 's/.\{4\}/& /g;s/^\(.*\) $/\1/g')
gpg --batch --delete-key "$FFP" gpg --batch --delete-key "$FFP"
return 0 if [ "$FFP" = "" ]; then
diaBox "GPG Search" "No fingerprint has been found for $(cat $TMP)"
return 1
else
return 0
fi
else else
gpgSearch diaBox "GPG Search" "No fingerprint has been found for $(cat $TMP)"
return 1
fi fi
else else
gpgSearch diaBox "GPG Search" "This is on vaild mail address."
return 1
fi fi
fi fi
return 1 return 1
@ -167,8 +174,10 @@ function enterGPG() {
gpgSearch gpgSearch
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
enterGPG "$FFP" "no-confirm" enterGPG "$FFP" "no-confirm"
return 0
else
return 1
fi fi
return
;; ;;
esac esac
@ -213,13 +222,13 @@ function printReg() {
return 0 return 0
} }
function printIROStamp() { function printC3RegStamp() {
askForField "IRO stamp" "$1" askForField "c3Reg stamp" "$1"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
checkLockFile checkLockFile
diaBox "Insert Passport" "Please insert passport (Visas) into the printer." diaBox "Insert Passport" "Please insert passport (Visas) into the printer."
cd "$1" cd "$1"
./iro $FIELD ./c3reg $FIELD
cd .. cd ..
rm $LOCKFILE rm $LOCKFILE
return 0 return 0
@ -245,7 +254,7 @@ function askForField() {
==================\n ==================\n
" "
layout[adafruit]=" layout[bounddipl]="
------------------\n ------------------\n
| VISAS || VISAS |\n | VISAS || VISAS |\n
==================\n ==================\n
@ -255,8 +264,20 @@ function askForField() {
==================\n ==================\n
" "
layout[stapleddipl]="
------------------\n
| VISAS || VISAS |\n
==================\n
| 0 | 1 || 4 | 5 |\n
|---|---||---|---|\n
| 2 | 3 || 6 | 7 |\n
==================\n
"
maxfield[jhp]=11 maxfield[jhp]=11
maxfield[adafruit]=7 maxfield[bounddipl]=7
maxfield[stapleddipl]=7
askStr 2 "Select a field" "$text ${layout[$2]}" "" 18 askStr 2 "Select a field" "$text ${layout[$2]}" "" 18
if [ $? -eq 1 ]; then if [ $? -eq 1 ]; then
@ -275,7 +296,8 @@ function askReg() {
# Max length of passport fields # Max length of passport fields
declare -A MAXLENGTH declare -A MAXLENGTH
MAXLENGTH[jhp]=25 MAXLENGTH[jhp]=25
MAXLENGTH[adafruit]=17 MAXLENGTH[bounddipl]=17
MAXLENGTH[stapleddipl]=17
askStr ${MAXLENGTH[$1]} "Forename/Nickname" "Enter forename/nickname" askStr ${MAXLENGTH[$1]} "Forename/Nickname" "Enter forename/nickname"
if [ $? -eq 1 ]; then if [ $? -eq 1 ]; then
@ -297,7 +319,7 @@ function askReg() {
confirm=" Forename: $FNAME\n Surname: $SNAME\n Place: $PLANET" confirm=" Forename: $FNAME\n Surname: $SNAME\n Place: $PLANET"
ynBox "IRO Stamp" "Does this being want to have a IRO stamp?" ynBox "c3Reg Stamp" "Does this being want to have a c3Reg stamp?"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
STAMP=true STAMP=true
else else
@ -321,7 +343,7 @@ function menuFor() {
dialog --backtitle "$BT" \ dialog --backtitle "$BT" \
--menu "Select ID type:" 14 40 3 \ --menu "Select ID type:" 14 40 3 \
1 "Registration" \ 1 "Registration" \
2 "IRO Stamp" \ 2 "c3Reg Stamp" \
3 "GPG" \ 3 "GPG" \
9 "Back" 2> $TMP 9 "Back" 2> $TMP
@ -332,14 +354,14 @@ function menuFor() {
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
printReg "$1" printReg "$1"
if [ "$STAMP" == "true" ]; then if [ "$STAMP" == "true" ]; then
printIROStamp "$1" printC3RegStamp "$1"
fi fi
if [ -n "$FP" ]; then if [ -n "$FP" ]; then
printGPG "$1" printGPG "$1"
fi fi
fi fi
;; ;;
2) printIROStamp "$1" 2) printC3RegStamp "$1"
;; ;;
3) enterGPG 3) enterGPG
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
@ -387,7 +409,8 @@ while [ true ]; do
dialog --backtitle "$BT" \ dialog --backtitle "$BT" \
--menu "Select ID type:" 10 40 3 \ --menu "Select ID type:" 10 40 3 \
1 "Junghackerpass" \ 1 "Junghackerpass" \
2 "New Adafruit passport" \ 2 "Bound diplomatic passport" \
3 "Stapled diplomatic passport" \
9 "Logout" 2> $TMP 9 "Logout" 2> $TMP
if [ $? -eq 9 ]; then if [ $? -eq 9 ]; then
@ -400,7 +423,9 @@ while [ true ]; do
case $TYPE in case $TYPE in
1) menuFor jhp 1) menuFor jhp
;; ;;
2) menuFor adafruit 2) menuFor bounddipl
;;
3) menuFor stapleddipl
;; ;;
9) break 9) break
;; ;;