OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
9 #include "base/sha1.h" | 9 #include "base/sha1.h" |
10 #include "base/sha2.h" | 10 #include "base/sha2.h" |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 | 725 |
726 for (unsigned i = 0; i < num_ds; i++) { | 726 for (unsigned i = 0; i < num_ds; i++) { |
727 uint8 digest_type; | 727 uint8 digest_type; |
728 base::StringPiece digest; | 728 base::StringPiece digest; |
729 if (!U8(&digest_type) || | 729 if (!U8(&digest_type) || |
730 !VariableLength16(&digest)) { | 730 !VariableLength16(&digest)) { |
731 return BAD_DATA; | 731 return BAD_DATA; |
732 } | 732 } |
733 | 733 |
734 digest_types[i] = digest_type; | 734 digest_types[i] = digest_type; |
735 if (digest.size() > 0) { | 735 lookahead[i] = digest.empty(); |
| 736 if (!digest.empty()) |
736 (*rrdatas)[i] = digest; | 737 (*rrdatas)[i] = digest; |
737 lookahead[i] = false; | |
738 } else { | |
739 lookahead[i] = true; | |
740 } | |
741 } | 738 } |
742 | 739 |
743 base::StringPiece next_entry_key; | 740 base::StringPiece next_entry_key; |
744 if (!ReadAheadEntryKey(&next_entry_key)) | 741 if (!ReadAheadEntryKey(&next_entry_key)) |
745 return BAD_DATA; | 742 return BAD_DATA; |
746 if (next_entry_key.size() < 4) | 743 if (next_entry_key.size() < 4) |
747 return BAD_DATA; | 744 return BAD_DATA; |
748 uint16 keyid = DNSSECKeySet::DNSKEYToKeyID(next_entry_key); | 745 uint16 keyid = DNSSECKeySet::DNSKEYToKeyID(next_entry_key); |
749 uint8 algorithm = next_entry_key[3]; | 746 uint8 algorithm = next_entry_key[3]; |
750 | 747 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 base::StringPiece name; | 801 base::StringPiece name; |
805 if (!ReadName(&name)) | 802 if (!ReadName(&name)) |
806 return BAD_DATA; | 803 return BAD_DATA; |
807 | 804 |
808 rrdatas->resize(1); | 805 rrdatas->resize(1); |
809 (*rrdatas)[0] = name; | 806 (*rrdatas)[0] = name; |
810 return OK; | 807 return OK; |
811 } | 808 } |
812 | 809 |
813 } // namespace net | 810 } // namespace net |
OLD | NEW |