Commit 6d3f73dd authored by Alex Guzman's avatar Alex Guzman Committed by Facebook Github Bot

Add some more OpenSSL 1.1.0 compat functions

Summary: Adds a few more OpenSSL compatibility functions for working with X509_STORE and its objects.

Reviewed By: knekritz

Differential Revision: D7540930

fbshipit-source-id: 0275a200d673386988bc25140b1d827859b04364
parent a8f11418
......@@ -302,6 +302,10 @@ void DSA_get0_key(
}
}
STACK_OF(X509_OBJECT) * X509_STORE_get0_objects(X509_STORE* store) {
return store->objs;
}
X509* X509_STORE_CTX_get0_cert(X509_STORE_CTX* ctx) {
return ctx->cert;
}
......@@ -476,6 +480,16 @@ uint32_t X509_get_extended_key_usage(X509* x) {
return x->ex_xkusage;
}
int X509_OBJECT_get_type(const X509_OBJECT* obj) {
return obj->type;
}
X509* X509_OBJECT_get0_X509(const X509_OBJECT* obj) {
if (obj == nullptr || obj->type != X509_LU_X509) {
return nullptr;
}
return obj->data.x509;
}
#endif // !FOLLY_OPENSSL_IS_110
} // namespace ssl
} // namespace portability
......
......@@ -171,6 +171,8 @@ void DSA_get0_key(
const BIGNUM** pub_key,
const BIGNUM** priv_key);
STACK_OF(X509_OBJECT) * X509_STORE_get0_objects(X509_STORE* store);
X509* X509_STORE_CTX_get0_cert(X509_STORE_CTX* ctx);
STACK_OF(X509) * X509_STORE_CTX_get0_chain(X509_STORE_CTX* ctx);
STACK_OF(X509) * X509_STORE_CTX_get0_untrusted(X509_STORE_CTX* ctx);
......@@ -195,6 +197,8 @@ uint32_t X509_get_extension_flags(X509* x);
uint32_t X509_get_key_usage(X509* x);
uint32_t X509_get_extended_key_usage(X509* x);
int X509_OBJECT_get_type(const X509_OBJECT* obj);
X509* X509_OBJECT_get0_X509(const X509_OBJECT* obj);
#endif
#if FOLLY_OPENSSL_IS_110
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment