| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #ifndef WEBRTC_BASE_NSSSTREAMADAPTER_H_ | 11 #ifndef WEBRTC_BASE_NSSSTREAMADAPTER_H_ |
| 12 #define WEBRTC_BASE_NSSSTREAMADAPTER_H_ | 12 #define WEBRTC_BASE_NSSSTREAMADAPTER_H_ |
| 13 | 13 |
| 14 #include <string> | 14 #include <string> |
| 15 #include <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 // Hack: Define+undefine int64 and uint64 to avoid typedef conflict with NSS. | 17 // Hack: Define+undefine int64_t and uint64_t to avoid typedef conflict with |
| 18 // NSS. |
| 18 // TODO(kjellander): Remove when webrtc:4497 is completed. | 19 // TODO(kjellander): Remove when webrtc:4497 is completed. |
| 19 #define uint64 foo_uint64 | 20 #define uint64_t foo_uint64 |
| 20 #define int64 foo_int64 | 21 #define int64_t foo_int64 |
| 21 #include "nspr.h" | 22 #include "nspr.h" |
| 22 #undef uint64 | 23 #undef uint64_t |
| 23 #undef int64 | 24 #undef int64_t |
| 24 | 25 |
| 25 #include "nss.h" | 26 #include "nss.h" |
| 26 #include "secmodt.h" | 27 #include "secmodt.h" |
| 27 | 28 |
| 28 #include "webrtc/base/buffer.h" | 29 #include "webrtc/base/buffer.h" |
| 29 #include "webrtc/base/criticalsection.h" | 30 #include "webrtc/base/criticalsection.h" |
| 30 #include "webrtc/base/nssidentity.h" | 31 #include "webrtc/base/nssidentity.h" |
| 31 #include "webrtc/base/ssladapter.h" | 32 #include "webrtc/base/ssladapter.h" |
| 32 #include "webrtc/base/sslstreamadapter.h" | 33 #include "webrtc/base/sslstreamadapter.h" |
| 33 #include "webrtc/base/sslstreamadapterhelper.h" | 34 #include "webrtc/base/sslstreamadapterhelper.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 StreamResult Write(const void* data, | 71 StreamResult Write(const void* data, |
| 71 size_t data_len, | 72 size_t data_len, |
| 72 size_t* written, | 73 size_t* written, |
| 73 int* error) override; | 74 int* error) override; |
| 74 void OnMessage(Message* msg) override; | 75 void OnMessage(Message* msg) override; |
| 75 | 76 |
| 76 bool GetSslCipher(std::string* cipher) override; | 77 bool GetSslCipher(std::string* cipher) override; |
| 77 | 78 |
| 78 // Key Extractor interface | 79 // Key Extractor interface |
| 79 bool ExportKeyingMaterial(const std::string& label, | 80 bool ExportKeyingMaterial(const std::string& label, |
| 80 const uint8* context, | 81 const uint8_t* context, |
| 81 size_t context_len, | 82 size_t context_len, |
| 82 bool use_context, | 83 bool use_context, |
| 83 uint8* result, | 84 uint8_t* result, |
| 84 size_t result_len) override; | 85 size_t result_len) override; |
| 85 | 86 |
| 86 // DTLS-SRTP interface | 87 // DTLS-SRTP interface |
| 87 bool SetDtlsSrtpCiphers(const std::vector<std::string>& ciphers) override; | 88 bool SetDtlsSrtpCiphers(const std::vector<std::string>& ciphers) override; |
| 88 bool GetDtlsSrtpCipher(std::string* cipher) override; | 89 bool GetDtlsSrtpCipher(std::string* cipher) override; |
| 89 | 90 |
| 90 // Capabilities interfaces | 91 // Capabilities interfaces |
| 91 static bool HaveDtls(); | 92 static bool HaveDtls(); |
| 92 static bool HaveDtlsSrtp(); | 93 static bool HaveDtlsSrtp(); |
| 93 static bool HaveExporter(); | 94 static bool HaveExporter(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 116 static bool initialized; // Was InitializeSSL() called? | 117 static bool initialized; // Was InitializeSSL() called? |
| 117 bool cert_ok_; // Did we get and check a cert | 118 bool cert_ok_; // Did we get and check a cert |
| 118 std::vector<PRUint16> srtp_ciphers_; // SRTP cipher list | 119 std::vector<PRUint16> srtp_ciphers_; // SRTP cipher list |
| 119 | 120 |
| 120 static PRDescIdentity nspr_layer_identity; // The NSPR layer identity | 121 static PRDescIdentity nspr_layer_identity; // The NSPR layer identity |
| 121 }; | 122 }; |
| 122 | 123 |
| 123 } // namespace rtc | 124 } // namespace rtc |
| 124 | 125 |
| 125 #endif // WEBRTC_BASE_NSSSTREAMADAPTER_H_ | 126 #endif // WEBRTC_BASE_NSSSTREAMADAPTER_H_ |
| OLD | NEW |