| Index: net/base/x509_cert_types.cc
|
| ===================================================================
|
| --- net/base/x509_cert_types.cc (revision 175486)
|
| +++ net/base/x509_cert_types.cc (working copy)
|
| @@ -8,7 +8,6 @@
|
| #include <cstring>
|
|
|
| #include "base/logging.h"
|
| -#include "base/sha1.h"
|
| #include "base/string_number_conversions.h"
|
| #include "base/string_piece.h"
|
| #include "base/time.h"
|
| @@ -29,24 +28,8 @@
|
| return result;
|
| }
|
|
|
| -// CompareSHA1Hashes is a helper function for using bsearch() with an array of
|
| -// SHA1 hashes.
|
| -int CompareSHA1Hashes(const void* a, const void* b) {
|
| - return memcmp(a, b, base::kSHA1Length);
|
| }
|
|
|
| -} // namespace
|
| -
|
| -// static
|
| -bool IsSHA1HashInSortedArray(const SHA1HashValue& hash,
|
| - const uint8* array,
|
| - size_t array_byte_len) {
|
| - DCHECK_EQ(0u, array_byte_len % base::kSHA1Length);
|
| - const size_t arraylen = array_byte_len / base::kSHA1Length;
|
| - return NULL != bsearch(hash.data, array, arraylen, base::kSHA1Length,
|
| - CompareSHA1Hashes);
|
| -}
|
| -
|
| CertPrincipal::CertPrincipal() {
|
| }
|
|
|
| @@ -143,52 +126,4 @@
|
| return true;
|
| }
|
|
|
| -bool HashValue::Equals(const HashValue& other) const {
|
| - if (tag != other.tag)
|
| - return false;
|
| - switch (tag) {
|
| - case HASH_VALUE_SHA1:
|
| - return fingerprint.sha1.Equals(other.fingerprint.sha1);
|
| - case HASH_VALUE_SHA256:
|
| - return fingerprint.sha256.Equals(other.fingerprint.sha256);
|
| - default:
|
| - NOTREACHED() << "Unknown HashValueTag " << tag;
|
| - return false;
|
| - }
|
| -}
|
| -
|
| -size_t HashValue::size() const {
|
| - switch (tag) {
|
| - case HASH_VALUE_SHA1:
|
| - return sizeof(fingerprint.sha1.data);
|
| - case HASH_VALUE_SHA256:
|
| - return sizeof(fingerprint.sha256.data);
|
| - default:
|
| - NOTREACHED() << "Unknown HashValueTag " << tag;
|
| - // Although this is NOTREACHED, this function might be inlined and its
|
| - // return value can be passed to memset as the length argument. If we
|
| - // returned 0 here, it might result in what appears (in some stages of
|
| - // compilation) to be a call to to memset with a length argument of 0,
|
| - // which results in a warning. Therefore, we return a dummy value
|
| - // here.
|
| - return sizeof(fingerprint.sha1.data);
|
| - }
|
| -}
|
| -
|
| -unsigned char* HashValue::data() {
|
| - return const_cast<unsigned char*>(const_cast<const HashValue*>(this)->data());
|
| -}
|
| -
|
| -const unsigned char* HashValue::data() const {
|
| - switch (tag) {
|
| - case HASH_VALUE_SHA1:
|
| - return fingerprint.sha1.data;
|
| - case HASH_VALUE_SHA256:
|
| - return fingerprint.sha256.data;
|
| - default:
|
| - NOTREACHED() << "Unknown HashValueTag " << tag;
|
| - return NULL;
|
| - }
|
| -}
|
| -
|
| } // namespace net
|
|
|