diff options
author | Mike Frysinger <vapier@gentoo.org> | 2014-03-20 19:30:32 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2014-03-20 19:30:32 +0000 |
commit | e7f7fe703395e4be9847b7215747994521230ba2 (patch) | |
tree | 72d0746e8a92b4d86abc6da4e9a13f776e42929a /eclass/ssl-cert.eclass | |
parent | Bump to 1.3.1 and patch 1.2.80_p5065 wrt security bug #505170 (diff) | |
download | gentoo-2-e7f7fe703395e4be9847b7215747994521230ba2.tar.gz gentoo-2-e7f7fe703395e4be9847b7215747994521230ba2.tar.bz2 gentoo-2-e7f7fe703395e4be9847b7215747994521230ba2.zip |
misc style fixes -- do not hardcode full path to `openssl`
Diffstat (limited to 'eclass/ssl-cert.eclass')
-rw-r--r-- | eclass/ssl-cert.eclass | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/eclass/ssl-cert.eclass b/eclass/ssl-cert.eclass index e1acea4cba72..7eb066284fd7 100644 --- a/eclass/ssl-cert.eclass +++ b/eclass/ssl-cert.eclass @@ -1,6 +1,6 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ssl-cert.eclass,v 1.20 2013/01/03 19:19:55 alonbl Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ssl-cert.eclass,v 1.21 2014/03/20 19:30:32 vapier Exp $ # @ECLASS: ssl-cert.eclass # @MAINTAINER: @@ -16,16 +16,14 @@ # @ECLASS-VARIABLE: SSL_CERT_MANDATORY # @DESCRIPTION: # Set to non zero if ssl-cert is mandatory for ebuild. -# -SSL_CERT_MANDATORY="${SSL_CERT_MANDATORY:-0}" +: ${SSL_CERT_MANDATORY:=0} # @ECLASS-VARIABLE: SSL_CERT_USE # @DESCRIPTION: # Use flag to append dependency to. -# -SSL_CERT_USE="${SSL_CERT_USE:-ssl}" +: ${SSL_CERT_USE:=ssl} -if [[ "${SSL_CERT_MANDATORY}" = 0 ]]; then +if [[ "${SSL_CERT_MANDATORY}" == "0" ]]; then DEPEND="${SSL_CERT_USE}? ( dev-libs/openssl )" IUSE="${SSL_CERT_USE}" else @@ -108,7 +106,7 @@ get_base() { gen_key() { local base=`get_base $1` ebegin "Generating ${SSL_BITS} bit RSA key${1:+ for CA}" - /usr/bin/openssl genrsa -rand "${SSL_RANDOM}" \ + openssl genrsa -rand "${SSL_RANDOM}" \ -out "${base}.key" "${SSL_BITS}" &> /dev/null eend $? @@ -125,7 +123,7 @@ gen_key() { gen_csr() { local base=`get_base $1` ebegin "Generating Certificate Signing Request${1:+ for CA}" - /usr/bin/openssl req -config "${SSL_CONF}" -new \ + openssl req -config "${SSL_CONF}" -new \ -key "${base}.key" -out "${base}.csr" &>/dev/null eend $? @@ -145,13 +143,13 @@ gen_crt() { local base=`get_base $1` if [ "${1}" ] ; then ebegin "Generating self-signed X.509 Certificate for CA" - /usr/bin/openssl x509 -extfile "${SSL_CONF}" \ + openssl x509 -extfile "${SSL_CONF}" \ -days ${SSL_DAYS} -req -signkey "${base}.key" \ -in "${base}.csr" -out "${base}.crt" &>/dev/null else local ca=`get_base 1` ebegin "Generating authority-signed X.509 Certificate" - /usr/bin/openssl x509 -extfile "${SSL_CONF}" \ + openssl x509 -extfile "${SSL_CONF}" \ -days ${SSL_DAYS} -req -CAserial "${SSL_SERIAL}" \ -CAkey "${ca}.key" -CA "${ca}.crt" \ -in "${base}.csr" -out "${base}.crt" &>/dev/null @@ -246,7 +244,7 @@ install_cert() { install -m0444 "${base}.csr" "${ROOT}${cert}.csr" install -m0444 "${base}.crt" "${ROOT}${cert}.crt" install -m0400 "${base}.pem" "${ROOT}${cert}.pem" - count=$((${count}+1)) + : $(( ++count )) done # Resulting status |