From 9a4b98246ba3cbce8c26f245caacefb32ed41be1 Mon Sep 17 00:00:00 2001 From: Richard T Bonhomme Date: Thu, 9 Feb 2023 00:41:45 +0000 Subject: [PATCH] secure_session(): Wrap long lines Signed-off-by: Richard T Bonhomme --- easyrsa3/easyrsa | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index d7dc21d..43b2ab6 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -593,8 +593,9 @@ Type the word '$value' to continue, or any other input to abort." # Generate random hex # Cannot use easyrsa-openssl() due to chicken vs egg, -# easyrsa_openssl() creates temp-files, which needs `openssl rand`. -# Redirect error-out, because LibreSSL complains of missing conf. +# easyrsa_openssl() creates temp-files, +# which needs `openssl rand`. +# Redirect error-out, ignore complaints of missing config easyrsa_random() { case "$1" in (*[!1234567890]*|0*|"") : ;; # invalid input @@ -608,22 +609,25 @@ easyrsa_random() { # Create session directory atomically or fail secure_session() { # Session is already defined - [ "$EASYRSA_TEMP_DIR_session" ] && die "session overload" + [ "$EASYRSA_TEMP_DIR_session" ] && \ + die "session overload" # temporary directory must exist - if [ "$EASYRSA_TEMP_DIR" ] && [ -d "$EASYRSA_TEMP_DIR" ] + if [ "$EASYRSA_TEMP_DIR" ] && \ + [ -d "$EASYRSA_TEMP_DIR" ] then : # ok else - die "Non-existant temporary directory: $EASYRSA_TEMP_DIR" + die "Non-existant temporary directory: +* $EASYRSA_TEMP_DIR" fi for i in 1 2 3; do - random_session="$( + session="$( easyrsa_random 4 - )" || die "secure_session - random_session '$random_session'" + )" || die "secure_session - session" - EASYRSA_TEMP_DIR_session="${EASYRSA_TEMP_DIR}/${random_session}" + EASYRSA_TEMP_DIR_session="${EASYRSA_TEMP_DIR}/${session}" # atomic: mkdir "$EASYRSA_TEMP_DIR_session" && return done