Bugfix for invalid keys-check
This commit is contained in:
parent
fe2b275779
commit
7326d8f70d
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
export PATH="/usr/bin:/bin:/usr/sbin:/sbin"
|
export PATH="/usr/bin:/bin:/usr/sbin:/sbin"
|
||||||
@ -22,10 +22,11 @@ do
|
|||||||
find "${dest}/keys" -name '*.pub' | sort | \
|
find "${dest}/keys" -name '*.pub' | sort | \
|
||||||
while read keyfile
|
while read keyfile
|
||||||
do
|
do
|
||||||
valid_key=$(ssh-keygen -l -f ${keyfile})
|
ssh-keygen -l -f ${keyfile} &> /dev/null
|
||||||
if [ "$?" -eq "0" ]; then
|
if [ $? -eq 0 ]; then
|
||||||
if [ $(echo "${valid_key}" | cut -d" " -f1) -lt "4096" ]; then
|
key_length=`ssh-keygen -l -f ${keyfile} | cut -d" " -f1`
|
||||||
echo "Size of key ${keyfile} is less than 4096. Not adding it to key database." >&2
|
if [ ${key_length} -lt 4096 ]; then
|
||||||
|
echo "Key size of key ${keyfile} not equal to 4096. Not adding it to key database." >&2
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user