Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Side by Side Diff: net/base/hash_value.h

Issue 2951343002: Remove residual support for SHA-1 public key pins. (Closed)
Patch Set: Remove the rest of HASH_VALUE_SHA1; respond to comments. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/base/hash_value.cc » ('j') | net/data/ssl/name_constrained/README.md » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef NET_BASE_HASH_VALUE_H_ 5 #ifndef NET_BASE_HASH_VALUE_H_
6 #define NET_BASE_HASH_VALUE_H_ 6 #define NET_BASE_HASH_VALUE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 25 matching lines...) Expand all
36 36
37 inline bool operator==(const SHA256HashValue& lhs, const SHA256HashValue& rhs) { 37 inline bool operator==(const SHA256HashValue& lhs, const SHA256HashValue& rhs) {
38 return memcmp(lhs.data, rhs.data, sizeof(lhs.data)) == 0; 38 return memcmp(lhs.data, rhs.data, sizeof(lhs.data)) == 0;
39 } 39 }
40 40
41 inline bool operator!=(const SHA256HashValue& lhs, const SHA256HashValue& rhs) { 41 inline bool operator!=(const SHA256HashValue& lhs, const SHA256HashValue& rhs) {
42 return !(lhs == rhs); 42 return !(lhs == rhs);
43 } 43 }
44 44
45 enum HashValueTag { 45 enum HashValueTag {
46 HASH_VALUE_SHA1,
47 HASH_VALUE_SHA256, 46 HASH_VALUE_SHA256,
48 }; 47 };
49 48
50 class NET_EXPORT HashValue { 49 class NET_EXPORT HashValue {
51 public: 50 public:
52 explicit HashValue(const SHA1HashValue& hash);
53 explicit HashValue(const SHA256HashValue& hash); 51 explicit HashValue(const SHA256HashValue& hash);
54 explicit HashValue(HashValueTag tag) : tag(tag) {} 52 explicit HashValue(HashValueTag tag) : tag(tag) {}
55 HashValue() : tag(HASH_VALUE_SHA1) {} 53 HashValue() : tag(HASH_VALUE_SHA256) {}
56 54
57 // Serializes/Deserializes hashes in the form of 55 // Serializes/Deserializes hashes in the form of
58 // <hash-name>"/"<base64-hash-value> 56 // <hash-name>"/"<base64-hash-value>
59 // (eg: "sha1/...") 57 // (eg: "sha1/...")
60 // This format may be persisted to permanent storage, so 58 // This format may be persisted to permanent storage, so
61 // care should be taken before changing the serialization. 59 // care should be taken before changing the serialization.
62 // 60 //
63 // This format is used for: 61 // This format is used for:
64 // - net_internals display/setting public-key pins 62 // - net_internals display/setting public-key pins
65 // - logging public-key pins 63 // - logging public-key pins
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 113
116 // IsSHA256HashInSortedArray returns true iff |hash| is in |array|, a sorted 114 // IsSHA256HashInSortedArray returns true iff |hash| is in |array|, a sorted
117 // array of SHA256 hashes. 115 // array of SHA256 hashes.
118 bool IsSHA256HashInSortedArray(const SHA256HashValue& hash, 116 bool IsSHA256HashInSortedArray(const SHA256HashValue& hash,
119 const uint8_t* array, 117 const uint8_t* array,
120 size_t array_byte_len); 118 size_t array_byte_len);
121 119
122 } // namespace net 120 } // namespace net
123 121
124 #endif // NET_BASE_HASH_VALUE_H_ 122 #endif // NET_BASE_HASH_VALUE_H_
OLDNEW
« no previous file with comments | « no previous file | net/base/hash_value.cc » ('j') | net/data/ssl/name_constrained/README.md » ('J')

Powered by Google App Engine
This is Rietveld 408576698