From 6714bf9f18f2514919f7b0cdc305107076cdc65b Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Wed, 17 Oct 2018 14:23:31 -0500 Subject: [PATCH] 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 would mangle as rsa_st. Bug: webrtc:5664 Change-Id: Ib9695d4ae4bc07d2bc54c9fdfb8600f44b5ec7bb Reviewed-on: https://webrtc-review.googlesource.com/c/106675 Commit-Queue: David Benjamin Reviewed-by: Karl Wiberg Reviewed-by: Per Kjellander Cr-Commit-Position: refs/heads/master@{#25257} --- rtc_base/opensslcertificate.h | 4 +--- rtc_base/openssldigest.h | 2 +- rtc_base/opensslidentity.h | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/rtc_base/opensslcertificate.h b/rtc_base/opensslcertificate.h index 3b49f93ef5..ef416a1df4 100644 --- a/rtc_base/opensslcertificate.h +++ b/rtc_base/opensslcertificate.h @@ -11,7 +11,7 @@ #ifndef RTC_BASE_OPENSSLCERTIFICATE_H_ #define RTC_BASE_OPENSSLCERTIFICATE_H_ -#include // for X509, ssl_ctx_st +#include // for X509, SSL_CTX #include // for size_t #include // 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; diff --git a/rtc_base/openssldigest.h b/rtc_base/openssldigest.h index 1427a94fdd..78d28d75b6 100644 --- a/rtc_base/openssldigest.h +++ b/rtc_base/openssldigest.h @@ -11,7 +11,7 @@ #ifndef RTC_BASE_OPENSSLDIGEST_H_ #define RTC_BASE_OPENSSLDIGEST_H_ -#include // for EVP_MD, EVP_MD_CTX +#include // for EVP_MD, EVP_MD_CTX #include #include "rtc_base/messagedigest.h" diff --git a/rtc_base/opensslidentity.h b/rtc_base/opensslidentity.h index b72a4c2294..d0e87a0c78 100644 --- a/rtc_base/opensslidentity.h +++ b/rtc_base/opensslidentity.h @@ -11,7 +11,7 @@ #ifndef RTC_BASE_OPENSSLIDENTITY_H_ #define RTC_BASE_OPENSSLIDENTITY_H_ -#include // for EVP_PKEY, ssl_ctx_st +#include // for EVP_PKEY, SSL_CTX #include // for time_t #include // 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,