
Mostly this consists of marking functions with override when applicable, and moving function bodies from .h to .cc files. Not inlining virtual functions with simple bodies such as { return false; } strikes me as probably losing more in readability than we gain in binary size and compilation time, but I guess it's just like any other case where enabling a generally good warning forces us to write slightly worse code in a couple of places. BUG=163 R=kjellander@webrtc.org, tommi@webrtc.org Review URL: https://webrtc-codereview.appspot.com/47429004 Cr-Commit-Position: refs/heads/master@{#8656} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8656 4adac7df-926f-26a2-2b94-8c16560cd09d
109 lines
3.3 KiB
C++
109 lines
3.3 KiB
C++
/*
|
|
* Copyright 2004 The WebRTC Project Authors. All rights reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#if HAVE_CONFIG_H
|
|
#include "config.h"
|
|
#endif // HAVE_CONFIG_H
|
|
|
|
#include "webrtc/base/sslstreamadapter.h"
|
|
#include "webrtc/base/sslconfig.h"
|
|
|
|
#if SSL_USE_SCHANNEL
|
|
|
|
// SChannel support for DTLS and peer-to-peer mode are not
|
|
// done.
|
|
#elif SSL_USE_OPENSSL // && !SSL_USE_SCHANNEL
|
|
|
|
#include "webrtc/base/opensslstreamadapter.h"
|
|
|
|
#elif SSL_USE_NSS // && !SSL_USE_SCHANNEL && !SSL_USE_OPENSSL
|
|
|
|
#include "webrtc/base/nssstreamadapter.h"
|
|
|
|
#endif // !SSL_USE_OPENSSL && !SSL_USE_SCHANNEL && !SSL_USE_NSS
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
namespace rtc {
|
|
|
|
SSLStreamAdapter* SSLStreamAdapter::Create(StreamInterface* stream) {
|
|
#if SSL_USE_SCHANNEL
|
|
return NULL;
|
|
#elif SSL_USE_OPENSSL // !SSL_USE_SCHANNEL
|
|
return new OpenSSLStreamAdapter(stream);
|
|
#elif SSL_USE_NSS // !SSL_USE_SCHANNEL && !SSL_USE_OPENSSL
|
|
return new NSSStreamAdapter(stream);
|
|
#else // !SSL_USE_SCHANNEL && !SSL_USE_OPENSSL && !SSL_USE_NSS
|
|
return NULL;
|
|
#endif
|
|
}
|
|
|
|
bool SSLStreamAdapter::GetSslCipher(std::string* cipher) {
|
|
return false;
|
|
}
|
|
|
|
bool SSLStreamAdapter::ExportKeyingMaterial(const std::string& label,
|
|
const uint8* context,
|
|
size_t context_len,
|
|
bool use_context,
|
|
uint8* result,
|
|
size_t result_len) {
|
|
return false; // Default is unsupported
|
|
}
|
|
|
|
bool SSLStreamAdapter::SetDtlsSrtpCiphers(
|
|
const std::vector<std::string>& ciphers) {
|
|
return false;
|
|
}
|
|
|
|
bool SSLStreamAdapter::GetDtlsSrtpCipher(std::string* cipher) {
|
|
return false;
|
|
}
|
|
|
|
// Note: this matches the logic above with SCHANNEL dominating
|
|
#if SSL_USE_SCHANNEL
|
|
bool SSLStreamAdapter::HaveDtls() { return false; }
|
|
bool SSLStreamAdapter::HaveDtlsSrtp() { return false; }
|
|
bool SSLStreamAdapter::HaveExporter() { return false; }
|
|
std::string SSLStreamAdapter::GetDefaultSslCipher() {
|
|
return std::string();
|
|
}
|
|
#elif SSL_USE_OPENSSL
|
|
bool SSLStreamAdapter::HaveDtls() {
|
|
return OpenSSLStreamAdapter::HaveDtls();
|
|
}
|
|
bool SSLStreamAdapter::HaveDtlsSrtp() {
|
|
return OpenSSLStreamAdapter::HaveDtlsSrtp();
|
|
}
|
|
bool SSLStreamAdapter::HaveExporter() {
|
|
return OpenSSLStreamAdapter::HaveExporter();
|
|
}
|
|
std::string SSLStreamAdapter::GetDefaultSslCipher() {
|
|
return OpenSSLStreamAdapter::GetDefaultSslCipher();
|
|
}
|
|
#elif SSL_USE_NSS
|
|
bool SSLStreamAdapter::HaveDtls() {
|
|
return NSSStreamAdapter::HaveDtls();
|
|
}
|
|
bool SSLStreamAdapter::HaveDtlsSrtp() {
|
|
return NSSStreamAdapter::HaveDtlsSrtp();
|
|
}
|
|
bool SSLStreamAdapter::HaveExporter() {
|
|
return NSSStreamAdapter::HaveExporter();
|
|
}
|
|
std::string SSLStreamAdapter::GetDefaultSslCipher() {
|
|
return NSSStreamAdapter::GetDefaultSslCipher();
|
|
}
|
|
#endif // !SSL_USE_SCHANNEL && !SSL_USE_OPENSSL && !SSL_USE_NSS
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
} // namespace rtc
|