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

(-)encfs-1.9.4.orig/encfs/encfsctl.cpp (+2 lines)
Lines 721-728 Link Here
721
  textdomain(PACKAGE);
721
  textdomain(PACKAGE);
722
#endif
722
#endif
723
723
724
#if OPENSSL_VERSION_NUMBER < 0x10100000L
724
  SSL_load_error_strings();
725
  SSL_load_error_strings();
725
  SSL_library_init();
726
  SSL_library_init();
727
#endif
726
728
727
  if (argc < 2) {
729
  if (argc < 2) {
728
    usage(argv[0]);
730
    usage(argv[0]);
(-)encfs-1.9.4.orig/encfs/openssl.cpp (+8 lines)
Lines 35-40 Link Here
35
35
36
namespace encfs {
36
namespace encfs {
37
37
38
#if OPENSSL_VERSION_NUMBER < 0x10100000L
38
unsigned long pthreads_thread_id() { return (unsigned long)pthread_self(); }
39
unsigned long pthreads_thread_id() { return (unsigned long)pthread_self(); }
39
40
40
static pthread_mutex_t *crypto_locks = nullptr;
41
static pthread_mutex_t *crypto_locks = nullptr;
Lines 67-77 Link Here
67
    crypto_locks = nullptr;
68
    crypto_locks = nullptr;
68
  }
69
  }
69
}
70
}
71
#endif
70
72
71
void openssl_init(bool threaded) {
73
void openssl_init(bool threaded) {
74
#if OPENSSL_VERSION_NUMBER < 0x10100000L
72
  // initialize the SSL library
75
  // initialize the SSL library
73
  SSL_load_error_strings();
76
  SSL_load_error_strings();
74
  SSL_library_init();
77
  SSL_library_init();
78
#endif
75
79
76
  unsigned int randSeed = 0;
80
  unsigned int randSeed = 0;
77
  RAND_bytes((unsigned char *)&randSeed, sizeof(randSeed));
81
  RAND_bytes((unsigned char *)&randSeed, sizeof(randSeed));
Lines 84-98 Link Here
84
  ENGINE_register_all_complete();
88
  ENGINE_register_all_complete();
85
#endif  // NO_ENGINE
89
#endif  // NO_ENGINE
86
90
91
#if OPENSSL_VERSION_NUMBER < 0x10100000L
87
  if (threaded) {
92
  if (threaded) {
88
    // provide locking functions to OpenSSL since we'll be running with
93
    // provide locking functions to OpenSSL since we'll be running with
89
    // threads accessing openssl in parallel.
94
    // threads accessing openssl in parallel.
90
    CRYPTO_set_id_callback(pthreads_thread_id);
95
    CRYPTO_set_id_callback(pthreads_thread_id);
91
    CRYPTO_set_locking_callback(pthreads_locking_callback);
96
    CRYPTO_set_locking_callback(pthreads_locking_callback);
92
  }
97
  }
98
#endif
93
}
99
}
94
100
95
void openssl_shutdown(bool threaded) {
101
void openssl_shutdown(bool threaded) {
102
#if OPENSSL_VERSION_NUMBER < 0x10100000L
96
#ifndef OPENSSL_NO_ENGINE
103
#ifndef OPENSSL_NO_ENGINE
97
  ENGINE_cleanup();
104
  ENGINE_cleanup();
98
#endif
105
#endif
Lines 100-105 Link Here
100
  if (threaded) {
107
  if (threaded) {
101
    pthreads_locking_cleanup();
108
    pthreads_locking_cleanup();
102
  }
109
  }
110
#endif
103
}
111
}
104
112
105
}  // namespace encfs
113
}  // namespace encfs
(-)encfs-1.9.4.orig/encfs/SSL_Cipher.cpp (+11 lines)
Lines 315-320 Link Here
315
  mlock(buffer, (size_t)keySize + (size_t)ivLength);
315
  mlock(buffer, (size_t)keySize + (size_t)ivLength);
316
316
317
  block_enc = EVP_CIPHER_CTX_new();
317
  block_enc = EVP_CIPHER_CTX_new();
318
#if OPENSSL_VERSION_NUMBER < 0x10100000L
318
  EVP_CIPHER_CTX_init(block_enc);
319
  EVP_CIPHER_CTX_init(block_enc);
319
  block_dec = EVP_CIPHER_CTX_new();
320
  block_dec = EVP_CIPHER_CTX_new();
320
  EVP_CIPHER_CTX_init(block_dec);
321
  EVP_CIPHER_CTX_init(block_dec);
Lines 323-328 Link Here
323
  stream_dec = EVP_CIPHER_CTX_new();
324
  stream_dec = EVP_CIPHER_CTX_new();
324
  EVP_CIPHER_CTX_init(stream_dec);
325
  EVP_CIPHER_CTX_init(stream_dec);
325
  mac_ctx = HMAC_CTX_new();
326
  mac_ctx = HMAC_CTX_new();
327
#else
328
  EVP_CIPHER_CTX_reset(block_enc);
329
  block_dec = EVP_CIPHER_CTX_new();
330
  EVP_CIPHER_CTX_reset(block_dec);
331
  stream_enc = EVP_CIPHER_CTX_new();
332
  EVP_CIPHER_CTX_reset(stream_enc);
333
  stream_dec = EVP_CIPHER_CTX_new();
334
  EVP_CIPHER_CTX_reset(stream_dec);
335
  mac_ctx = HMAC_CTX_new();
336
#endif
326
  HMAC_CTX_reset(mac_ctx);
337
  HMAC_CTX_reset(mac_ctx);
327
}
338
}
328
339
(-)encfs-1.9.4.orig/encfs/test.cpp (+2 lines)
Lines 399-406 Link Here
399
  START_EASYLOGGINGPP(argc, argv);
399
  START_EASYLOGGINGPP(argc, argv);
400
  encfs::initLogging();
400
  encfs::initLogging();
401
401
402
#if OPENSSL_VERSION_NUMBER < 0x10100000L
402
  SSL_load_error_strings();
403
  SSL_load_error_strings();
403
  SSL_library_init();
404
  SSL_library_init();
405
#endif
404
406
405
#ifndef OPENSSL_NO_ENGINE
407
#ifndef OPENSSL_NO_ENGINE
406
  ENGINE_load_builtin_engines();
408
  ENGINE_load_builtin_engines();

Return to bug 648698