Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
a3a6b91c
Commit
a3a6b91c
authored
Sep 11, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: Rename OPENSSL_101_API macro as OPENSSL_1_1_API
parent
d9bb3448
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
23 deletions
+23
-23
src/shrpx_connection.cc
src/shrpx_connection.cc
+10
-10
src/shrpx_ssl.cc
src/shrpx_ssl.cc
+5
-5
src/ssl.cc
src/ssl.cc
+5
-5
src/ssl_compat.h
src/ssl_compat.h
+1
-1
src/util.cc
src/util.cc
+2
-2
No files found.
src/shrpx_connection.cc
View file @
a3a6b91c
...
...
@@ -43,13 +43,13 @@ using namespace nghttp2;
namespace
shrpx
{
#if !OPENSSL_1
0
1_API
#if !OPENSSL_1
_
1_API
void
*
BIO_get_data
(
BIO
*
bio
)
{
return
bio
->
ptr
;
}
void
BIO_set_data
(
BIO
*
bio
,
void
*
ptr
)
{
bio
->
ptr
=
ptr
;
}
void
BIO_set_init
(
BIO
*
bio
,
int
init
)
{
bio
->
init
=
init
;
}
#endif // !OPENSSL_1
0
1_API
#endif // !OPENSSL_1
_
1_API
Connection
::
Connection
(
struct
ev_loop
*
loop
,
int
fd
,
SSL
*
ssl
,
MemchunkPool
*
mcpool
,
ev_tstamp
write_timeout
,
...
...
@@ -238,14 +238,14 @@ long shrpx_bio_ctrl(BIO *b, int cmd, long num, void *ptr) {
namespace
{
int
shrpx_bio_create
(
BIO
*
b
)
{
#if OPENSSL_1
0
1_API
#if OPENSSL_1
_
1_API
BIO_set_init
(
b
,
1
);
#else // !OPENSSL_1
0
1_API
#else // !OPENSSL_1
_
1_API
b
->
init
=
1
;
b
->
num
=
0
;
b
->
ptr
=
nullptr
;
b
->
flags
=
0
;
#endif // !OPENSSL_1
0
1_API
#endif // !OPENSSL_1
_
1_API
return
1
;
}
}
// namespace
...
...
@@ -256,17 +256,17 @@ int shrpx_bio_destroy(BIO *b) {
return
0
;
}
#if !OPENSSL_1
0
1_API
#if !OPENSSL_1
_
1_API
b
->
ptr
=
nullptr
;
b
->
init
=
0
;
b
->
flags
=
0
;
#endif // !OPENSSL_1
0
1_API
#endif // !OPENSSL_1
_
1_API
return
1
;
}
}
// namespace
#if OPENSSL_1
0
1_API
#if OPENSSL_1
_
1_API
BIO_METHOD
*
create_bio_method
()
{
auto
meth
=
BIO_meth_new
(
BIO_TYPE_FD
,
"nghttpx-bio"
);
...
...
@@ -283,7 +283,7 @@ BIO_METHOD *create_bio_method() {
void
delete_bio_method
(
BIO_METHOD
*
bio_method
)
{
BIO_meth_free
(
bio_method
);
}
#else // !OPENSSL_1
0
1_API
#else // !OPENSSL_1
_
1_API
BIO_METHOD
*
create_bio_method
()
{
static
BIO_METHOD
shrpx_bio_method
=
{
...
...
@@ -297,7 +297,7 @@ BIO_METHOD *create_bio_method() {
void
delete_bio_method
(
BIO_METHOD
*
bio_method
)
{}
#endif // !OPENSSL_1
0
1_API
#endif // !OPENSSL_1
_
1_API
void
Connection
::
set_ssl
(
SSL
*
ssl
)
{
tls
.
ssl
=
ssl
;
...
...
src/shrpx_ssl.cc
View file @
a3a6b91c
...
...
@@ -72,13 +72,13 @@ namespace shrpx {
namespace
ssl
{
#if !OPENSSL_1
0
1_API
#if !OPENSSL_1
_
1_API
namespace
{
const
unsigned
char
*
ASN1_STRING_get0_data
(
ASN1_STRING
*
x
)
{
return
ASN1_STRING_data
(
x
);
}
}
// namespace
#endif // !OPENSSL_1
0
1_API
#endif // !OPENSSL_1
_
1_API
namespace
{
int
next_proto_cb
(
SSL
*
s
,
const
unsigned
char
**
data
,
unsigned
int
*
len
,
...
...
@@ -280,11 +280,11 @@ int tls_session_new_cb(SSL *ssl, SSL_SESSION *session) {
namespace
{
SSL_SESSION
*
tls_session_get_cb
(
SSL
*
ssl
,
#if OPENSSL_1
0
1_API
#if OPENSSL_1
_
1_API
const
unsigned
char
*
id
,
#else // !OPENSSL_1
0
1_API
#else // !OPENSSL_1
_
1_API
unsigned
char
*
id
,
#endif // !OPENSSL_1
0
1_API
#endif // !OPENSSL_1
_
1_API
int
idlen
,
int
*
copy
)
{
auto
conn
=
static_cast
<
Connection
*>
(
SSL_get_app_data
(
ssl
));
auto
handler
=
static_cast
<
ClientHandler
*>
(
conn
->
data
);
...
...
src/ssl.cc
View file @
a3a6b91c
...
...
@@ -54,13 +54,13 @@ const char *const DEFAULT_CIPHER_LIST =
"SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-"
"SHA:DES-CBC3-SHA:!DSS"
;
#if OPENSSL_1
0
1_API
#if OPENSSL_1
_
1_API
// CRYPTO_LOCK is deprecated as of OpenSSL 1.1.0
LibsslGlobalLock
::
LibsslGlobalLock
()
{}
LibsslGlobalLock
::~
LibsslGlobalLock
()
{}
#else // !OPENSSL_1
0
1_API
#else // !OPENSSL_1
_
1_API
namespace
{
std
::
vector
<
std
::
mutex
>
ssl_global_locks
;
...
...
@@ -91,7 +91,7 @@ LibsslGlobalLock::LibsslGlobalLock() {
LibsslGlobalLock
::~
LibsslGlobalLock
()
{
ssl_global_locks
.
clear
();
}
#endif // !OPENSSL_1
0
1_API
#endif // !OPENSSL_1
_
1_API
const
char
*
get_tls_protocol
(
SSL
*
ssl
)
{
switch
(
SSL_version
(
ssl
))
{
...
...
@@ -166,9 +166,9 @@ bool check_http2_requirement(SSL *ssl) {
void
libssl_init
()
{
// OPENSSL_config() is not available in BoringSSL. It is also
// deprecated as of OpenSSL 1.1.0.
#if !defined(OPENSSL_IS_BORINGSSL) && !OPENSSL_1
0
1_API
#if !defined(OPENSSL_IS_BORINGSSL) && !OPENSSL_1
_
1_API
OPENSSL_config
(
nullptr
);
#endif // !defined(OPENSSL_IS_BORINGSSL) && !OPENSSL_1
0
1_API
#endif // !defined(OPENSSL_IS_BORINGSSL) && !OPENSSL_1
_
1_API
SSL_load_error_strings
();
SSL_library_init
();
...
...
src/ssl_compat.h
View file @
a3a6b91c
...
...
@@ -26,7 +26,7 @@
#include <openssl/opensslv.h>
#define OPENSSL_1
0
1_API \
#define OPENSSL_1
_
1_API \
(!defined(LIBRESSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x1010000fL)
#endif // OPENSSL_COMPAT_H
src/util.cc
View file @
a3a6b91c
...
...
@@ -1351,7 +1351,7 @@ uint32_t hash32(const StringRef &s) {
return
h
;
}
#if !OPENSSL_1
0
1_API
#if !OPENSSL_1
_
1_API
namespace
{
EVP_MD_CTX
*
EVP_MD_CTX_new
(
void
)
{
return
EVP_MD_CTX_create
();
}
}
// namespace
...
...
@@ -1359,7 +1359,7 @@ EVP_MD_CTX *EVP_MD_CTX_new(void) { return EVP_MD_CTX_create(); }
namespace
{
void
EVP_MD_CTX_free
(
EVP_MD_CTX
*
ctx
)
{
EVP_MD_CTX_destroy
(
ctx
);
}
}
// namespace
#endif
#endif
// !OPENSSL_1_1_API
int
sha256
(
uint8_t
*
res
,
const
StringRef
&
s
)
{
int
rv
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment