Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 614770
Collapse All | Expand All

(-)cryptography-2.1.1-orig/src/_cffi_src/openssl/asn1.py (+3 lines)
Lines 155-158 Link Here
155
"""
155
"""
156
156
157
CUSTOMIZATIONS = """
157
CUSTOMIZATIONS = """
158
#if OPENSSL_API_COMPAT >= 0x10100000L
159
#define ASN1_STRING_data ASN1_STRING_get0_data
160
#endif
158
"""
161
"""
(-)cryptography-2.1.1-orig/src/_cffi_src/openssl/callbacks.py (+2 lines)
Lines 118-123 Link Here
118
118
119
119
120
int _setup_ssl_threads(void) {
120
int _setup_ssl_threads(void) {
121
#if OPENSSL_API_COMPAT < 0x10100000L
121
    if (_ssl_locks == NULL) {
122
    if (_ssl_locks == NULL) {
122
        _ssl_locks_count = CRYPTO_num_locks();
123
        _ssl_locks_count = CRYPTO_num_locks();
123
        _ssl_locks = calloc(_ssl_locks_count, sizeof(Cryptography_mutex));
124
        _ssl_locks = calloc(_ssl_locks_count, sizeof(Cryptography_mutex));
Lines 130-135 Link Here
130
        pthread_atfork(NULL, NULL, &init_mutexes);
131
        pthread_atfork(NULL, NULL, &init_mutexes);
131
#endif
132
#endif
132
    }
133
    }
134
#endif
133
    return 1;
135
    return 1;
134
}
136
}
135
137
(-)cryptography-2.1.1-orig/src/_cffi_src/openssl/bignum.py (+4 lines)
Lines 83-86 Link Here
83
"""
83
"""
84
84
85
CUSTOMIZATIONS = """
85
CUSTOMIZATIONS = """
86
#if OPENSSL_API_COMPAT >= 0x10100000L
87
#undef BN_zero
88
#define BN_zero(x) (0)
89
#endif
86
"""
90
"""
(-)cryptography-2.1.1-orig/src/_cffi_src/openssl/conf.py (+5 lines)
Lines 18-21 Link Here
18
"""
18
"""
19
19
20
CUSTOMIZATIONS = """
20
CUSTOMIZATIONS = """
21
#if OPENSSL_API_COMPAT >= 0x10100000L
22
#define OPENSSL_config(n) CONF_modules_load(NULL,n,0)
23
#define OPENSSL_no_config() \
24
    OPENSSL_init_crypto(OPENSSL_INIT_NO_LOAD_CONFIG, NULL)
25
#endif
21
"""
26
"""
(-)cryptography-2.1.1-orig/src/_cffi_src/openssl/crypto.py (+10 lines)
Lines 133-138 Link Here
133
}
133
}
134
#endif
134
#endif
135
135
136
#if OPENSSL_API_COMPAT >= 0x10100000L
137
#define ASN1_STRING_data ASN1_STRING_get0_data
138
#define CRYPTO_cleanup_all_ex_data() while(0) continue
139
#define CRYPTO_num_locks()            (1)
140
#define CRYPTO_set_locking_callback(func)
141
#define CRYPTO_get_locking_callback()         (NULL)
142
#define CRYPTO_set_add_lock_callback(func)
143
#define CRYPTO_get_add_lock_callback()        (NULL)
144
#endif
145
136
void *Cryptography_malloc_wrapper(size_t size, const char *path, int line) {
146
void *Cryptography_malloc_wrapper(size_t size, const char *path, int line) {
137
    return malloc(size);
147
    return malloc(size);
138
}
148
}
(-)cryptography-2.1.1-orig/src/_cffi_src/openssl/engine.py (+26 lines)
Lines 130-133 Link Here
130
"""
130
"""
131
131
132
CUSTOMIZATIONS = """
132
CUSTOMIZATIONS = """
133
#if OPENSSL_API_COMPAT >= 0x10100000L
134
/*
135
 * This function previously cleaned up anything that needs it. Auto-deinit will
136
 * now take care of it so it is no longer required to call this function.
137
 */
138
# define ENGINE_cleanup() while(0) continue
139
#endif
140
141
#if OPENSSL_API_COMPAT >= 0x10100000L
142
#define ENGINE_load_openssl() \
143
    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_OPENSSL, NULL)
144
#define ENGINE_load_dynamic() \
145
    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_DYNAMIC, NULL)
146
#ifndef OPENSSL_NO_STATIC_ENGINE
147
#define ENGINE_load_padlock() \
148
    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_PADLOCK, NULL)
149
#define ENGINE_load_capi() \
150
    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_CAPI, NULL)
151
#define ENGINE_load_afalg() \
152
    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_AFALG, NULL)
153
#endif
154
#define ENGINE_load_cryptodev() \
155
    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_CRYPTODEV, NULL)
156
#define ENGINE_load_rdrand() \
157
    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_RDRAND, NULL)
158
#endif
133
"""
159
"""
(-)cryptography-2.1.1-orig/src/_cffi_src/openssl/err.py (+6 lines)
Lines 274-277 Link Here
274
static const long Cryptography_HAS_RSA_R_PKCS_DECODING_ERROR = 0;
274
static const long Cryptography_HAS_RSA_R_PKCS_DECODING_ERROR = 0;
275
static const long RSA_R_PKCS_DECODING_ERROR = 0;
275
static const long RSA_R_PKCS_DECODING_ERROR = 0;
276
#endif
276
#endif
277
278
#if OPENSSL_API_COMPAT >= 0x10100000L
279
#define ERR_load_crypto_strings() \
280
    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL)
281
#define ERR_free_strings() while(0) continue
282
#endif
277
"""
283
"""
(-)cryptography-2.1.1-orig/src/_cffi_src/openssl/evp.py (+33 lines)
Lines 241-244 Link Here
241
#if !defined(EVP_CTRL_AEAD_SET_TAG)
241
#if !defined(EVP_CTRL_AEAD_SET_TAG)
242
# define EVP_CTRL_AEAD_SET_TAG EVP_CTRL_GCM_SET_TAG
242
# define EVP_CTRL_AEAD_SET_TAG EVP_CTRL_GCM_SET_TAG
243
#endif
243
#endif
244
245
#if OPENSSL_API_COMPAT >= 0x10100000L
246
#define EVP_CIPHER_CTX_init(c)      EVP_CIPHER_CTX_reset(c)
247
#define EVP_CIPHER_CTX_cleanup(c)   EVP_CIPHER_CTX_reset(c)
248
#endif
249
250
#if OPENSSL_API_COMPAT >= 0x10100000L
251
#define OPENSSL_add_all_algorithms_conf() \
252
    OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \
253
                        | OPENSSL_INIT_ADD_ALL_DIGESTS \
254
                        | OPENSSL_INIT_LOAD_CONFIG, NULL)
255
#define OPENSSL_add_all_algorithms_noconf() \
256
    OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \
257
                        | OPENSSL_INIT_ADD_ALL_DIGESTS, NULL)
258
259
#ifdef OPENSSL_LOAD_CONF
260
#define OpenSSL_add_all_algorithms() \
261
    OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \
262
                        | OPENSSL_INIT_ADD_ALL_DIGESTS \
263
                        | OPENSSL_INIT_LOAD_CONFIG, NULL)
264
#else
265
#define OpenSSL_add_all_algorithms() \
266
    OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS \
267
                        | OPENSSL_INIT_ADD_ALL_DIGESTS, NULL)
268
#endif
269
270
#define OpenSSL_add_all_ciphers() \
271
    OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS, NULL)
272
#define OpenSSL_add_all_digests() \
273
    OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_DIGESTS, NULL)
274
275
#define EVP_cleanup() while(0) continue
276
#endif
244
"""
277
"""
(-)cryptography-2.1.1-orig/src/_cffi_src/openssl/objects.py (+3 lines)
Lines 38-41 Link Here
38
"""
38
"""
39
39
40
CUSTOMIZATIONS = """
40
CUSTOMIZATIONS = """
41
#if OPENSSL_API_COMPAT >= 0x10100000L
42
#define OBJ_cleanup() while(0) continue
43
#endif
41
"""
44
"""
(-)cryptography-2.1.1-orig/src/_cffi_src/openssl/rand.py (+4 lines)
Lines 32-35 Link Here
32
32
33
CUSTOMIZATIONS = """
33
CUSTOMIZATIONS = """
34
static const long Cryptography_HAS_EGD = 0;
34
static const long Cryptography_HAS_EGD = 0;
35
36
#if OPENSSL_API_COMPAT >= 0x10100000L
37
#define RAND_cleanup() while(0) continue
38
#endif
35
"""
39
"""
(-)cryptography-2.1.1-orig/src/_cffi_src/openssl/ssl.py (+147 lines)
Lines 623-626 Link Here
623
623
624
    return r;
