Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Core
Tor
Commits
a15b2c57
Commit
a15b2c57
authored
6 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Patches
Plain Diff
Add support for openssl built with "no-deprecated".
Patch from Andrew John Hughes; partial fix for 19981.
parent
8e562874
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/common/aes.c
+4
-0
4 additions, 0 deletions
src/common/aes.c
src/common/crypto.c
+16
-0
16 additions, 0 deletions
src/common/crypto.c
src/common/tortls.c
+15
-0
15 additions, 0 deletions
src/common/tortls.c
with
35 additions
and
0 deletions
src/common/aes.c
+
4
−
0
View file @
a15b2c57
...
...
@@ -116,7 +116,11 @@ aes_cipher_free_(aes_cnt_cipher_t *cipher_)
if
(
!
cipher_
)
return
;
EVP_CIPHER_CTX
*
cipher
=
(
EVP_CIPHER_CTX
*
)
cipher_
;
#if OPENSSL_VERSION_NUMBER >= OPENSSL_V_SERIES(1,1,0)
EVP_CIPHER_CTX_reset
(
cipher
);
#else
EVP_CIPHER_CTX_cleanup
(
cipher
);
#endif
EVP_CIPHER_CTX_free
(
cipher
);
}
void
...
...
This diff is collapsed.
Click to expand it.
src/common/crypto.c
+
16
−
0
View file @
a15b2c57
...
...
@@ -43,6 +43,7 @@ DISABLE_GCC_WARNING(redundant-decls)
#include
<openssl/dh.h>
#include
<openssl/conf.h>
#include
<openssl/hmac.h>
#include
<openssl/ssl.h>
ENABLE_GCC_WARNING
(
redundant
-
decls
)
...
...
@@ -204,8 +205,15 @@ crypto_early_init(void)
crypto_early_initialized_
=
1
;
#if OPENSSL_VERSION_NUMBER >= OPENSSL_V_SERIES(1,1,0)
OPENSSL_init_ssl
(
OPENSSL_INIT_LOAD_SSL_STRINGS
|
OPENSSL_INIT_LOAD_CRYPTO_STRINGS
|
OPENSSL_INIT_ADD_ALL_CIPHERS
|
OPENSSL_INIT_ADD_ALL_DIGESTS
,
NULL
);
#else
ERR_load_crypto_strings
();
OpenSSL_add_all_algorithms
();
#endif
setup_openssl_threading
();
...
...
@@ -1660,11 +1668,15 @@ memwipe(void *mem, uint8_t byte, size_t sz)
int
crypto_global_cleanup
(
void
)
{
#if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(1,1,0)
EVP_cleanup
();
#endif
#ifndef NEW_THREAD_API
ERR_remove_thread_state
(
NULL
);
#endif
#if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(1,1,0)
ERR_free_strings
();
#endif
if
(
dh_param_p
)
BN_clear_free
(
dh_param_p
);
...
...
@@ -1676,11 +1688,15 @@ crypto_global_cleanup(void)
dh_param_p
=
dh_param_p_tls
=
dh_param_g
=
NULL
;
#ifndef DISABLE_ENGINES
#if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(1,1,0)
ENGINE_cleanup
();
#endif
#endif
CONF_modules_unload
(
1
);
#if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(1,1,0)
CRYPTO_cleanup_all_ex_data
();
#endif
crypto_openssl_free_all
();
...
...
This diff is collapsed.
Click to expand it.
src/common/tortls.c
+
15
−
0
View file @
a15b2c57
...
...
@@ -56,10 +56,21 @@ ENABLE_GCC_WARNING(redundant-decls)
#include
"container.h"
#include
<string.h>
#if OPENSSL_VERSION_NUMBER >= OPENSSL_V_SERIES(1,1,0)
#define X509_get_notBefore_const(cert) \
X509_get0_notBefore(cert)
#define X509_get_notAfter_const(cert) \
X509_get0_notAfter(cert)
#define X509_get_notBefore(cert) \
X509_getm_notBefore(cert)
#define X509_get_notAfter(cert) \
X509_getm_notAfter(cert)
#else
#define X509_get_notBefore_const(cert) \
((const ASN1_TIME*) X509_get_notBefore((X509 *)cert))
#define X509_get_notAfter_const(cert) \
((const ASN1_TIME*) X509_get_notAfter((X509 *)cert))
#endif
/* Copied from or.h */
#define LEGAL_NICKNAME_CHARACTERS \
...
...
@@ -355,8 +366,12 @@ tor_tls_init(void)
check_no_tls_errors
();
if
(
!
tls_library_is_initialized
)
{
#if OPENSSL_VERSION_NUMBER >= OPENSSL_V_SERIES(1,1,0)
OPENSSL_init_ssl
(
OPENSSL_INIT_LOAD_SSL_STRINGS
,
NULL
);
#else
SSL_library_init
();
SSL_load_error_strings
();
#endif
#if (SIZEOF_VOID_P >= 8 && \
OPENSSL_VERSION_NUMBER >= OPENSSL_V_SERIES(1,0,1))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment