1779 Commits

Author SHA1 Message Date
Richard T Bonhomme
7d310e421c
Merge branch 'correct-default-algo-assign' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-correct-default-algo-assign
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-06 20:20:19 +01:00
Richard T Bonhomme
9316a37417
easyrsa_openssl(): Move escape_hazaard() usage call
Move escape_hazard() to use the same control as easyrsa_rewrite_ssl_config().

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-06 20:04:53 +01:00
Richard T Bonhomme
7d6810ebb9
easyrsa_openssl(): Move saving SAFE SSL config name to correct place
Saving the name of the fully expanded Safe SSL config means that this
config file only has to be built once.

The assignment of working_safe_ssl_conf, which signifies that a Safe
SSL config has already been created, was set too late, which caused
it to be set even if the Safe SSL config had not been created.

Also, include a final check in verify_working_env() to ensure that
working_safe_ssl_conf has not been set prior to executing the issued
command, eg. build-ca.

Also, improve verbose messages and comments.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-06 15:50:26 +01:00
Richard T Bonhomme
601766bdaf
verify_algo_params(): Call SSL lib via EASYRSA_OPENSSL
verify_algo_params() expects errors when settings are not corrrect.
Therefore, is must not use easyrsa_openssl() meta-wrapper, which would
error out with a misleading error message.

Fixing this also ensures that the SAFE SSL config is not built prior
to EASYRSA_REQ_CN being set.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-06 15:44:38 +01:00
Richard T Bonhomme
e68a41c50f
vars_setup(): Always assign EASYRSA_KEY_SIZE
EASYRSA_KEY_SIZE is present in the SSL config file, therefore,
it MUST always be set, regardless of EASYRSA_ALGO in use.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-06 15:39:45 +01:00
Richard T Bonhomme
2141bfa245
Merge branch 'TinCanTech-mutual-exlusion-verbose-and-silent'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-03 00:41:21 +01:00
Richard T Bonhomme
114e548a99
Merge branch 'mutual-exlusion-verbose-and-silent' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-mutual-exlusion-verbose-and-silent
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-03 00:40:45 +01:00
Richard T Bonhomme
ba1b61f53c
mutual_exclusions(): Use of --silent and --verbose is unresolvable
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-02 22:13:48 +01:00
Richard T Bonhomme
604f8d9db2
Merge branch 'TinCanTech-make-safe-ssl-copy-temp-file'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-02 21:10:38 +01:00
Richard T Bonhomme
097d47d112
Merge branch 'make-safe-ssl-copy-temp-file' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-make-safe-ssl-copy-temp-file
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-02 21:09:10 +01:00
Richard T Bonhomme
906df2dcec
easyrsa_openssl(): makesafecnf - Copy temp-file do NOT move it
Command 'easyrsa_openssl makesafecnf' is used internally to create a safe
SSL config file. (By status reports, read_db())

Once the safe SSL config file has been named as a temp-file and created,
the script continues to use that temp-file as the master copy, it does not
recreate a safe SSL config file for subsequent calls to easyrsa_openssl().

Therefore, the temp-file MUST be copied to the standard safe SSL file not
moved. Otherwise, the named temp-file is removed.

Also, move the assignment of the safe SSL temp-file to the correct place.
This means that a new temp-file wiill only be assigned once.

Also, verify that the safe SSL temp-file exists when it is expected to.

Also, change use of '--no--safe-ssl' with LibreSSL to a FATAL error.

Other changes are for error and verbose messages.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-02 20:40:44 +01:00
Richard T Bonhomme
e254ee4451
gen-req: Standardise error message for old easyrsa-openssl.cnf
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-01 22:30:40 +01:00
Richard T Bonhomme
625dae2339
vars.example: Rename EASYRSA_CERT_EXPIRE to EASYRSA_PRE_EXPIRE_WINDOW
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-01 22:05:09 +01:00
Richard T Bonhomme
aa29f444f4
Merge branch 'TinCanTech-update-openssl-conf-warn'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-01 21:58:10 +01:00
Richard T Bonhomme
cbe3f9b70b
Merge branch 'update-openssl-conf-warn' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-update-openssl-conf-warn
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-01 21:57:29 +01:00
Richard T Bonhomme
55ee5fcfde
X509-types insert markers: Move and improve
X509-types insert markers are used by 'awk' to insert data at specific
points in the easyrsa-openssl.cnf file in use.

The checks are moved to below more important imput checks

For build-ca, the check is ONLY done if EASYRSA_EXTRA_EXTS is defined.
This is exceedingly unlikely, because EASYRSA_EXTRA_EXTS is not documented.

For sign-req, the check is only done if --copy-ext isused.

