Skip to content

Commit

Permalink
ssl-cert.eclass: add libressl support
Browse files Browse the repository at this point in the history
  • Loading branch information
blueness committed Apr 19, 2016
1 parent 96c8f60 commit e21b7de
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions eclass/ssl-cert.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@

if [[ "${SSL_DEPS_SKIP}" == "0" ]]; then
if [[ "${SSL_CERT_MANDATORY}" == "0" ]]; then
DEPEND="${SSL_CERT_USE}? ( dev-libs/openssl:0 )"
DEPEND="${SSL_CERT_USE}? ( || ( dev-libs/openssl:0 dev-libs/libressl:0 ) )"
IUSE="${SSL_CERT_USE}"
else
DEPEND="dev-libs/openssl:0"
DEPEND="|| ( dev-libs/openssl:0 dev-libs/libressl:0 )"
fi
fi

Expand Down Expand Up @@ -113,8 +113,12 @@ get_base() {
gen_key() {
local base=$(get_base "$1")
ebegin "Generating ${SSL_BITS} bit RSA key${1:+ for CA}"
openssl genrsa -rand "${SSL_RANDOM}" \
-out "${base}.key" "${SSL_BITS}" &> /dev/null
if openssl version | grep -i libressl > /dev/null; then
openssl genrsa -out "${base}.key" "${SSL_BITS}" &> /dev/null
else
openssl genrsa -rand "${SSL_RANDOM}" \
-out "${base}.key" "${SSL_BITS}" &> /dev/null
fi
eend $?

return $?
Expand Down

0 comments on commit e21b7de

Please sign in to comment.