File 0371-Fixes-ERL-675.patch of Package erlang

From 209d778c494d66445326bb3da4232f567298327a Mon Sep 17 00:00:00 2001
From: Stevie Graham <>
Date: Thu, 26 Jul 2018 14:27:07 +0100
Subject: [PATCH 1/2] Fixes ERL-675

RSA options rsa_mgf1_md, rsa_oaep_md, and rsa_oaep_label do not work.

PR #838, which reimplemented various parts of the crypto application to use
OpenSSL EVP APIs was merged manually. During the manual merge the macro
define for HAVE_RSA_OAEP_MD was lost. The result being that setting
rsa_mgf1_md and rsa_oaep_md for any other value than sha causes the nif to
return not_sup.

Support for configurable MGF1 digests and OAEP labels is available in
OpenSSL version 1.1.0, a cursory look at libressl does not seem to reveal
support, so it is not added in this PR.

The defective functionality has been returned by defining HAVE_RSA_OAEP_MD
alongside HAVE_CHACHA20_POLY1305, i.e. OpenSSL >= 1.1.0 and NOT libressl.
 lib/crypto/c_src/crypto.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c
index 6eeebb67a2..2fa1082dbb 100644
--- a/lib/crypto/c_src/crypto.c
+++ b/lib/crypto/c_src/crypto.c
@@ -179,6 +179,7 @@
 # ifndef HAS_LIBRESSL
 #  define HAVE_CHACHA20_POLY1305
+#  define HAVE_RSA_OAEP_MD
 # endif