460da50
From 44343cb1ca4232f23dba24cab98d3605686f5700 Mon Sep 17 00:00:00 2001
460da50
From: Timothy Redaelli <tredaelli@redhat.com>
460da50
Date: Fri, 7 Sep 2018 15:14:53 +0200
460da50
Subject: [PATCH] dhparams: Fix .c file generation with OpenSSL >= 1.1.1-pre9
460da50
460da50
Since OpenSSL upstream commit 201b305a2409
460da50
("apps/dsaparam.c generates code that is intended to be pasted or included into
460da50
an existing source file: the function is static, and the code doesn't include
460da50
dsa.h.  Match the generated C source style of dsaparam.") "openssl dhparam -C"
460da50
generates the get_dh functions as static, but the functions are used inside
460da50
stream-ssl.c and so the static keyword cannot be used.
460da50
460da50
This commit removes the static keyword from the get_dh functions during
460da50
dhparams.c file generation by restoring the current behaviour.
460da50
460da50
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
460da50
Signed-off-by: Ben Pfaff <blp@ovn.org>
460da50
(cherry picked from commit dc041eae5019a936618c398a2a1d106f65604ccc)
460da50
---
460da50
 lib/automake.mk | 2 +-
460da50
 1 file changed, 1 insertion(+), 1 deletion(-)
460da50
460da50
diff --git a/lib/automake.mk b/lib/automake.mk
460da50
index 8ecad1241..70461ec8c 100644
460da50
--- a/lib/automake.mk
460da50
+++ b/lib/automake.mk
460da50
@@ -438,7 +438,7 @@ lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
460da50
 	 openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout &&	\
460da50
 	 openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout &&	\
460da50
 	 openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout)	\
460da50
-	| sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp &&  \
460da50
+	| sed 's/^static DH/DH/; s/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp &&  \
460da50
 	mv lib/dhparams.c.tmp lib/dhparams.c
460da50
 else
460da50
 lib_libopenvswitch_la_SOURCES += lib/stream-nossl.c
460da50
-- 
460da50
2.17.1
460da50