summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2014-03-20 19:30:32 +0000
committerMike Frysinger <vapier@gentoo.org>2014-03-20 19:30:32 +0000
commit230019ef0c63d7e1c7807b9e1e0d0411f662f0c4 (patch)
tree726257d416a70cad0bd3e8fcc5ec1b7a26e714d7 /eclass
parentBump to 1.3.1 and patch 1.2.80_p5065 wrt security bug #505170 (diff)
downloadhistorical-230019ef0c63d7e1c7807b9e1e0d0411f662f0c4.tar.gz
historical-230019ef0c63d7e1c7807b9e1e0d0411f662f0c4.tar.bz2
historical-230019ef0c63d7e1c7807b9e1e0d0411f662f0c4.zip
misc style fixes -- do not hardcode full path to `openssl`
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ssl-cert.eclass22
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