X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/blobdiff_plain/64a44dc0899e92d8c1b708fb754ad1b2126c67fe..20f239b6471b8816762cce5cc714449154114397:/openssl/openssl_sml.c diff --git a/openssl/openssl_sml.c b/openssl/openssl_sml.c index 407e74f..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 @@ -73,6 +74,8 @@ SSL_CTX *OpenSSL_SML_CTX_new(SSL_METHOD *meth) { SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, 0); + SSL_CTX_set_verify_depth(ctx, + 2); return ctx; } @@ -80,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(); } @@ -215,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 {