OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/socket/ssl_client_socket.h" | 5 #include "net/socket/ssl_client_socket.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 2365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2376 SSLInfo result; | 2376 SSLInfo result; |
2377 ASSERT_TRUE(sock_->GetSSLInfo(&result)); | 2377 ASSERT_TRUE(sock_->GetSSLInfo(&result)); |
2378 | 2378 |
2379 EXPECT_FALSE(result.cert_status & CERT_STATUS_IS_EV); | 2379 EXPECT_FALSE(result.cert_status & CERT_STATUS_IS_EV); |
2380 EXPECT_TRUE(result.cert_status & CERT_STATUS_CT_COMPLIANCE_FAILED); | 2380 EXPECT_TRUE(result.cert_status & CERT_STATUS_CT_COMPLIANCE_FAILED); |
2381 } | 2381 } |
2382 | 2382 |
2383 namespace { | 2383 namespace { |
2384 | 2384 |
2385 bool IsValidOCSPResponse(const base::StringPiece& input) { | 2385 bool IsValidOCSPResponse(const base::StringPiece& input) { |
2386 der::Parser parser(der::Input(reinterpret_cast<const uint8_t*>(input.data()), | 2386 der::Parser parser((der::Input(input))); |
eroman
2016/01/13 22:54:00
yay c++ parsing!
nharper
2016/01/13 23:04:48
Yay indeed :P
There were a few other vexing parses
| |
2387 input.length())); | |
2388 der::Parser sequence; | 2387 der::Parser sequence; |
2389 return parser.ReadSequence(&sequence) && !parser.HasMore() && | 2388 return parser.ReadSequence(&sequence) && !parser.HasMore() && |
2390 sequence.SkipTag(der::kEnumerated) && | 2389 sequence.SkipTag(der::kEnumerated) && |
2391 sequence.SkipTag(der::kTagContextSpecific | der::kTagConstructed | | 2390 sequence.SkipTag(der::kTagContextSpecific | der::kTagConstructed | |
2392 0) && | 2391 0) && |
2393 !sequence.HasMore(); | 2392 !sequence.HasMore(); |
2394 } | 2393 } |
2395 | 2394 |
2396 } // namespace | 2395 } // namespace |
2397 | 2396 |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3235 int rv; | 3234 int rv; |
3236 ASSERT_TRUE(CreateAndConnectSSLClientSocket(client_config, &rv)); | 3235 ASSERT_TRUE(CreateAndConnectSSLClientSocket(client_config, &rv)); |
3237 EXPECT_EQ(OK, rv); | 3236 EXPECT_EQ(OK, rv); |
3238 | 3237 |
3239 std::string proto; | 3238 std::string proto; |
3240 EXPECT_EQ(SSLClientSocket::kNextProtoUnsupported, | 3239 EXPECT_EQ(SSLClientSocket::kNextProtoUnsupported, |
3241 sock_->GetNextProto(&proto)); | 3240 sock_->GetNextProto(&proto)); |
3242 } | 3241 } |
3243 | 3242 |
3244 } // namespace net | 3243 } // namespace net |
OLD | NEW |