Revert of Change WebRTC SslCipher to be exposed as number only. (patchset #20 id:750001 of https://codereview.webrtc.org/1337673002/ )

Reason for revert:
This broke chromium.fyi bot.

Original issue's description:
> Change WebRTC SslCipher to be exposed as number only.
>
> This makes the SSL exposed as uint16_t which is the IANA value. GetRfcSslCipherName is introduced to handle the conversion to names from ID. IANA value will be used for UMA reporting. Names will still be used for WebRTC stats reporting.
>
> For SRTP, currently it's still string internally but is reported as IANA number.
>
> This is used by the ongoing CL https://codereview.chromium.org/1335023002.
>
> BUG=523033
>
> Committed: https://crrev.com/4fe3c9a77386598db9abd1f0d6983aefee9cc943
> Cr-Commit-Position: refs/heads/master@{#10124}

TBR=juberti@webrtc.org,rsleevi@chromium.org,pthatcher@webrtc.org,davidben@chromium.org,juberti@google.com,davidben@webrtc.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=523033

Review URL: https://codereview.webrtc.org/1380603005

Cr-Commit-Position: refs/heads/master@{#10125}
This commit is contained in:
guoweis
2015-09-30 19:23:09 -07:00
committed by Commit bot
parent 4fe3c9a773
commit 27dc29b0df
30 changed files with 275 additions and 320 deletions

View File

@ -19,23 +19,6 @@
namespace rtc {
// Constants for SRTP profiles.
const uint16_t SRTP_AES128_CM_SHA1_80 = 0x0001;
const uint16_t SRTP_AES128_CM_SHA1_32 = 0x0002;
// Cipher suite to use for SRTP. Typically a 80-bit HMAC will be used, except
// in applications (voice) where the additional bandwidth may be significant.
// A 80-bit HMAC is always used for SRTCP.
// 128-bit AES with 80-bit SHA-1 HMAC.
extern const char CS_AES_CM_128_HMAC_SHA1_80[];
// 128-bit AES with 32-bit SHA-1 HMAC.
extern const char CS_AES_CM_128_HMAC_SHA1_32[];
// Returns the DTLS-SRTP protection profile ID, as defined in
// https://tools.ietf.org/html/rfc5764#section-4.1.2, for the given SRTP
// Crypto-suite, as defined in https://tools.ietf.org/html/rfc4568#section-6.2
uint16_t GetSrtpCryptoSuiteFromName(const std::string& cipher_rfc_name);
// SSLStreamAdapter : A StreamInterfaceAdapter that does SSL/TLS.
// After SSL has been started, the stream will only open on successful
// SSL verification of certificates, and the communication is
@ -150,9 +133,9 @@ class SSLStreamAdapter : public StreamAdapterInterface {
// chain. The returned certificate is owned by the caller.
virtual bool GetPeerCertificate(SSLCertificate** cert) const = 0;
// Retrieves the IANA registration id of the cipher suite used for the
// connection (e.g. 0x2F for "TLS_RSA_WITH_AES_128_CBC_SHA").
virtual bool GetSslCipherSuite(uint16_t* cipher);
// Retrieves the name of the cipher suite used for the connection
// (e.g. "TLS_RSA_WITH_AES_128_CBC_SHA").
virtual bool GetSslCipher(std::string* cipher);
// Key Exporter interface from RFC 5705
// Arguments are:
@ -184,14 +167,9 @@ class SSLStreamAdapter : public StreamAdapterInterface {
// Returns the default Ssl cipher used between streams of this class
// for the given protocol version. This is used by the unit tests.
// TODO(guoweis): Move this away from a static class method.
static uint16_t GetDefaultSslCipherForTest(SSLProtocolVersion version,
KeyType key_type);
// TODO(guoweis): Move this away from a static class method. Currently this is
// introduced such that any caller could depend on sslstreamadapter.h without
// depending on specific SSL implementation.
static std::string GetSslCipherSuiteName(uint16_t cipher);
// TODO(torbjorng@webrtc.org): Fix callers to avoid default parameter.
static std::string GetDefaultSslCipher(SSLProtocolVersion version,
KeyType key_type = KT_DEFAULT);
private:
// If true, the server certificate need not match the configured