summaryrefslogtreecommitdiff
path: root/eclass/ssl-cert.eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass/ssl-cert.eclass')
-rw-r--r--eclass/ssl-cert.eclass52
1 files changed, 26 insertions, 26 deletions
diff --git a/eclass/ssl-cert.eclass b/eclass/ssl-cert.eclass
index bb3e349c8c6e..de2be55e0d03 100644
--- a/eclass/ssl-cert.eclass
+++ b/eclass/ssl-cert.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: ssl-cert.eclass
@@ -22,6 +22,8 @@ esac
if [[ -z ${_SSL_CERT_ECLASS} ]]; then
_SSL_CERT_ECLASS=1
+inherit edo
+
# @ECLASS_VARIABLE: SSL_CERT_MANDATORY
# @PRE_INHERIT
# @DESCRIPTION:
@@ -42,10 +44,16 @@ _SSL_CERT_ECLASS=1
if [[ "${SSL_DEPS_SKIP}" == "0" ]]; then
if [[ "${SSL_CERT_MANDATORY}" == "0" ]]; then
- BDEPEND="${SSL_CERT_USE}? ( || ( dev-libs/openssl:0 dev-libs/libressl:0 ) )"
+ RDEPEND="${SSL_CERT_USE}? ( || ( dev-libs/openssl dev-libs/libressl ) )"
+ if [[ ${EAPI} != 7 ]]; then
+ IDEPEND="${SSL_CERT_USE}? ( || (dev-libs/openssl dev-libs/libressl ))"
+ fi
IUSE="${SSL_CERT_USE}"
else
- BDEPEND="|| ( dev-libs/openssl:0 dev-libs/libressl:0 )"
+ RDEPEND="|| ( dev-libs/openssl dev-libs/libressl )"
+ if [[ ${EAPI} != 7 ]]; then
+ IDEPEND="|| ( dev-libs/openssl dev-libs/libressl )"
+ fi
fi
fi
@@ -61,9 +69,6 @@ gen_cnf() {
SSL_CONF="${T}/${$}ssl.cnf"
# Location of the CA serial file
SSL_SERIAL="${T}/${$}ca.ser"
- # Location of some random files OpenSSL can use: don't use
- # /dev/u?random here -- doesn't work properly on all platforms
- SSL_RANDOM="${T}/environment:${T}/eclass-debug.log:/etc/resolv.conf"
# These can be overridden in the ebuild
SSL_DAYS="${SSL_DAYS:-730}"
@@ -146,11 +151,9 @@ gen_key() {
#
gen_csr() {
local base=$(get_base "$1")
- ebegin "Generating Certificate Signing Request${1:+ for CA}"
- openssl req -config "${SSL_CONF}" -new \
- -key "${base}.key" -out "${base}.csr" &>/dev/null
- eend $?
-
+ nonfatal edob -m "Generating Certificate Signing Request${1:+ for CA}" \
+ openssl req -config "${SSL_CONF}" -new \
+ -key "${base}.key" -out "${base}.csr"
return $?
}
@@ -166,21 +169,19 @@ gen_csr() {
gen_crt() {
local base=$(get_base "$1")
if [ "${1}" ] ; then
- ebegin "Generating self-signed X.509 Certificate for CA"
- openssl x509 -extfile "${SSL_CONF}" \
- -${SSL_MD} \
- -days ${SSL_DAYS} -req -signkey "${base}.key" \
- -in "${base}.csr" -out "${base}.crt" &>/dev/null
+ nonfatal edob -m "Generating self-signed X.509 Certificate for CA" \
+ openssl x509 -extfile "${SSL_CONF}" \
+ -${SSL_MD} \
+ -days ${SSL_DAYS} -req -signkey "${base}.key" \
+ -in "${base}.csr" -out "${base}.crt"
else
local ca=$(get_base 1)
- ebegin "Generating authority-signed X.509 Certificate"
- openssl x509 -extfile "${SSL_CONF}" \
- -days ${SSL_DAYS} -req -CAserial "${SSL_SERIAL}" \
- -CAkey "${ca}.key" -CA "${ca}.crt" -${SSL_MD} \
- -in "${base}.csr" -out "${base}.crt" &>/dev/null
+ nonfatal edob -m "Generating authority-signed X.509 Certificate" \
+ openssl x509 -extfile "${SSL_CONF}" \
+ -days ${SSL_DAYS} -req -CAserial "${SSL_SERIAL}" \
+ -CAkey "${ca}.key" -CA "${ca}.crt" -${SSL_MD} \
+ -in "${base}.csr" -out "${base}.crt"
fi
- eend $?
-
return $?
}
@@ -216,9 +217,8 @@ install_cert() {
fi
case ${EBUILD_PHASE} in
- unpack|prepare|configure|compile|test|install)
- die "install_cert cannot be called in ${EBUILD_PHASE}"
- ;;
+ config|preinst|postinst) ;;
+ *) die "install_cert cannot be called in ${EBUILD_PHASE}" ;;
esac
# Generate a CA environment #164601