Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 633832 | Differences between
and this patch

Collapse All | Expand All

(-)a/SWIG/_bio.i (-3 / +3 lines)
Lines 63-76 extern BIO *BIO_pop(BIO *); Link Here
63
static PyObject *_bio_err;
63
static PyObject *_bio_err;
64
64
65
65
66
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
66
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
67
void pyfd_init(void);
67
void pyfd_init(void);
68
#endif
68
#endif
69
69
70
void bio_init(PyObject *bio_err) {
70
void bio_init(PyObject *bio_err) {
71
    Py_INCREF(bio_err);
71
    Py_INCREF(bio_err);
72
    _bio_err = bio_err;
72
    _bio_err = bio_err;
73
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
73
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
74
    pyfd_init();
74
    pyfd_init();
75
#endif
75
#endif
76
}
76
}
Lines 299-305 int bio_should_write(BIO* a) { Link Here
299
    return BIO_should_write(a);
299
    return BIO_should_write(a);
300
}
300
}
301
301
302
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
302
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
303
/* implment custom BIO_s_pyfd */
303
/* implment custom BIO_s_pyfd */
304
304
305
#ifdef WIN32
305
#ifdef WIN32
(-)a/SWIG/_evp.i (-1 / +1 lines)
Lines 19-25 Copyright (c) 2009-2010 Heikki Toivonen. All rights reserved. Link Here
19
#include <openssl/rsa.h>
19
#include <openssl/rsa.h>
20
#include <openssl/opensslv.h>
20
#include <openssl/opensslv.h>
21
21
22
#if OPENSSL_VERSION_NUMBER < 0x10100000L
22
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
23
23
24
HMAC_CTX *HMAC_CTX_new(void) {
24
HMAC_CTX *HMAC_CTX_new(void) {
25
    HMAC_CTX *ret = PyMem_Malloc(sizeof(HMAC_CTX));
25
    HMAC_CTX *ret = PyMem_Malloc(sizeof(HMAC_CTX));
(-)a/SWIG/_lib.i (-2 / +2 lines)
Lines 18-24 Link Here
18
18
19
%{
19
%{
20
/* OpenSSL 1.0.2 copmatbility shim */
20
/* OpenSSL 1.0.2 copmatbility shim */
21
#if OPENSSL_VERSION_NUMBER < 0x10002000L
21
#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined(LIBRESSL_VERSION_NUMBER)
22
typedef void (*OPENSSL_sk_freefunc)(void *);
22
typedef void (*OPENSSL_sk_freefunc)(void *);
23
typedef void *(*OPENSSL_sk_copyfunc)(const void *);
23
typedef void *(*OPENSSL_sk_copyfunc)(const void *);
24
typedef struct stack_st OPENSSL_STACK;
24
typedef struct stack_st OPENSSL_STACK;
Lines 501-507 int passphrase_callback(char *buf, int num, int v, void *arg) { Link Here
501
%inline %{
501
%inline %{
502
502
503
void lib_init() {
503
void lib_init() {
504
#if OPENSSL_VERSION_NUMBER < 0x10100000L
504
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
505
    SSLeay_add_all_algorithms();
505
    SSLeay_add_all_algorithms();
506
    ERR_load_ERR_strings();
506
    ERR_load_ERR_strings();
507
#endif
507
#endif
(-)a/SWIG/_lib11_compat.i (-1 / +1 lines)
Lines 8-14 Link Here
8
 */
8
 */
9
9
10
%{
10
%{
11
#if OPENSSL_VERSION_NUMBER < 0x10100000L
11
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
12
12
13
#include <string.h>
13
#include <string.h>
14
#include <openssl/engine.h>
14
#include <openssl/engine.h>
(-)a/SWIG/_ssl.i (-2 / +2 lines)
Lines 268-274 void ssl_init(PyObject *ssl_err, PyObject *ssl_timeout_err) { Link Here
268
268
269
#ifndef OPENSSL_NO_SSL3
269
#ifndef OPENSSL_NO_SSL3
270
const SSL_METHOD *sslv3_method(void) {
270
const SSL_METHOD *sslv3_method(void) {
271
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
271
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
272
    PyErr_WarnEx(PyExc_DeprecationWarning,
272
    PyErr_WarnEx(PyExc_DeprecationWarning,
273
                 "Function SSLv3_method has been deprecated.", 1);
273
                 "Function SSLv3_method has been deprecated.", 1);
274
#endif
274
#endif
Lines 277-283 const SSL_METHOD *sslv3_method(void) { Link Here
277
#endif
277
#endif
278
278
279
const SSL_METHOD *tlsv1_method(void) {
279
const SSL_METHOD *tlsv1_method(void) {
280
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
280
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
281
    PyErr_WarnEx(PyExc_DeprecationWarning,
281
    PyErr_WarnEx(PyExc_DeprecationWarning,
282
                 "Function TLSv1_method has been deprecated.", 1);
282
                 "Function TLSv1_method has been deprecated.", 1);
283
#endif
283
#endif
(-)a/SWIG/_threads.i (-5 / +5 lines)
Lines 5-11 Link Here
5
#include <pythread.h>
5
#include <pythread.h>
6
#include <openssl/crypto.h>
6
#include <openssl/crypto.h>
7
7
8
#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
8
#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
9
#define CRYPTO_num_locks()      (CRYPTO_NUM_LOCKS)
9
#define CRYPTO_num_locks()      (CRYPTO_NUM_LOCKS)
10
static PyThread_type_lock lock_cs[CRYPTO_num_locks()];
10
static PyThread_type_lock lock_cs[CRYPTO_num_locks()];
11
static long lock_count[CRYPTO_num_locks()];
11
static long lock_count[CRYPTO_num_locks()];
Lines 13-19 static int thread_mode = 0; Link Here
13
#endif
13
#endif
14
14
15
void threading_locking_callback(int mode, int type, const char *file, int line) {
15
void threading_locking_callback(int mode, int type, const char *file, int line) {
16
#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
16
#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
17
        if (mode & CRYPTO_LOCK) {
17
        if (mode & CRYPTO_LOCK) {
18
                PyThread_acquire_lock(lock_cs[type], WAIT_LOCK);
18
                PyThread_acquire_lock(lock_cs[type], WAIT_LOCK);
19
                lock_count[type]++;
19
                lock_count[type]++;
Lines 25-31 void threading_locking_callback(int mode, int type, const char *file, int line) Link Here
25
}
25
}
26
26
27
unsigned long threading_id_callback(void) {
27
unsigned long threading_id_callback(void) {
28
#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
28
#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
29
    return (unsigned long)PyThread_get_thread_ident();
29
    return (unsigned long)PyThread_get_thread_ident();
30
#else
30
#else
31
    return (unsigned long)0;
31
    return (unsigned long)0;
Lines 35-41 unsigned long threading_id_callback(void) { Link Here
35
35
36
%inline %{
36
%inline %{
37
void threading_init(void) {
37
void threading_init(void) {
38
#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
38
#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
39
    int i;
39
    int i;
40
    if (!thread_mode) {
40
    if (!thread_mode) {
41
        for (i=0; i<CRYPTO_num_locks(); i++) {
41
        for (i=0; i<CRYPTO_num_locks(); i++) {
Lines 50-56 void threading_init(void) { Link Here
50
}
50
}
51
51
52
void threading_cleanup(void) {
52
void threading_cleanup(void) {
53
#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
53
#if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
54
    int i;
54
    int i;
55
    if (thread_mode) {
55
    if (thread_mode) {
56
        CRYPTO_set_locking_callback(NULL);
56
        CRYPTO_set_locking_callback(NULL);
(-)a/SWIG/libcrypto-compat.h (-2 / +1 lines)
Lines 1-7 Link Here
1
#ifndef LIBCRYPTO_COMPAT_H
1
#ifndef LIBCRYPTO_COMPAT_H
2
#define LIBCRYPTO_COMPAT_H
2
#define LIBCRYPTO_COMPAT_H
3
3
4
#if OPENSSL_VERSION_NUMBER < 0x10100000L
4
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
5
5
6
#include <openssl/rsa.h>
6
#include <openssl/rsa.h>
7
#include <openssl/dsa.h>
7
#include <openssl/dsa.h>
8
- 

Return to bug 633832