Also, remove an over-indent in "Confirm use of NS extestions"

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-01 21:38:35 +01:00
Richard T Bonhomme
a724ca91d1
sign-req: Require confirm use of deprecated Netscape extensions
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-01 21:17:48 +01:00
Richard T Bonhomme
4f1c16aa9f
sign_req(): Move generte-random-serial-number below input checks
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-01 20:59:19 +01:00
Richard T Bonhomme
f92fa738a9
gen-req, sign-req, build-full: Verify requirements correctly
* gen-req: Use verify_pki_init().
* sign-req: Use verify_ca_init().
* build-full: Defer requirements to functions above.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-01 20:32:49 +01:00
Richard T Bonhomme
8451adee6b
Merge branch 'TinCanTech-remove_secure_session-ROS'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-01 20:17:54 +01:00
Richard T Bonhomme
ddc87e9c0d
Merge branch 'remove_secure_session-ROS' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-remove_secure_session-ROS
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-01 20:17:14 +01:00
Richard T Bonhomme
aca34a051b
Merge branch 'TinCanTech-import-req-check-in-file'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-01 20:12:31 +01:00
Richard T Bonhomme
4c077a5b10
Merge branch 'import-req-check-in-file' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-import-req-check-in-file
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-01 20:11:37 +01:00
Richard T Bonhomme
b8455ad392
import-req: Check input file exists
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-01 19:58:40 +01:00
Richard T Bonhomme
a9192c1866
remove_secure_session(): Add missing 'fi' statement
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-01 14:04:30 +01:00
Richard T Bonhomme
a9bc2ee576
remove_secure_session(): Return-On-Success Only
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-05-01 13:59:31 +01:00
Richard T Bonhomme
15299444a4
Status reports: Use verbose(), remove easyrsa_debug()
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-20 14:22:23 +01:00
Richard T Bonhomme
8eae7213c8
Merge branch 'TinCanTech-expire_status-use-ssl-checkend'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-18 23:48:41 +01:00
Richard T Bonhomme
25ba31ce0a
Merge branch 'expire_status-use-ssl-checkend' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-expire_status-use-ssl-checkend
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-18 23:46:53 +01:00
Richard T Bonhomme
86fb03c538
Correct typo in hash value
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-15 21:45:45 +01:00
Richard T Bonhomme
9c03bb9e94
Unit test: Update openssl hash
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-15 21:38:47 +01:00
Richard T Bonhomme
68fa3342a1
Status reports: Additional check, Use SSL to determine expiration
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-15 15:08:56 +01:00
Richard T Bonhomme
8c1971eaaa
easyrsa_mktemp(): Rename 'target' -> 'want_tmp_file' - Avoid conflicts
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-15 14:35:57 +01:00
Richard T Bonhomme
6e80d08abb
Merge branch 'TinCanTech-prohibit-export-in-vars'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-13 23:34:46 +01:00
Richard T Bonhomme
cee79481b3
Merge branch 'prohibit-export-in-vars' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-prohibit-export-in-vars
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-13 23:34:04 +01:00
Richard T Bonhomme
7be58ded91
vars: WARN use of 'export' and 'unset' in vars file
Use 'set_var' (Supported) or 'force_set_var' (User discretion)

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-13 23:22:13 +01:00
Richard T Bonhomme
91e5535455
Merge branch 'TinCanTech-force-safe-ssl'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-13 22:58:49 +01:00
Richard T Bonhomme
dd30507b5b
Merge branch 'force-safe-ssl' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-force-safe-ssl
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-13 22:58:11 +01:00
Richard T Bonhomme
add08b8be1
Merge branch 'TinCanTech-move-calling-secure_session'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-13 22:53:21 +01:00
Richard T Bonhomme
00de6431e4
Merge branch 'move-calling-secure_session' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-move-calling-secure_session
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-13 22:52:38 +01:00
Richard T Bonhomme
78d1efa64b
secure_session(): Move in verify_working_env() Remove from 'init-pki'
In verify_working_env(), move to AFTER the check for temporary folder.
The move is aesthetic because secure_session() does its own check
for temporary folder.

In 'init-pki', remove secure_session() completely, as not required.

Add more verbose output.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-13 22:42:19 +01:00
Richard T Bonhomme
adc3cd3f5d
Merge branch 'TinCanTech-win-prohibit-pki-in-program-files'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-13 21:58:02 +01:00
Richard T Bonhomme
c85a096f55
Merge branch 'win-prohibit-pki-in-program-files' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-win-prohibit-pki-in-program-files
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-13 21:56:26 +01:00
Richard T Bonhomme
289444ca7d
Windows: Warn when using Windows default location in 'Program Files'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-13 14:40:40 +01:00
Richard T Bonhomme
e093ac1c6d
Introduce global option --force-safe-ssl
easyrsa_openssl() default behaviour is to re-use the generated
safe SSL config file, after bieng called for the first time.
NOTE: easyrsa_openssl() is a heavily nested function.

This option forces recreation of a safe SSL config file for each
call to easyrsa_openssl().

Only effective when an SSL config fie is required.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-12 00:57:23 +01:00
Richard T Bonhomme
2ed6c9d5b2
Merge branch 'TinCanTech-single-use-safe-ssl-conf'
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-10 18:53:45 +01:00
Richard T Bonhomme
0538f1574c
Merge branch 'single-use-safe-ssl-conf' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-single-use-safe-ssl-conf
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-10 18:52:13 +01:00
Richard T Bonhomme
d1c34d4a77
remove_secure_session(): New function to remove secure session
Status reports function read_db() MUST recreate the secure session
for each record of the database being read.

Introduce remove_secure_session(), to remove the session and reset
related flags:
- secure_session: The directory name of the session. Deleted.
- working_safe_ssl_conf - Safe SSL config file.  Deleted.
- mktemp_counter - Count of temp files. Deleted.

Also use remove_secure_session() in cleanup().

Improve some verbose output.
Wrap some long lines.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-10 18:32:08 +01:00
Richard T Bonhomme
9b95eaa8dc
easyrsa_openssl(): Add verbose output when functions are skipped
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-08 23:58:45 +01:00
Richard T Bonhomme
a9b7c6a8a4
status report: Only provide comparison date when certificate exists
If the certificate does not exist then the database date is used.
The database date is a shortened ISO-8601 date, the certifcate date
is presented in a completely different format.

Omit the calculated "seconds since epoch" double check via 'date',
when the certificate does not exist.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
2023-04-08 23:41:01 +01:00