From: Scott Worley Date: Sun, 22 Oct 2017 00:19:31 +0000 (-0700) Subject: --make_INSECURE_key to allow fast tests X-Git-Url: http://git.scottworley.com/overonion/commitdiff_plain/b88d75ad2dc471edd9da2e0678e6788175305f9e?hp=d778dfea549bb736863c6b24b6fd1950577b0a5c --make_INSECURE_key to allow fast tests --- diff --git a/overonion-make-key b/overonion-make-key index b909d97..6cfc349 100755 --- a/overonion-make-key +++ b/overonion-make-key @@ -17,6 +17,12 @@ ciphers=( umask 077 +random_source="/dev/random" +if [[ "$1" == '--make_INSECURE_key' ]];then + shift + random_source="/dev/urandom" +fi + if (( $# != 1));then echo "usage: overonion-make-key keyfile" exit 1 @@ -30,6 +36,6 @@ fi i=0 while read -r cipher;do echo -n $'\r'"Generating key $((++i))/${#ciphers[*]}" - cat >> "$keyfile" <<< "$cipher $(head -c 99 /dev/random | base64 --wrap=0 )" + cat >> "$keyfile" <<< "$cipher $(head -c 99 "$random_source" | base64 --wrap=0 )" done < <( IFS=$'\n'; shuf <<< "${ciphers[*]}"; ) echo