X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=commonFunctions;h=f46505b445d912f2d311f7f03bc6474003c616df;hb=33ef004d3397046e13bc94533c81ccc3261d6a9c;hp=8b12bf43a3de730cae46440ffeb22cb2fb8bde43;hpb=6ba8d258f7f3601d8e0be4425f790210b4ea4a87;p=nre.git diff --git a/commonFunctions b/commonFunctions old mode 100755 new mode 100644 index 8b12bf4..f46505b --- a/commonFunctions +++ b/commonFunctions @@ -3,7 +3,7 @@ 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" + openssl req -new -key $2.key -out $2.csr -subj "$1/O=Test Environment CA Ltd./OU=Test Environment CAs/C=AU" } @@ -26,7 +26,7 @@ caSign(){ # csr,ca,config,start,end [[ "$end" != "" ]] && end="-enddate $end" [[ "$start" == "" && "$end" == "" ]] && start="$ROOT_VALIDITY" BASE="$PWD" - echo "Signing: $1 with $2" + echo "Signing: $BASE/$1 with $2" echo "$start $end" pushd $2.ca > /dev/null if [[ "$2" == "root" && "$1" == root.* ]]; then @@ -34,7 +34,7 @@ caSign(){ # csr,ca,config,start,end else 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 + 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" }