The install location of libfaketime varies across distributions.
+findLibfaketime() {
+ for candidate in /usr/lib/faketime/libfaketime.so.1 /usr/lib/*/faketime/libfaketime.so.1; do
+ if [[ -f "$candidate" ]]; then
+ printf '%s\n' "$candidate"
+ return
+ fi
+ done
+ printf >&2 'error: no libfaketime found\n'
+ exit 1 # unfortunately, this will only exit the $() subshell
+}
+
echo CRL $1 $2-$3
BASE="$PWD"
pushd $1.ca > /dev/null
echo CRL $1 $2-$3
BASE="$PWD"
pushd $1.ca > /dev/null
- TZ=UTC LD_PRELOAD=`ls /usr/lib/*/faketime/libfaketime.so.1` FAKETIME="${year}-${month}-01 00:00:00" openssl ca -gencrl -config "$BASE/../selfsign.config" -keyfile key.key -cert key.crt -crldays 35 -out $2_$3.crl
+ TZ=UTC LD_PRELOAD="$(findLibfaketime)" FAKETIME="${year}-${month}-01 00:00:00" openssl ca -gencrl -config "$BASE/../selfsign.config" -keyfile key.key -cert key.crt -crldays 35 -out $2_$3.crl
openssl req -new -key $1.key -out $1.csr -subj "$2"
caSign $1 $year/ca/env_${year}_1 "$3" "${year}${points[1]}" "$((${year} + 2))${points[1]}"
openssl req -new -key $1.key -out $1.csr -subj "$2"
caSign $1 $year/ca/env_${year}_1 "$3" "${year}${points[1]}" "$((${year} + 2))${points[1]}"
- TZ=UTC LD_PRELOAD=`ls /usr/lib/*/faketime/libfaketime.so.1` FAKETIME="${year}-01-01 00:00:00" openssl pkcs12 -inkey $1.key -in $1.crt -CAfile env.chain.crt -chain -name $1 -export -passout pass:changeit -out $1.pkcs12 -name "$4"
+ TZ=UTC LD_PRELOAD="$(findLibfaketime)" FAKETIME="${year}-01-01 00:00:00" openssl pkcs12 -inkey $1.key -in $1.crt -CAfile env.chain.crt -chain -name $1 -export -passout pass:changeit -out $1.pkcs12 -name "$4"