Skip to content

Commit

Permalink
Merge branch 'TinCanTech-remove-index.txt.attr'
Browse files Browse the repository at this point in the history
Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Oct 2, 2024
2 parents 020399f + 7c9545d commit fa887bb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Easy-RSA 3 ChangeLog

3.2.2 (TBD)

* Remove redundant file index.txt.attr (da3c249) (#1233)

3.2.1 (2024-09-13)

* inline: Add decimal value for cert. serial (Linux Only) (b33038e) (#1222)
Expand Down
4 changes: 0 additions & 4 deletions dev/easyrsa-tools.lib
Original file line number Diff line number Diff line change
Expand Up @@ -692,10 +692,6 @@ Run easyrsa without commands for usage and command help."
creds_in="$in_dir/${file_name_base}.creds"
inline_in="$in_dir/inline/${file_name_base}.inline"

# Upgrade CA index.txt.attr - unique_subject = no
print 'unique_subject = no' > "$EASYRSA_PKI/index.txt.attr" || \
die "Failed to upgrade CA to support renewal."

# deprecate ALL options
while [ "$1" ]; do
case "$1" in
Expand Down
12 changes: 7 additions & 5 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,12 @@ cleanup() {
print; cat "$easyrsa_err_log"; print
fi

# Remove redundant file: index.txt.attr
if [ -f "$EASYRSA_PKI"/index.txt.attr ]; then
rm -f "$EASYRSA_PKI"/index.txt.attr
verbose "cleanup: DELETED $EASYRSA_PKI/index.txt.attr"
fi

# undo changes BEFORE delete temp-dir
# Remove files when build_full()->sign_req() is interrupted
[ "$error_build_full_cleanup" ] && \
Expand Down Expand Up @@ -1307,9 +1313,7 @@ Run easyrsa without commands for usage and command help."
# Verify expected files are present.
# Allow files to be regular files (or symlinks),
# but also pipes, for flexibility with ca.key
for i in ca.crt private/ca.key \
index.txt index.txt.attr serial
do
for i in ca.crt private/ca.key index.txt serial; do
if [ ! -f "$EASYRSA_PKI/$i" ] && \
[ ! -p "$EASYRSA_PKI/$i" ]
then
Expand Down Expand Up @@ -1671,8 +1675,6 @@ Unable to create necessary PKI files (permissions?)"
# create necessary files:
printf "" > \
"$EASYRSA_PKI/index.txt" || die "$err_msg"
printf '%s\n' 'unique_subject = no' \
> "$EASYRSA_PKI/index.txt.attr" || die "$err_msg"
printf '%s\n' "01" \
> "$EASYRSA_PKI/serial" || die "$err_msg"
unset -v err_msg
Expand Down

0 comments on commit fa887bb

Please sign in to comment.