624
    return r;
625
}
625
}
626
627
#if OPENSSL_API_COMPAT >= 0x10100000L
628
#define SSL_library_init() OPENSSL_init_ssl(0, NULL)
629
#define SSL_load_error_strings() \
630
    OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS \
631
                     | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL)
632
633
static void _set_protocol_version(const SSL_METHOD *m, int version)
634
{
635
    SSL_CTX *ctx = SSL_CTX_new(m);
636
    SSL_CTX_set_min_proto_version(ctx, version);
637
    SSL_CTX_set_max_proto_version(ctx, version);
638
    SSL_CTX_free(ctx);
639
}
640
641
/*
642
 * TLSv1_1 and TLSv1_2 are recent additions.  Only sufficiently new versions of
643
 * OpenSSL support them.
644
 */
645
const SSL_METHOD *Cryptography_TLSv1_1_method(void)
646
{
647
    const SSL_METHOD *m = TLS_method();
648
    _set_protocol_version(m, TLS1_1_VERSION);
649
    return m;
650
}
651
652
const SSL_METHOD *Cryptography_TLSv1_1_server_method(void)
653
{
654
    const SSL_METHOD *m = TLS_server_method();
655
    _set_protocol_version(m, TLS1_1_VERSION);
656
    return m;
657
}
658
659
const SSL_METHOD *Cryptography_TLSv1_1_client_method(void)
660
{
661
    const SSL_METHOD *m = TLS_client_method();
662
    _set_protocol_version(m, TLS1_1_VERSION);
663
    return m;
664
}
665
666
const SSL_METHOD *Cryptography_TLSv1_2_method(void)
667
{
668
    const SSL_METHOD *m = TLS_method();
669
    _set_protocol_version(m, TLS1_2_VERSION);
670
    return m;
671
}
672
673
const SSL_METHOD *Cryptography_TLSv1_2_server_method(void)
674
{
675
    const SSL_METHOD *m = TLS_server_method();
676
    _set_protocol_version(m, TLS1_2_VERSION);
677
    return m;
678
}
679
680
const SSL_METHOD *Cryptography_TLSv1_2_client_method(void)
681
{
682
    const SSL_METHOD *m = TLS_client_method();
683
    _set_protocol_version(m, TLS1_2_VERSION);
684
    return m;
685
}
686
687
#define TLSv1_1_method Cryptography_TLSv1_1_method
688
#define TLSv1_1_server_method Cryptography_TLSv1_1_server_method
689
#define TLSv1_1_client_method Cryptography_TLSv1_1_client_method
690
#define TLSv1_2_method Cryptography_TLSv1_2_method
691
#define TLSv1_2_server_method Cryptography_TLSv1_2_server_method
692
#define TLSv1_2_client_method Cryptography_TLSv1_2_client_method
693
694
#ifndef OPENSSL_NO_SSL3_METHOD
695
const SSL_METHOD *Cryptography_SSLv3_method(void)
696
{
697
    const SSL_METHOD *m = TLS_method();
698
    _set_protocol_version(m, SSL3_VERSION);
699
    return m;
700
}
701
702
const SSL_METHOD *Cryptography_SSLv3_server_method(void)
703
{
704
    const SSL_METHOD *m = TLS_server_method();
705
    _set_protocol_version(m, SSL3_VERSION);
706
    return m;
707
}
708
709
const SSL_METHOD *Cryptography_SSLv3_client_method(void)
710
{
711
    const SSL_METHOD *m = TLS_client_method();
712
    _set_protocol_version(m, SSL3_VERSION);
713
    return m;
714
}
715
716
#define SSLv3_method Cryptography_SSLv3_method
717
#define SSLv3_server_method Cryptography_SSLv3_server_method
718
#define SSLv3_client_method Cryptography_SSLv3_client_method
719
#endif
720
721
const SSL_METHOD *Cryptography_TLSv1_method(void)
722
{
723
    const SSL_METHOD *m = TLS_method();
724
    _set_protocol_version(m, TLS1_VERSION);
725
    return m;
726
}
727
728
const SSL_METHOD *Cryptography_TLSv1_server_method(void)
729
{
730
    const SSL_METHOD *m = TLS_server_method();
731
    _set_protocol_version(m, TLS1_VERSION);
732
    return m;
733
}
734
735
const SSL_METHOD *Cryptography_TLSv1_client_method(void)
736
{
737
    const SSL_METHOD *m = TLS_client_method();
738
    _set_protocol_version(m, TLS1_VERSION);
739
    return m;
740
}
741
742
#define TLSv1_method Cryptography_TLSv1_method
743
#define TLSv1_server_method Cryptography_TLSv1_server_method
744
#define TLSv1_client_method Cryptography_TLSv1_client_method
745
746
#if !defined(OPENSSL_NO_DTLS) && !CRYPTOGRAPHY_OPENSSL_LESS_THAN_102
747
const SSL_METHOD *Cryptography_DTLSv1_method(void)
748
{
749
    const SSL_METHOD *m = TLS_method();
750
    _set_protocol_version(m, DTLS1_VERSION);
751
    return m;
752
}
753
754
const SSL_METHOD *Cryptography_DTLSv1_server_method(void)
755
{
756
    const SSL_METHOD *m = TLS_server_method();
757
    _set_protocol_version(m, DTLS1_VERSION);
758
    return m;
759
}
760
761
const SSL_METHOD *Cryptography_DTLSv1_client_method(void)
762
{
763
    const SSL_METHOD *m = TLS_client_method();
764
    _set_protocol_version(m, DTLS1_VERSION);
765
    return m;
766
}
767
768
#define DTLSv1_method Cryptography_DTLSv1_method
769
#define DTLSv1_server_method Cryptography_DTLSv1_server_method
770
#define DTLSv1_client_method Cryptography_DTLSv1_client_method
771
#endif
772
#endif
626
"""
773
"""
(-)cryptography-2.1.1-orig/src/_cffi_src/openssl/x509.py (+11 lines)
Lines 423-426 Link Here
423
    return x->serialNumber;
