mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-17 21:52:56 +08:00
update 2026-08-05 21:55:04
This commit is contained in:
1 parent
58383ebb06
commit
e0753d55fd
1960 files changed
+9
-1523150
No files matched your search
@@ -1,51 +0,0 @@
|
||||
--- a/ssl.c
|
||||
+++ b/ssl.c
|
||||
@@ -28,6 +28,9 @@
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/bio.h>
|
||||
+#ifndef OPENSSL_NO_EC
|
||||
+#include <openssl/ec.h>
|
||||
+#endif
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
|
||||
@@ -66,8 +69,12 @@ ssl_init(struct vsf_session* p_sess)
|
||||
SSL_CTX* p_ctx;
|
||||
long options;
|
||||
int verify_option = 0;
|
||||
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
SSL_library_init();
|
||||
p_ctx = SSL_CTX_new(SSLv23_server_method());
|
||||
+#else
|
||||
+ p_ctx = SSL_CTX_new(TLS_server_method());
|
||||
+#endif
|
||||
if (p_ctx == NULL)
|
||||
{
|
||||
die("SSL: could not allocate SSL context");
|
||||
@@ -139,6 +146,7 @@ ssl_init(struct vsf_session* p_sess)
|
||||
{
|
||||
die("SSL: RNG is not seeded");
|
||||
}
|
||||
+#ifndef OPENSSL_NO_EC
|
||||
{
|
||||
EC_KEY* key = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
|
||||
if (key == NULL)
|
||||
@@ -148,6 +156,7 @@ ssl_init(struct vsf_session* p_sess)
|
||||
SSL_CTX_set_tmp_ecdh(p_ctx, key);
|
||||
EC_KEY_free(key);
|
||||
}
|
||||
+#endif
|
||||
if (tunable_ssl_request_cert)
|
||||
{
|
||||
verify_option |= SSL_VERIFY_PEER;
|
||||
@@ -685,7 +694,9 @@ ssl_cert_digest(SSL* p_ssl, struct vsf_session* p_sess, struct mystr* p_str)
|
||||
static char*
|
||||
get_ssl_error()
|
||||
{
|
||||
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
SSL_load_error_strings();
|
||||
+#endif
|
||||
return ERR_error_string(ERR_get_error(), NULL);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user