Since OpenSSL upstream commit 201b305a2409
("apps/dsaparam.c generates code that is intended to be pasted or included into
an existing source file: the function is static, and the code doesn't include
dsa.h.  Match the generated C source style of dsaparam.") "openssl dhparam -C"
generates the get_dh functions as static, but the functions are used inside
stream-ssl.c and so the static keyword cannot be used.

This commit removes the static keyword from the get_dh functions during
dhparams.c file generation by restoring the current behaviour.

Signed-off-by: Timothy Redaelli <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
(cherry picked from commit dc041eae5019a936618c398a2a1d106f65604ccc)
---
Backport notice:
On OVS 2.9.x the dhparams.c file is generated each time at build time
and generate-dhparams-c doesn't exists. This commit does the same thing,
but by modifying dhparam.c generation on lib/automake.mk instead.

This is needed to build OVS 2.9 with new OpenSSL versions since
dhparams.c is not cached on OVS 2.9.x.
---
 lib/automake.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/automake.mk b/lib/automake.mk
index 8ecad1241..70461ec8c 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -438,7 +438,7 @@ lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
         openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout &&      \
         openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout &&      \
         openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout)        \
-       | sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp &&  \
+       | sed 's/^static DH/DH/; s/\(get_dh[0-9]*\)()/\1(void)/' > 
lib/dhparams.c.tmp &&  \
        mv lib/dhparams.c.tmp lib/dhparams.c
 else
 lib_libopenvswitch_la_SOURCES += lib/stream-nossl.c
-- 
2.17.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to