423
    return x->serialNumber;
424
}
424
}
425
#endif
425
#endif
426
427
#if OPENSSL_API_COMPAT >= 0x10100000L
428
#define X509_get_notBefore X509_getm_notBefore
429
#define X509_get_notAfter X509_getm_notAfter
430
#define X509_set_notBefore X509_set1_notBefore
431
#define X509_set_notAfter X509_set1_notAfter
432
#define X509_CRL_get_lastUpdate X509_CRL_get0_lastUpdate
433
#define X509_CRL_get_nextUpdate X509_CRL_get0_nextUpdate
434
#define X509_CRL_set_lastUpdate X509_CRL_set1_lastUpdate
435
#define X509_CRL_set_nextUpdate X509_CRL_set1_nextUpdate
436
#endif
426
"""
437
"""
(-)cryptography-2.1.1-orig/src/_cffi_src/openssl/x509_vfy.py (+7 lines)
Lines 306-309 Link Here
306
#else
306
#else
307
static const long Cryptography_HAS_X509_STORE_CTX_GET_ISSUER = 1;
307
static const long Cryptography_HAS_X509_STORE_CTX_GET_ISSUER = 1;
308
#endif
308
#endif
309
310
#if OPENSSL_API_COMPAT >= 0x10100000L
311
#define X509_V_FLAG_CB_ISSUER_CHECK             0x0   /* Deprecated */
312
#define X509_STORE_CTX_get_chain X509_STORE_CTX_get0_chain
313
#define X509_STORE_CTX_set_chain X509_STORE_CTX_set0_untrusted
314
#define X509_STORE_CTX_trusted_stack X509_STORE_CTX_set0_trusted_stack
315
#endif
309
"""
316
"""

Return to bug 614770