From b88d75ad2dc471edd9da2e0678e6788175305f9e Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Sat, 21 Oct 2017 17:19:31 -0700 Subject: [PATCH] --make_INSECURE_key to allow fast tests --- overonion-make-key | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.44.1