Obtain ssh parameters from the main project file

This commit is contained in:
Bob Mottram 2016-04-30 10:16:00 +01:00
parent 03e7d379c7
commit 593c7ae36c
1 changed files with 14 additions and 4 deletions

View File

@ -37,11 +37,21 @@ MESH_CLIENT_INSTALL=
# Version number of this script
VERSION="1.01"
# get the main project file, so that some values can be extracted
MAIN_PROJECT_FILE=/usr/local/bin/${PROJECT_NAME}
if [ ! -f $MAIN_PROJECT_FILE ]; then
MAIN_PROJECT_FILE=/usr/bin/${PROJECT_NAME}
fi
if [ ! -f $MAIN_PROJECT_FILE ]; then
echo "The main project file $MAIN_PROJECT_FILE was not found"
exit 72529
fi
# ssh (from https://stribika.github.io/2015/01/04/secure-secure-shell.html)
SSH_CIPHERS="chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr"
SSH_MACS="hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-ripemd160-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-128@openssh.com"
SSH_KEX="curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256"
SSH_HOST_KEY_ALGORITHMS="ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-ed25519,ssh-rsa"
SSH_CIPHERS=$(cat $MAIN_PROJECT_FILE | grep 'SSH_CIPHERS=' | head -n 1 | awk -F '"' '{print $2}')
SSH_MACS=$(cat $MAIN_PROJECT_FILE | grep 'SSH_MACS=' | head -n 1 | awk -F '"' '{print $2}')
SSH_KEX=$(cat $MAIN_PROJECT_FILE | grep 'SSH_KEX=' | head -n 1 | awk -F '"' '{print $2}')
SSH_HOST_KEY_ALGORITHMS=$(cat $MAIN_PROJECT_FILE | grep 'SSH_HOST_KEY_ALGORITHMS=' | head -n 1 | awk -F '"' '{print $2}')
# see https://stribika.github.io/2015/01/04/secure-secure-shell.html
function ssh_remove_small_moduli {