tlsdate: Fix build with OpenSSL 1.1.1
Deprecation warnings popped up that are causing build breakage due to
-Werror. Suppress the warnings so we can retain compatibility with
older TLS versions requested on the command line for now.
Note that with modern OpenSSL, one would use TLS_client_method() and
restrict protocol versions via SSL_CTX_set_{min,max}_proto_version,
but that's unfortunately not available on 1.0.2.
BUG=chromium:736583
TEST=tlsdate builds successfully against OpenSSL 1.1.1
Change-Id: I249af6e53ac769eede816e077a12b9a7a22933f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/tlsdate/+/2053804
Tested-by: Mattias Nissler <mnissler@chromium.org>
Commit-Queue: Mattias Nissler <mnissler@chromium.org>
Auto-Submit: Mattias Nissler <mnissler@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
diff --git a/src/tlsdate-helper.c b/src/tlsdate-helper.c
index 5821dd9..fd0b3fe 100644
--- a/src/tlsdate-helper.c
+++ b/src/tlsdate-helper.c
@@ -805,6 +805,14 @@
SSL_library_init();
ctx = NULL;
+ /*
+ * Some of the XYZ_method() calls below are marked deprecated. We still want
+ * to use them for compatibility reasons, so silence the warnings or they'll
+ * break the build.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
if (0 == strcmp ("sslv23", g_protocol))
{
verb ("V: using SSLv23_client_method()\n");
@@ -841,6 +849,8 @@
else
die ("Unsupported protocol `%s'\n", g_protocol);
+#pragma GCC diagnostic pop
+
if (ctx == NULL)
die ("OpenSSL failed to support protocol `%s'\n", g_protocol);
if (g_ca_racket)