OLD | NEW |
---|---|
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/base/x509_certificate.h" | 5 #include "net/base/x509_certificate.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
478 static const unsigned kNumSerials = 10; | 478 static const unsigned kNumSerials = 10; |
479 static const unsigned kSerialBytes = 16; | 479 static const unsigned kSerialBytes = 16; |
480 static const uint8 kSerials[kNumSerials][kSerialBytes] = { | 480 static const uint8 kSerials[kNumSerials][kSerialBytes] = { |
481 // Not a real certificate. For testing only. | 481 // Not a real certificate. For testing only. |
482 {0x07,0x7a,0x59,0xbc,0xd5,0x34,0x59,0x60,0x1c,0xa6,0x90,0x72,0x67,0xa6,0xdd, 0x1c}, | 482 {0x07,0x7a,0x59,0xbc,0xd5,0x34,0x59,0x60,0x1c,0xa6,0x90,0x72,0x67,0xa6,0xdd, 0x1c}, |
483 | 483 |
484 {0x04,0x7e,0xcb,0xe9,0xfc,0xa5,0x5f,0x7b,0xd0,0x9e,0xae,0x36,0xe1,0x0c,0xae, 0x1e}, | 484 {0x04,0x7e,0xcb,0xe9,0xfc,0xa5,0x5f,0x7b,0xd0,0x9e,0xae,0x36,0xe1,0x0c,0xae, 0x1e}, |
485 {0xd8,0xf3,0x5f,0x4e,0xb7,0x87,0x2b,0x2d,0xab,0x06,0x92,0xe3,0x15,0x38,0x2f, 0xb0}, | 485 {0xd8,0xf3,0x5f,0x4e,0xb7,0x87,0x2b,0x2d,0xab,0x06,0x92,0xe3,0x15,0x38,0x2f, 0xb0}, |
486 {0xb0,0xb7,0x13,0x3e,0xd0,0x96,0xf9,0xb5,0x6f,0xae,0x91,0xc8,0x74,0xbd,0x3a, 0xc0}, | 486 {0xb0,0xb7,0x13,0x3e,0xd0,0x96,0xf9,0xb5,0x6f,0xae,0x91,0xc8,0x74,0xbd,0x3a, 0xc0}, |
487 {0x92,0x39,0xd5,0x34,0x8f,0x40,0xd1,0x69,0x5a,0x74,0x54,0x70,0xe1,0xf2,0x3f, 0x43}, | 487 {0x92,0x39,0xd5,0x34,0x8f,0x40,0xd1,0x69,0x5a,0x74,0x54,0x70,0xe1,0xf2,0x3f, 0x43}, |
488 {0x92,0x39,0xd5,0x34,0x8f,0x40,0xd1,0x69,0x5a,0x74,0x54,0x70,0xe1,0xf2,0x3f, 0x43}, | 488 {0xe9,0x02,0x8b,0x95,0x78,0xe4,0x15,0xdc,0x1a,0x71,0x0a,0x2b,0x88,0x15,0x44, 0x47}, |
jar (doing other things)
2011/03/22 17:03:15
nit: Please wrap at 80 characters.
| |
489 {0xd7,0x55,0x8f,0xda,0xf5,0xf1,0x10,0x5b,0xb2,0x13,0x28,0x2b,0x70,0x77,0x29, 0xa3}, | 489 {0xd7,0x55,0x8f,0xda,0xf5,0xf1,0x10,0x5b,0xb2,0x13,0x28,0x2b,0x70,0x77,0x29, 0xa3}, |
490 {0xf5,0xc8,0x6a,0xf3,0x61,0x62,0xf1,0x3a,0x64,0xf5,0x4f,0x6d,0xc9,0x58,0x7c, 0x06}, | 490 {0xf5,0xc8,0x6a,0xf3,0x61,0x62,0xf1,0x3a,0x64,0xf5,0x4f,0x6d,0xc9,0x58,0x7c, 0x06}, |
491 {0x39,0x2a,0x43,0x4f,0x0e,0x07,0xdf,0x1f,0x8a,0xa3,0x05,0xde,0x34,0xe0,0xc2, 0x29}, | 491 {0x39,0x2a,0x43,0x4f,0x0e,0x07,0xdf,0x1f,0x8a,0xa3,0x05,0xde,0x34,0xe0,0xc2, 0x29}, |
492 {0x3e,0x75,0xce,0xd4,0x6b,0x69,0x30,0x21,0x21,0x88,0x30,0xae,0x86,0xa8,0x2a, 0x71}, | 492 {0x3e,0x75,0xce,0xd4,0x6b,0x69,0x30,0x21,0x21,0x88,0x30,0xae,0x86,0xa8,0x2a, 0x71}, |
493 }; | 493 }; |
494 | 494 |
495 if (serial_number_.size() == kSerialBytes) { | 495 if (serial_number_.size() == kSerialBytes) { |
496 for (unsigned i = 0; i < kNumSerials; i++) { | 496 for (unsigned i = 0; i < kNumSerials; i++) { |
497 if (memcmp(kSerials[i], serial_number_.data(), kSerialBytes) == 0) { | 497 if (memcmp(kSerials[i], serial_number_.data(), kSerialBytes) == 0) { |
498 UMA_HISTOGRAM_CUSTOM_COUNTS( | 498 UMA_HISTOGRAM_CUSTOM_COUNTS( |
499 "Net.SSLCertBlacklisted", i /* sample */, 0 /* min */, | 499 "Net.SSLCertBlacklisted", i /* sample */, 0 /* min */, |
500 99 /* max */, 100 /* num buckets */); | 500 99 /* max */, 100 /* num buckets */); |
jar (doing other things)
2011/03/22 17:03:15
For bucket size, you may as well set the size of t
| |
501 return true; | 501 return true; |
502 } | 502 } |
503 } | 503 } |
504 } | 504 } |
505 | 505 |
506 return false; | 506 return false; |
507 } | 507 } |
508 | 508 |
509 } // namespace net | 509 } // namespace net |
OLD | NEW |