Skip to content

Commit

Permalink
Merge branch 'allow-post-date-fix-offset' of ssh://github.com/TinCanT…
Browse files Browse the repository at this point in the history
…ech/easy-rsa into TinCanTech-allow-post-date-fix-offset

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
  • Loading branch information
TinCanTech committed Dec 22, 2022
2 parents 4af00b3 + fc1951a commit 97cea41
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -3510,18 +3510,6 @@ fixed_cert_dates() {
this_year_n="$(busybox date -u +%y)"
today_n="$(busybox date -u +%j)"

# If the start day number is into the future then back-date by one year
if [ "$start_fix_day_n" -gt "$today_n" ]; then
not_valid_until_d="$(( start_fix_day_n - today_n ))"
this_year_n="$(( this_year_n - 1 ))"
# Get user confirmation
# This needs to be less rigid ;-)
confirm " Create certificate with one year back-dated date ? " \
"yes" "\
This certificate will not be valid for '${not_valid_until_d} days'.
The fixed date will be rolled backward by one year."
fi

New_Year_day_s="$(
busybox date -u -d "${this_year_n}01010000.01" '+%s'
)"
Expand All @@ -3547,17 +3535,6 @@ The fixed date will be rolled backward by one year."
this_year_n="$(date -j +%y)"
today_n="$(date -u -j +%j)"

# If the start day number is into the future then back-date by one year
if [ "$start_fix_day_n" -gt "$today_n" ]; then
not_valid_until_d="$(( start_fix_day_n - today_n ))"
this_year_n="$(( this_year_n - 1 ))"
# Get user confirmation
confirm " Create certificate with one year back-dated date ? " \
"yes" "\
This certificate will not be valid for ${not_valid_until_d} days.
The fixed date will be rolled backward by one year."
fi

New_Year_day_d="$(
date -u -j -f %y%m%d%H%M%S "${this_year_n}0101000001" \
+%Y%m%d%H%M.%SZ
Expand All @@ -3584,17 +3561,6 @@ The fixed date will be rolled backward by one year."
# Day of Year number today
today_n="$(date -u +%j)"

# If the start day number is into the future then back-date by one year
if [ "$start_fix_day_n" -gt "$today_n" ]; then
not_valid_until_d="$(( start_fix_day_n - today_n ))"
this_year_n="$(( this_year_n - 1 ))"
# Get user confirmation
confirm " Create certificate with one year back-dated date ? " \
"yes" "\
This certificate will not be valid for ${not_valid_until_d} days.
The fixed date will be rolled backward by one year."
fi

# New Years day date
New_Year_day_d="$(
date -u -d "${this_year_n}-01-01 00:00:01Z" \
Expand Down

0 comments on commit 97cea41

Please sign in to comment.