genKey(){ #subj, internalName
openssl genrsa -out $2.key ${KEYSIZE}
- openssl req -new -key $2.key -out $2.csr -subj "$1/O=Test Environment CA Ltd./OU=Test Environment CAs/C=AU"
+ openssl req -new -key $2.key -out $2.csr -subj "$1/O=$ORGANIZATION/OU=$ORGANIZATIONAL_UNIT/C=$COUNTRY"
}
echo "$start $end"
pushd $2.ca > /dev/null
if [[ "$2" == "root" && "$1" == root.* ]]; then
- signkey="-selfsign"
+ signkey="-selfsign"
else
- signkey="-cert key.crt"
+ signkey="-cert key.crt"
fi
openssl ca $signkey -keyfile key.key -in "$BASE/$1.csr" -out "$BASE/$1.crt" -batch -config "$BASE/../selfsign.config" -extfile "$BASE/$3" $start $end
popd > /dev/null
echo "Signed"
}
+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
+}