From 132926ee09878d4a9042e0be4d0abab25269ca6f Mon Sep 17 00:00:00 2001 From: Evengard Date: Sun, 3 May 2020 04:24:01 +0300 Subject: [PATCH] Fixing alignment of struct on GCC, changing the method to server one --- src/Cedar/Proto_PPP.h | 8 ++++++-- src/Mayaqua/Network.c | 5 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Cedar/Proto_PPP.h b/src/Cedar/Proto_PPP.h index f3bbb001..311617ba 100644 --- a/src/Cedar/Proto_PPP.h +++ b/src/Cedar/Proto_PPP.h @@ -189,7 +189,9 @@ struct PPP_OPTION #ifdef OS_WIN32 #pragma pack(push, 1) -#endif // OS_WIN32 +#else // OS_WIN32 +#pragma pack(1) +#endif // PPP EAP packet @@ -217,7 +219,9 @@ struct PPP_EAP #ifdef OS_WIN32 #pragma pack(pop) -#endif // OS_WIN32 +#else // OS_WIN32 +#pragma pack() +#endif struct PPP_EAP_TLS_CONTEXT { diff --git a/src/Mayaqua/Network.c b/src/Mayaqua/Network.c index b79238f7..a28aa715 100644 --- a/src/Mayaqua/Network.c +++ b/src/Mayaqua/Network.c @@ -5729,7 +5729,7 @@ SSL_PIPE *NewSslPipeEx(bool server_mode, X *x, K *k, DH_CTX *dh, bool verify_pee { if (server_mode) { - SSL_CTX_set_ssl_version(ssl_ctx, SSLv23_method()); + SSL_CTX_set_ssl_version(ssl_ctx, SSLv23_server_method()); SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2); #ifdef SSL_OP_NO_TLSv1_3 @@ -11792,7 +11792,8 @@ bool AddChainSslCert(struct ssl_ctx_st *ctx, X *x) if (x_copy->root_cert) { X509_STORE* store = SSL_CTX_get_cert_store(ctx); - X509_STORE_add_cert(store, x->x509); + X509_STORE_add_cert(store, x_copy->x509); + X509_free(x_copy->x509); } else {