| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/cert/ct_serialization.h" | 5 #include "net/cert/ct_serialization.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <limits> | 10 #include <limits> |
| 11 | 11 |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/numerics/safe_math.h" | 13 #include "base/numerics/safe_math.h" |
| 14 #include "net/cert/signed_certificate_timestamp.h" |
| 15 #include "net/cert/signed_tree_head.h" |
| 14 | 16 |
| 15 namespace net { | 17 namespace net { |
| 16 | 18 |
| 17 namespace ct { | 19 namespace ct { |
| 18 | 20 |
| 19 namespace { | 21 namespace { |
| 20 | 22 |
| 21 // Note: length is always specified in bytes. | 23 // Note: length is always specified in bytes. |
| 22 // Signed Certificate Timestamp (SCT) Version length | 24 // Signed Certificate Timestamp (SCT) Version length |
| 23 const size_t kVersionLength = 1; | 25 const size_t kVersionLength = 1; |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 bool EncodeSCTListForTesting(const base::StringPiece& sct, | 409 bool EncodeSCTListForTesting(const base::StringPiece& sct, |
| 408 std::string* output) { | 410 std::string* output) { |
| 409 std::string encoded_sct; | 411 std::string encoded_sct; |
| 410 return WriteVariableBytes(kSerializedSCTLengthBytes, sct, &encoded_sct) && | 412 return WriteVariableBytes(kSerializedSCTLengthBytes, sct, &encoded_sct) && |
| 411 WriteVariableBytes(kSCTListLengthBytes, encoded_sct, output); | 413 WriteVariableBytes(kSCTListLengthBytes, encoded_sct, output); |
| 412 } | 414 } |
| 413 | 415 |
| 414 } // namespace ct | 416 } // namespace ct |
| 415 | 417 |
| 416 } // namespace net | 418 } // namespace net |
| OLD | NEW |