OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2011 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 |
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 | 1049 |
1050 // The client should have a peer certificate after the handshake. | 1050 // The client should have a peer certificate after the handshake. |
1051 ASSERT_TRUE(GetPeerCertificate(true, client_peer_cert.accept())); | 1051 ASSERT_TRUE(GetPeerCertificate(true, client_peer_cert.accept())); |
1052 ASSERT_TRUE(client_peer_cert != NULL); | 1052 ASSERT_TRUE(client_peer_cert != NULL); |
1053 | 1053 |
1054 // It's not kCERT_PEM. | 1054 // It's not kCERT_PEM. |
1055 std::string client_peer_string = client_peer_cert->ToPEMString(); | 1055 std::string client_peer_string = client_peer_cert->ToPEMString(); |
1056 ASSERT_NE(kCERT_PEM, client_peer_string); | 1056 ASSERT_NE(kCERT_PEM, client_peer_string); |
1057 | 1057 |
1058 // It must not have a chain, because the test certs are self-signed. | 1058 // It must not have a chain, because the test certs are self-signed. |
1059 rtc::SSLCertChain* client_peer_chain; | 1059 ASSERT_FALSE(client_peer_cert->GetChain()); |
1060 ASSERT_FALSE(client_peer_cert->GetChain(&client_peer_chain)); | |
1061 | 1060 |
1062 // The server should have a peer certificate after the handshake. | 1061 // The server should have a peer certificate after the handshake. |
1063 ASSERT_TRUE(GetPeerCertificate(false, server_peer_cert.accept())); | 1062 ASSERT_TRUE(GetPeerCertificate(false, server_peer_cert.accept())); |
1064 ASSERT_TRUE(server_peer_cert != NULL); | 1063 ASSERT_TRUE(server_peer_cert != NULL); |
1065 | 1064 |
1066 // It's kCERT_PEM | 1065 // It's kCERT_PEM |
1067 ASSERT_EQ(kCERT_PEM, server_peer_cert->ToPEMString()); | 1066 ASSERT_EQ(kCERT_PEM, server_peer_cert->ToPEMString()); |
1068 | 1067 |
1069 // It must not have a chain, because the test certs are self-signed. | 1068 // It must not have a chain, because the test certs are self-signed. |
1070 rtc::SSLCertChain* server_peer_chain; | 1069 ASSERT_FALSE(server_peer_cert->GetChain()); |
1071 ASSERT_FALSE(server_peer_cert->GetChain(&server_peer_chain)); | |
1072 } | 1070 } |
1073 | 1071 |
1074 // Test getting the used DTLS ciphers. | 1072 // Test getting the used DTLS ciphers. |
1075 // DTLS 1.2 enabled for neither client nor server -> DTLS 1.0 will be used. | 1073 // DTLS 1.2 enabled for neither client nor server -> DTLS 1.0 will be used. |
1076 TEST_P(SSLStreamAdapterTestDTLS, TestGetSslCipherSuite) { | 1074 TEST_P(SSLStreamAdapterTestDTLS, TestGetSslCipherSuite) { |
1077 MAYBE_SKIP_TEST(HaveDtls); | 1075 MAYBE_SKIP_TEST(HaveDtls); |
1078 SetupProtocolVersions(rtc::SSL_PROTOCOL_DTLS_10, rtc::SSL_PROTOCOL_DTLS_10); | 1076 SetupProtocolVersions(rtc::SSL_PROTOCOL_DTLS_10, rtc::SSL_PROTOCOL_DTLS_10); |
1079 TestHandshake(); | 1077 TestHandshake(); |
1080 | 1078 |
1081 int client_cipher; | 1079 int client_cipher; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1163 rtc::KeyParams::ECDSA(rtc::EC_NIST_P256)))); | 1161 rtc::KeyParams::ECDSA(rtc::EC_NIST_P256)))); |
1164 INSTANTIATE_TEST_CASE_P( | 1162 INSTANTIATE_TEST_CASE_P( |
1165 SSLStreamAdapterTestsDTLS, | 1163 SSLStreamAdapterTestsDTLS, |
1166 SSLStreamAdapterTestDTLS, | 1164 SSLStreamAdapterTestDTLS, |
1167 Combine(Values(rtc::KeyParams::RSA(1024, 65537), | 1165 Combine(Values(rtc::KeyParams::RSA(1024, 65537), |
1168 rtc::KeyParams::RSA(1152, 65537), | 1166 rtc::KeyParams::RSA(1152, 65537), |
1169 rtc::KeyParams::ECDSA(rtc::EC_NIST_P256)), | 1167 rtc::KeyParams::ECDSA(rtc::EC_NIST_P256)), |
1170 Values(rtc::KeyParams::RSA(1024, 65537), | 1168 Values(rtc::KeyParams::RSA(1024, 65537), |
1171 rtc::KeyParams::RSA(1152, 65537), | 1169 rtc::KeyParams::RSA(1152, 65537), |
1172 rtc::KeyParams::ECDSA(rtc::EC_NIST_P256)))); | 1170 rtc::KeyParams::ECDSA(rtc::EC_NIST_P256)))); |
OLD | NEW |