Skip to content

Commit

Permalink
Command gen-req: Always check for an existing request file
Browse files Browse the repository at this point in the history
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
  • Loading branch information
TinCanTech committed Jun 27, 2024
1 parent 4537ae7 commit 7eab98e
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -2178,15 +2178,25 @@ Run easyrsa without commands for usage and commands."
shift
done

# don't wipe out an existing request without confirmation
[ -f "$req_out" ] && confirm "Confirm request overwrite: " "yes" "\

WARNING!!!

An existing request file was found at
* $req_out

Continuing with key generation will replace this request."

# don't wipe out an existing private key without confirmation
if [ -f "$key_out" ]; then
confirm "Confirm key overwrite: " "yes" "\
[ -f "$key_out" ] && confirm "Confirm key overwrite: " "yes" "\

WARNING!!!

An existing private key was found at $key_out
An existing private key was found at
* $key_out

Continuing with key generation will replace this key."
fi

# When EASYRSA_EXTRA_EXTS is defined,
# append it to openssl's [req] section:
Expand Down

0 comments on commit 7eab98e

Please sign in to comment.