Skip to content

inline_file(): Use ssl_cert_serial() #1343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ Easy-RSA 3 ChangeLog

3.2.3 (TBD)

* verify_pki_init(): Always create 'issued' dir (f7e1b79) (#1343)
* inline_file(): Use ssl_cert_serial() (c0d2e82) (#1343)
* forbid_selfsign(): Compare cert serial to signing cert serial (29b2779) (#1342)
* Unit-test: Minimize Windows test (dc60c8b) (#1339)
* ssl_cert_x509v3_eku(): Localize variables and minor improvements (8c19a95) (#1337)
Expand Down
14 changes: 8 additions & 6 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,7 @@ easyrsa_mkdir() {
[ "$1" ] || die "easyrsa_mkdir - input"
[ -d "$1" ] && return

verbose "$fn_name; easyrsa_mkdir $1"
if [ "$easyrsa_host_os" = win ]; then
mkdir "$1" 2>/dev/null # win11 never errors here
[ -d "$1" ] && return
Expand Down Expand Up @@ -1351,6 +1352,9 @@ Missing expected directory: $i
$help_note"
done
unset -v help_note

# Always create 'issued' dir, useful for inline files
easyrsa_mkdir "$EASYRSA_PKI"/issued
} # => verify_pki_init()

# Verify core CA files present
Expand Down Expand Up @@ -3038,13 +3042,11 @@ $(cat "$crt_source")
# for '--crl-verify /path/to/dir dir'
# For reasons unknown..
if which bc >/dev/null; then
crt_serial="$(
"$EASYRSA_OPENSSL" x509 -in "$crt_source" \
-noout -serial
)" || die "inline_file - SSL -serial failed"
crt_serial="${crt_serial#*=}"
inline_crt_serial=
ssl_cert_serial "$crt_source" inline_crt_serial || \
die "inline_file - ssl_cert_serial"
crt_serial_dec="$(
echo "ibase=16; $crt_serial" | bc
echo "ibase=16; $inline_crt_serial" | bc
)" || die "inline_file - HEX to DEC failed"
else
crt_serial_dec="Unavailable"
Expand Down