X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=conf%2FCA%2Fbootstrap.sh;h=8454a3a9f7a49c11f11f223900e489ec7278f3f2;hb=HEAD;hp=bf9467826cd4b576622f7747796f91e2b451b7e4;hpb=12414fe43077e12d7ef711951b1633ad31d73573;p=aaf%2Fauthz.git diff --git a/conf/CA/bootstrap.sh b/conf/CA/bootstrap.sh index bf946782..8454a3a9 100644 --- a/conf/CA/bootstrap.sh +++ b/conf/CA/bootstrap.sh @@ -32,7 +32,9 @@ if [ ! -e ./serial ]; then fi NAME=aaf.bootstrap -FQDN="${HOSTNAME:=$(hostname -f)}" +HOSTNAME="${HOSTNAME:=$(hostname -)}" +PUBLIC_FQDN="${aaf_locator_public_fqdn:=$HOSTNAME}" +FQDN="${aaf_locator_fqdn:=$PUBLIC_FQDN}" FQI=aaf@aaf.osaaf.org SUBJECT="/CN=$FQDN/OU=$FQI`cat subject.aaf`" SIGNER_P12=$1 @@ -141,14 +143,15 @@ $PASSPHRASE EOF # Make Issuer name -ISSUER=$(openssl x509 -subject -noout -in $SIGNER_CRT | cut -c 10-) -for I in ${ISSUER//\// }; do - if [ -n "$CADI_X509_ISSUER" ]; then - CADI_X509_ISSUER=", $CADI_X509_ISSUER" +ISSUER=$(openssl x509 -subject -noout -in $SIGNER_CRT | cut -c 9- | sed -e 's/ = /=/g' -e 's/\//, /g') +for I in $ISSUER; do + if [ -z "$REVERSE" ]; then + REVERSE="${I%,}" + else + REVERSE="${I%,}, ${REVERSE}" fi - CADI_X509_ISSUER="$I$CADI_X509_ISSUER" done -echo $CADI_X509_ISSUER > $BOOTSTRAP_ISSUER +echo "$REVERSE" > $BOOTSTRAP_ISSUER # Cleanup rm -f $BOOTSTRAP_SAN $BOOTSTRAP_KEY $BOOTSTRAP_CSR $BOOTSTRAP_CRT $SIGNER_KEY $SIGNER_CRT $BOOTSTRAP_CHAIN