3 Commits

Author SHA1 Message Date
e623d7f21a ed25519 support
My attempt to get ed25519 support for the doors in the script.
Please check function and syntax!
2020-05-21 20:11:56 +02:00
8856ba9cf4 New repo; Howto config 2020-05-21 12:12:28 +02:00
7326d8f70d Bugfix for invalid keys-check 2016-03-31 16:00:53 +02:00
2 changed files with 22 additions and 6 deletions

View File

@ -29,6 +29,19 @@ Der Deamon besteht aus folgenden Dateien.
* foodoor-ssh-wrapper
* foodoor-update-keydb
Zusätzlich sollte für das git-repo eine Config angelegt werden:
/root/.ssh/config
```
Host git.chaospott.de
User git
Port 2222
IdentityFile ~/.ssh/id_chaospott
```
Das IdentityFile ist der Deploy-SSH-Key, der im [Repo](https://git.chaospott.de/Chaospott/foodoor-keys) hinterlegt ist.
##Schüssel
###Schlüsselupdate

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
set -e
export PATH="/usr/bin:/bin:/usr/sbin:/sbin"
@ -9,7 +9,7 @@ dest=/var/run/foodoor-keys
if [ ! -e "${dest}/.git/config" ]
then
#echo "Repo does not exist, trying to clone..."
( cd /var/run && git clone --quiet --single-branch --depth=1 luftschleuse@nordstern.chaospott.de:/home/luftschleuse/foodoor-keys "${dest}" )
( cd /var/run && git clone --quiet --single-branch --depth=1 ssh://git.chaospott.de/Chaospott/foodoor-keys.git "${dest}" )
else
#echo "Repo exists, updating..."
( cd "${dest}" && git fetch --quiet && git merge --quiet origin/master master )
@ -22,10 +22,13 @@ do
find "${dest}/keys" -name '*.pub' | sort | \
while read keyfile
do
valid_key=$(ssh-keygen -l -f ${keyfile})
if [ "$?" -eq "0" ]; then
if [ $(echo "${valid_key}" | cut -d" " -f1) -lt "4096" ]; then
echo "Size of key ${keyfile} is less than 4096. Not adding it to key database." >&2
ssh-keygen -l -f ${keyfile} &> /dev/null
if [ $? -eq 0 ]; then
key_length=`ssh-keygen -l -f ${keyfile} | cut -d" " -f1`
if ssh-keygen -l -f id_ed25519.pub| cut -d" " -f4 == "(ED25519)"; then
key_length += 3840
if [ ${key_length} -lt 4096 ]; then
echo "Key size of key ${keyfile} not equal to 4096. Not adding it to key database." >&2
continue
fi
fi