2 * Copyright 2017 Facebook, Inc.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 #include <folly/portability/OpenSSL.h>
21 #ifdef OPENSSL_IS_BORINGSSL
22 int SSL_CTX_set1_sigalgs_list(SSL_CTX*, const char*) {
23 return 1; // 0 implies error
26 int TLS1_get_client_version(SSL* s) {
27 return s->client_version;
30 int BIO_meth_set_read(BIO_METHOD* biom, int (*read)(BIO*, char*, int)) {
35 int BIO_meth_set_write(BIO_METHOD* biom, int (*write)(BIO*, const char*, int)) {
40 #elif FOLLY_OPENSSL_IS_102 || FOLLY_OPENSSL_IS_101
41 int SSL_CTX_up_ref(SSL_CTX* ctx) {
42 return CRYPTO_add(&ctx->references, 1, CRYPTO_LOCK_SSL_CTX);
45 int SSL_SESSION_up_ref(SSL_SESSION* session) {
46 return CRYPTO_add(&session->references, 1, CRYPTO_LOCK_SSL_SESSION);
49 int X509_up_ref(X509* x) {
50 return CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509);
53 int BIO_meth_set_read(BIO_METHOD* biom, int (*read)(BIO*, char*, int)) {
58 int BIO_meth_set_write(BIO_METHOD* biom, int (*write)(BIO*, const char*, int)) {
63 #elif FOLLY_OPENSSL_IS_110