Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: webrtc/base/sslstreamadapter.h

Issue 2163683003: Relanding: Allow the DTLS fingerprint verification to occur after the handshake. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing comment grammar. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/opensslstreamadapter.cc ('k') | webrtc/base/sslstreamadapter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/sslstreamadapter.h
diff --git a/webrtc/base/sslstreamadapter.h b/webrtc/base/sslstreamadapter.h
index a7ef23fc79935aeefef6773cc8d0fc8725152a94..2b99f00cb307eed1aaa3aa210eae8aebe299fd8d 100644
--- a/webrtc/base/sslstreamadapter.h
+++ b/webrtc/base/sslstreamadapter.h
@@ -106,6 +106,12 @@ enum SSLProtocolVersion {
SSL_PROTOCOL_DTLS_10 = SSL_PROTOCOL_TLS_11,
SSL_PROTOCOL_DTLS_12 = SSL_PROTOCOL_TLS_12,
};
+enum class SSLPeerCertificateDigestError {
+ NONE,
+ UNKNOWN_ALGORITHM,
+ INVALID_LENGTH,
+ VERIFICATION_FAILED,
+};
// Errors for Read -- in the high range so no conflict with OpenSSL.
enum { SSE_MSG_TRUNC = 0xff0001 };
@@ -173,9 +179,14 @@ class SSLStreamAdapter : public StreamAdapterInterface {
// certificate is assumed to have been obtained through some other secure
// channel (such as the signaling channel). This must specify the terminal
// certificate, not just a CA. SSLStream makes a copy of the digest value.
- virtual bool SetPeerCertificateDigest(const std::string& digest_alg,
- const unsigned char* digest_val,
- size_t digest_len) = 0;
+ //
+ // Returns true if successful.
+ // |error| is optional and provides more information about the failure.
+ virtual bool SetPeerCertificateDigest(
+ const std::string& digest_alg,
+ const unsigned char* digest_val,
+ size_t digest_len,
+ SSLPeerCertificateDigestError* error = nullptr) = 0;
// Retrieves the peer's X.509 certificate, if a connection has been
// established. It returns the transmitted over SSL, including the entire
@@ -211,6 +222,12 @@ class SSLStreamAdapter : public StreamAdapterInterface {
virtual bool SetDtlsSrtpCryptoSuites(const std::vector<int>& crypto_suites);
virtual bool GetDtlsSrtpCryptoSuite(int* crypto_suite);
+ // Returns true if a TLS connection has been established.
+ // The only difference between this and "GetState() == SE_OPEN" is that if
+ // the peer certificate digest hasn't been verified, the state will still be
+ // SS_OPENING but IsTlsConnected should return true.
+ virtual bool IsTlsConnected() = 0;
+
// Capabilities testing
static bool HaveDtls();
static bool HaveDtlsSrtp();
« no previous file with comments | « webrtc/base/opensslstreamadapter.cc ('k') | webrtc/base/sslstreamadapter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698