From e428424cf0b420be4fa7c6f29c21267373002f8e Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Sun, 9 Mar 2014 16:08:41 +0800 Subject: [PATCH] [ssl_mgmt] Change pattern delimiter: s/#/@/ --- ssl_mgmt/openssl.cnf.in | 16 ++++++++-------- ssl_mgmt/ssl_mgmt | 18 +++++++++--------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ssl_mgmt/openssl.cnf.in b/ssl_mgmt/openssl.cnf.in index aa9d14a..f5850f1 100644 --- a/ssl_mgmt/openssl.cnf.in +++ b/ssl_mgmt/openssl.cnf.in @@ -14,7 +14,7 @@ database = $dir/index.txt new_certs_dir = $dir/newcerts certificate = $dir/certs/ca-cert.pem private_key = $dir/private/ca-key.pem -default_days = #LENGTH# # Certificates are signed for default_days days +default_days = @LENGTH@ # Certificates are signed for default_days days default_md = md5 preserve = no email_in_dn = no @@ -48,12 +48,12 @@ req_extensions = v3_req x509_extensions = v3_ca [ req_distinguished_name ] -organizationName = #ORG# -organizationalUnitName = #ORGUNIT# -localityName = #LOCALITY# -stateOrProvinceName = #STATE# -countryName = #COUNTRY# -commonName = #COMMONNAME# +organizationName = @ORG@ +organizationalUnitName = @ORGUNIT@ +localityName = @LOCALITY@ +stateOrProvinceName = @STATE@ +countryName = @COUNTRY@ +commonName = @COMMONNAME@ [ v3_ca ] basicConstraints = CA:TRUE @@ -63,4 +63,4 @@ authorityKeyIdentifier = keyid:always,issuer:always [ v3_req ] basicConstraints = CA:FALSE subjectKeyIdentifier = hash -subjectAltName = #ALTNAME# +subjectAltName = @ALTNAME@ diff --git a/ssl_mgmt/ssl_mgmt b/ssl_mgmt/ssl_mgmt index 51456f7..9355c26 100755 --- a/ssl_mgmt/ssl_mgmt +++ b/ssl_mgmt/ssl_mgmt @@ -172,14 +172,14 @@ generate_config () { local - replaceCmd cnfTmpFile - replaceCmd="$(add_to_replace_cmd "${replaceCmd:-}" "#LENGTH#" "${days:-}")" - replaceCmd="$(add_to_replace_cmd "$replaceCmd" "#ORG#" "${organization:-}")" - replaceCmd="$(add_to_replace_cmd "$replaceCmd" "#ORGUNIT#" "${unit:-}")" - replaceCmd="$(add_to_replace_cmd "$replaceCmd" "#LOCALITY#" "${city:-}")" - replaceCmd="$(add_to_replace_cmd "$replaceCmd" "#STATE#" "${state:-}")" - replaceCmd="$(add_to_replace_cmd "$replaceCmd" "#COUNTRY#" "${country:-}")" - replaceCmd="$(add_to_replace_cmd "$replaceCmd" "#COMMONNAME#" "${commonName:-}")" - replaceCmd="$(add_to_replace_cmd "$replaceCmd" "#ALTNAME#" "${altName:-}")" + replaceCmd="$(add_to_replace_cmd "${replaceCmd:-}" "@LENGTH@" "${days:-}")" + replaceCmd="$(add_to_replace_cmd "$replaceCmd" "@ORG@" "${organization:-}")" + replaceCmd="$(add_to_replace_cmd "$replaceCmd" "@ORGUNIT@" "${unit:-}")" + replaceCmd="$(add_to_replace_cmd "$replaceCmd" "@LOCALITY@" "${city:-}")" + replaceCmd="$(add_to_replace_cmd "$replaceCmd" "@STATE@" "${state:-}")" + replaceCmd="$(add_to_replace_cmd "$replaceCmd" "@COUNTRY@" "${country:-}")" + replaceCmd="$(add_to_replace_cmd "$replaceCmd" "@COMMONNAME@" "${commonName:-}")" + replaceCmd="$(add_to_replace_cmd "$replaceCmd" "@ALTNAME@" "${altName:-}")" sed "$replaceCmd" $confFile.in > $confFile if ask_user_default_no "Do you want to edit the openssl configuration file?" then @@ -192,7 +192,7 @@ generate_config () fi cnfTmpFile="$(mktemp --tmpdir=. openssl.cnf.XXXXXXXXXX)" mv $confFile $cnfTmpFile - grep -v "#[A-Z]\+#" $cnfTmpFile > $confFile + grep -v "@[A-Z]\+@" $cnfTmpFile > $confFile rm $cnfTmpFile }