X-Git-Url: https://gerrit.onap.org/r/gitweb?p=aaf%2Fauthz.git;a=blobdiff_plain;f=conf%2FCA%2Fbootstrap.sh;h=8454a3a9f7a49c11f11f223900e489ec7278f3f2;hp=e753493d3a50fa97e602cf2c7a847fe3b7f49383;hb=HEAD;hpb=7a1817bf3cf3c40c6c33f673ddc46c3f115cc3bc diff --git a/conf/CA/bootstrap.sh b/conf/CA/bootstrap.sh index e753493d..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 @@ -90,12 +92,12 @@ fi for ROOT in $(cat san_root.aaf); do SANS="$SANS $ROOT" - for C in service locate oauth gui cm hello; do + for C in service locate oauth token introspect gui cm hello; do SANS="$SANS $C.$ROOT" done done -for C in service locate oauth gui cm hello; do +for C in service locate oauth token introspect gui cm hello; do SANS="$SANS aaf-$C" SANS="$SANS aaf-$C.onap" done @@ -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