branch Attitude Adjustment packages
[12.09/packages.git] / net / nzbget / patches / 001-openssl-1.0.0-compat.patch
1 --- a/TLS.cpp
2 +++ b/TLS.cpp
3 @@ -908,7 +908,7 @@ int tls_check_cert(tls_t *tls, const cha
4      char *buf;
5      int bufsize;
6      /* needed to get the DNS subjectAltNames: */
7 -    STACK *subj_alt_names;
8 +    STACK_OF(GENERAL_NAME) *subj_alt_names;
9      int subj_alt_names_count;
10      GENERAL_NAME *subj_alt_name;
11      /* did we find a name matching hostname? */
12 @@ -960,7 +960,7 @@ int tls_check_cert(tls_t *tls, const cha
13      /* Try the DNS subjectAltNames. */
14      match_found = 0;
15      if ((subj_alt_names =
16 -               (STACK*)X509_get_ext_d2i(x509cert, NID_subject_alt_name, NULL, NULL)))
17 +               (STACK_OF(GENERAL_NAME) *)X509_get_ext_d2i(x509cert, NID_subject_alt_name, NULL, NULL)))
18      {
19         subj_alt_names_count = sk_GENERAL_NAME_num(subj_alt_names);
20         for (i = 0; i < subj_alt_names_count; i++) 
21 @@ -1105,7 +1105,11 @@ int tls_init(tls_t *tls, const char *key
22  
23  #ifdef HAVE_OPENSSL
24      
25 +    #if OPENSSL_VERSION_NUMBER >= 0x10000000L
26 +    const SSL_METHOD *ssl_method = NULL;
27 +    #else
28      SSL_METHOD *ssl_method = NULL;
29 +    #endif
30      
31      ssl_method = force_sslv3 ? SSLv3_client_method() : SSLv23_client_method();
32      if (!ssl_method)