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

Side by Side Diff: net/base/dnssec_chain_verifier.cc

Issue 7823004: Convert SHA256_LENGTH from a constant-in-anonymous-enum to a static const. This defines the cons... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/dnssec_chain_verifier.h" 5 #include "net/base/dnssec_chain_verifier.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/sha1.h" 9 #include "base/sha1.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 // digest_type: see http://tools.ietf.org/html/rfc4034#appendix-A.2 421 // digest_type: see http://tools.ietf.org/html/rfc4034#appendix-A.2
422 // keyid: the key's id 422 // keyid: the key's id
423 // algorithm: see http://tools.ietf.org/html/rfc4034#appendix-A.1 423 // algorithm: see http://tools.ietf.org/html/rfc4034#appendix-A.1
424 bool DNSSECChainVerifier::DigestKey(base::StringPiece* out, 424 bool DNSSECChainVerifier::DigestKey(base::StringPiece* out,
425 const base::StringPiece& name, 425 const base::StringPiece& name,
426 const base::StringPiece& dnskey, 426 const base::StringPiece& dnskey,
427 uint8 digest_type, 427 uint8 digest_type,
428 uint16 keyid, 428 uint16 keyid,
429 uint8 algorithm) { 429 uint8 algorithm) {
430 std::string temp; 430 std::string temp;
431 uint8 temp2[crypto::SHA256_LENGTH]; 431 uint8 temp2[crypto::kSHA256Length];
432 const uint8* digest; 432 const uint8* digest;
433 unsigned digest_len; 433 unsigned digest_len;
434 434
435 std::string input = name.as_string() + dnskey.as_string(); 435 std::string input = name.as_string() + dnskey.as_string();
436 436
437 if (digest_type == kDNSSEC_SHA1) { 437 if (digest_type == kDNSSEC_SHA1) {
438 temp = base::SHA1HashString(input); 438 temp = base::SHA1HashString(input);
439 digest = reinterpret_cast<const uint8*>(temp.data()); 439 digest = reinterpret_cast<const uint8*>(temp.data());
440 digest_len = base::SHA1_LENGTH; 440 digest_len = base::SHA1_LENGTH;
441 } else if (digest_type == kDNSSEC_SHA256) { 441 } else if (digest_type == kDNSSEC_SHA256) {
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 } 910 }
911 } 911 }
912 912
913 if (output->authorized_hashes.empty()) 913 if (output->authorized_hashes.empty())
914 return DISCARD; 914 return DISCARD;
915 915
916 return SUCCESS; 916 return SUCCESS;
917 } 917 }
918 918
919 } // namespace net 919 } // namespace net
OLDNEW
« crypto/sha2.h ('K') | « net/base/crl_set.cc ('k') | net/base/transport_security_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698