Remove deprecated ssl_identity methods

This is a followup to
https://webrtc-review.googlesource.com/c/src/+/170637

Bug: webrtc:11450
Change-Id: I69928ed7236c6a8a569c7dc0383f7debb4408179
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171224
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31086}
This commit is contained in:
Harald Alvestrand 2020-04-16 14:59:40 +02:00 committed by Commit Bot
parent 5c356bb9b1
commit b33a0ca1ee
8 changed files with 1 additions and 54 deletions

View file

@ -682,8 +682,7 @@ class StatsCollectorTest : public ::testing::Test {
// Fake certificate to report. // Fake certificate to report.
rtc::scoped_refptr<rtc::RTCCertificate> local_certificate( rtc::scoped_refptr<rtc::RTCCertificate> local_certificate(
rtc::RTCCertificate::Create( rtc::RTCCertificate::Create(local_identity.Clone()));
std::unique_ptr<rtc::SSLIdentity>(local_identity.GetReference())));
pc->SetLocalCertificate(kTransportName, local_certificate); pc->SetLocalCertificate(kTransportName, local_certificate);
pc->SetRemoteCertChain(kTransportName, pc->SetRemoteCertChain(kTransportName,
remote_identity.cert_chain().Clone()); remote_identity.cert_chain().Clone());

View file

@ -90,10 +90,6 @@ FakeSSLIdentity::FakeSSLIdentity(const FakeSSLIdentity& o)
FakeSSLIdentity::~FakeSSLIdentity() = default; FakeSSLIdentity::~FakeSSLIdentity() = default;
FakeSSLIdentity* FakeSSLIdentity::GetReference() const {
return new FakeSSLIdentity(*this);
}
std::unique_ptr<SSLIdentity> FakeSSLIdentity::CloneInternal() const { std::unique_ptr<SSLIdentity> FakeSSLIdentity::CloneInternal() const {
return std::make_unique<FakeSSLIdentity>(*this); return std::make_unique<FakeSSLIdentity>(*this);
} }

View file

@ -62,7 +62,6 @@ class FakeSSLIdentity : public SSLIdentity {
~FakeSSLIdentity() override; ~FakeSSLIdentity() override;
// SSLIdentity implementation. // SSLIdentity implementation.
FakeSSLIdentity* GetReference() const override;
const SSLCertificate& certificate() const override; const SSLCertificate& certificate() const override;
const SSLCertChain& cert_chain() const override; const SSLCertChain& cert_chain() const override;
// Not implemented. // Not implemented.

View file

@ -333,10 +333,6 @@ const SSLCertChain& OpenSSLIdentity::cert_chain() const {
return *cert_chain_.get(); return *cert_chain_.get();
} }
OpenSSLIdentity* OpenSSLIdentity::GetReference() const {
return static_cast<OpenSSLIdentity*>(CloneInternal().release());
}
std::unique_ptr<SSLIdentity> OpenSSLIdentity::CloneInternal() const { std::unique_ptr<SSLIdentity> OpenSSLIdentity::CloneInternal() const {
// We cannot use std::make_unique here because the referenced OpenSSLIdentity // We cannot use std::make_unique here because the referenced OpenSSLIdentity
// constructor is private. // constructor is private.

View file

@ -82,7 +82,6 @@ class OpenSSLIdentity final : public SSLIdentity {
const OpenSSLCertificate& certificate() const override; const OpenSSLCertificate& certificate() const override;
const SSLCertChain& cert_chain() const override; const SSLCertChain& cert_chain() const override;
RTC_DEPRECATED OpenSSLIdentity* GetReference() const override;
// Configure an SSL context object to use our key and certificate. // Configure an SSL context object to use our key and certificate.
bool ConfigureIdentity(SSL_CTX* ctx); bool ConfigureIdentity(SSL_CTX* ctx);

View file

@ -254,23 +254,6 @@ std::unique_ptr<SSLIdentity> SSLIdentity::CreateFromPEMChainStrings(
certificate_chain); certificate_chain);
} }
SSLIdentity* SSLIdentity::GenerateForTest(const SSLIdentityParams& params) {
return OpenSSLIdentity::GenerateForTest(params);
}
// static
SSLIdentity* SSLIdentity::FromPEMStrings(const std::string& private_key,
const std::string& certificate) {
return OpenSSLIdentity::FromPEMStrings(private_key, certificate);
}
// static
SSLIdentity* SSLIdentity::FromPEMChainStrings(
const std::string& private_key,
const std::string& certificate_chain) {
return OpenSSLIdentity::FromPEMChainStrings(private_key, certificate_chain);
}
bool operator==(const SSLIdentity& a, const SSLIdentity& b) { bool operator==(const SSLIdentity& a, const SSLIdentity& b) {
return static_cast<const OpenSSLIdentity&>(a) == return static_cast<const OpenSSLIdentity&>(a) ==
static_cast<const OpenSSLIdentity&>(b); static_cast<const OpenSSLIdentity&>(b);

View file

@ -129,29 +129,10 @@ class RTC_EXPORT SSLIdentity {
const std::string& private_key, const std::string& private_key,
const std::string& certificate_chain); const std::string& certificate_chain);
// Generates an identity with the specified validity period.
// TODO(torbjorng): Now that Generate() accepts relevant params, make tests
// use that instead of this function.
RTC_DEPRECATED static SSLIdentity* GenerateForTest(
const SSLIdentityParams& params);
// Construct an identity from a private key and a certificate.
RTC_DEPRECATED static SSLIdentity* FromPEMStrings(
const std::string& private_key,
const std::string& certificate);
// Construct an identity from a private key and a certificate chain.
RTC_DEPRECATED static SSLIdentity* FromPEMChainStrings(
const std::string& private_key,
const std::string& certificate_chain);
virtual ~SSLIdentity() {} virtual ~SSLIdentity() {}
// Returns a new SSLIdentity object instance wrapping the same // Returns a new SSLIdentity object instance wrapping the same
// identity information. // identity information.
// Caller is responsible for freeing the returned object.
// TODO(hbos,torbjorng): Rename to a less confusing name.
RTC_DEPRECATED virtual SSLIdentity* GetReference() const = 0;
std::unique_ptr<SSLIdentity> Clone() const { return CloneInternal(); } std::unique_ptr<SSLIdentity> Clone() const { return CloneInternal(); }
// Returns a temporary reference to the end-entity (leaf) certificate. // Returns a temporary reference to the end-entity (leaf) certificate.

View file

@ -126,9 +126,6 @@ class SSLStreamAdapter : public StreamAdapterInterface {
// Caller is responsible for freeing the returned object. // Caller is responsible for freeing the returned object.
static std::unique_ptr<SSLStreamAdapter> Create( static std::unique_ptr<SSLStreamAdapter> Create(
std::unique_ptr<StreamInterface> stream); std::unique_ptr<StreamInterface> stream);
RTC_DEPRECATED static SSLStreamAdapter* Create(StreamInterface* stream) {
return Create(absl::WrapUnique(stream)).release();
}
explicit SSLStreamAdapter(std::unique_ptr<StreamInterface> stream); explicit SSLStreamAdapter(std::unique_ptr<StreamInterface> stream);
~SSLStreamAdapter() override; ~SSLStreamAdapter() override;
@ -137,9 +134,6 @@ class SSLStreamAdapter : public StreamAdapterInterface {
// of the SSLIdentity object and will free it when appropriate. Should be // of the SSLIdentity object and will free it when appropriate. Should be
// called no more than once on a given SSLStream instance. // called no more than once on a given SSLStream instance.
virtual void SetIdentity(std::unique_ptr<SSLIdentity> identity) = 0; virtual void SetIdentity(std::unique_ptr<SSLIdentity> identity) = 0;
RTC_DEPRECATED virtual void SetIdentity(SSLIdentity* identity) {
SetIdentity(absl::WrapUnique(identity));
}
virtual SSLIdentity* GetIdentityForTesting() const = 0; virtual SSLIdentity* GetIdentityForTesting() const = 0;
// Call this to indicate that we are to play the server role (or client role, // Call this to indicate that we are to play the server role (or client role,