From a62a739c8f77d239b121ccf2144ef3bd0f01bdd4 Mon Sep 17 00:00:00 2001 From: Clinton Ebadi Date: Mon, 9 Apr 2018 19:06:38 -0400 Subject: [PATCH 1/1] openssl: fix building with openssl 1.1 and later Patch provided by Robin Templeton --- openssl/openssl_sml.c | 15 ++++++++------- openssl/openssl_sml.h | 9 ++++++--- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/openssl/openssl_sml.c b/openssl/openssl_sml.c index 0ce16d2..d934217 100644 --- a/openssl/openssl_sml.c +++ b/openssl/openssl_sml.c @@ -1,7 +1,8 @@ -#include "openssl/bio.h" -#include "openssl/ssl.h" -#include "openssl/err.h" +#include +#include +#include +#include #include #include #include @@ -82,7 +83,7 @@ void OpenSSL_SML_CTX_free(SSL_CTX *ctx) { return SSL_CTX_free(ctx); } -SSL_METHOD *OpenSSL_SML_SSLv23_method() { +const SSL_METHOD *OpenSSL_SML_SSLv23_method() { return SSLv23_method(); } @@ -217,11 +218,11 @@ const char *OpenSSL_SML_get_peer_name(SSL *ssl) { ASN1_STRING *s = X509_NAME_ENTRY_get_data(ne); static char ret[1024]; - if (M_ASN1_STRING_length(s) >= sizeof ret) + if (ASN1_STRING_length(s) >= sizeof ret) return NULL; else { - memcpy(ret, M_ASN1_STRING_data(s), M_ASN1_STRING_length(s)); - ret[M_ASN1_STRING_length(s)] = 0; + memcpy(ret, ASN1_STRING_get0_data(s), ASN1_STRING_length(s)); + ret[ASN1_STRING_length(s)] = 0; return ret; } } else { diff --git a/openssl/openssl_sml.h b/openssl/openssl_sml.h index 3d5cd46..3f33922 100644 --- a/openssl/openssl_sml.h +++ b/openssl/openssl_sml.h @@ -1,6 +1,9 @@ -#include "openssl/bio.h" -#include "openssl/ssl.h" -#include "openssl/err.h" +#include + +/* SSL_METHOD is defined in , which #includes system + headers that ml-nlffigen can't parse. */ + +typedef struct ssl_method_st SSL_METHOD; void OpenSSL_SML_init(void); void OpenSSL_SML_load_error_strings(void); -- 2.20.1