From: Joni Hahkala Date: Fri, 10 Feb 2012 13:42:31 +0000 (+0000) Subject: fixes from frantisek to make the hostname and ca name hashing work also on sl5 and 6 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=13622f056480880baaaf3bb9fdef783812728746;p=glite-security-test-utils.git fixes from frantisek to make the hostname and ca name hashing work also on sl5 and 6 --- diff --git a/bin/generate-test-certificates.sh b/bin/generate-test-certificates.sh index 9f723cb..20a18f4 100755 --- a/bin/generate-test-certificates.sh +++ b/bin/generate-test-certificates.sh @@ -514,7 +514,11 @@ function add_ca_grid_sec { if [ ! -d 'grid-security/certificates-slashwithoutnamespaces' ]; then mkdir -p 'grid-security/certificates-slashwithoutnamespaces' fi - hash=$(openssl x509 -subject_hash_old -noout -in $1-ca/$1.cert) + if [ x"`openssl version`" \< x"OpenSSL 1.0.0" ]; then + hash=$(openssl x509 -hash -noout -in $1-ca/$1.cert) + else + hash=$(openssl x509 -subject_hash_old -noout -in $1-ca/$1.cert) + fi cp $1-ca/$1.cert grid-security/certificates/${hash}.0 cp $1-ca/$1.crl grid-security/certificates/${hash}.r0 # generating a signing_policy file @@ -1219,7 +1223,7 @@ which openssl openssl version #get full hostname -hostname_space=`hostname -A` +hostname_space=`hostname -A 2>/dev/null || hostname -f` #remove trailing space hostname_full=`echo $hostname_space` echo host name is [$hostname_full]