Fix up OpenSSL/BoringSSL forward declarations.

There is no need to redefine SSL_CTX. base.h/ossl_typ.h defines it
already. Additionally, switch the base.h includes to the
OpenSSL-compatible ossl_typ.h spelling. That just got landed in
https://webrtc-review.googlesource.com/c/104120, so I'm guessing
OpenSSL consumers just didn't notice yet.

While getting the current BoringSSL name mangling scheme working with
WebRTC is a ways off, one of the requirements will almost certainly be
that WebRTC never forward-declare any BoringSSL types itself, instead
leaving it to openssl/base.h (or openssl/ossl_typ.h, the
OpenSSL-compatible alias). This is because we'd need to rename the
struct names themselves where they participate in C++ name mangling.
E.g. std::pair<RSA*, int> would mangle as rsa_st.

Bug: webrtc:5664
Change-Id: Ib9695d4ae4bc07d2bc54c9fdfb8600f44b5ec7bb
Reviewed-on: https://webrtc-review.googlesource.com/c/106675
Commit-Queue: David Benjamin <davidben@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25257}
This commit is contained in:
David Benjamin
2018-10-17 14:23:31 -05:00
committed by Commit Bot
parent 50b1e6b760
commit 6714bf9f18
3 changed files with 3 additions and 7 deletions

View File

@ -11,7 +11,7 @@
#ifndef RTC_BASE_OPENSSLCERTIFICATE_H_
#define RTC_BASE_OPENSSLCERTIFICATE_H_
#include <openssl/base.h> // for X509, ssl_ctx_st
#include <openssl/ossl_typ.h> // for X509, SSL_CTX
#include <stddef.h> // for size_t
#include <stdint.h> // for int64_t
@ -22,8 +22,6 @@
#include "rtc_base/sslcertificate.h" // for SSLCertificate
#include "rtc_base/sslidentity.h" // for SSLIdentityParams
typedef struct ssl_ctx_st SSL_CTX;
namespace rtc {
class OpenSSLKeyPair;

View File

@ -11,7 +11,7 @@
#ifndef RTC_BASE_OPENSSLDIGEST_H_
#define RTC_BASE_OPENSSLDIGEST_H_
#include <openssl/base.h> // for EVP_MD, EVP_MD_CTX
#include <openssl/ossl_typ.h> // for EVP_MD, EVP_MD_CTX
#include <string>
#include "rtc_base/messagedigest.h"

View File

@ -11,7 +11,7 @@
#ifndef RTC_BASE_OPENSSLIDENTITY_H_
#define RTC_BASE_OPENSSLIDENTITY_H_
#include <openssl/base.h> // for EVP_PKEY, ssl_ctx_st
#include <openssl/ossl_typ.h> // for EVP_PKEY, SSL_CTX
#include <ctime> // for time_t
#include <memory> // for unique_ptr
@ -23,8 +23,6 @@
#include "rtc_base/sslcertificate.h" // for SSLCertChain
#include "rtc_base/sslidentity.h" // for SSLIdentity, KeyParams, SSL...
typedef struct ssl_ctx_st SSL_CTX;
namespace rtc {
// OpenSSLKeyPair encapsulates an OpenSSL EVP_PKEY* keypair object,