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_keyset.h" | 5 #include "net/base/dnssec_keyset.h" |
6 | 6 |
7 #include <cryptohi.h> | 7 #include <cryptohi.h> |
8 #include <cryptoht.h> | 8 #include <cryptoht.h> |
9 #include <keyhi.h> | 9 #include <keyhi.h> |
10 | 10 |
11 #include "base/crypto/signature_verifier.h" | 11 #include "base/crypto/signature_verifier.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/nss_util.h" | 13 #include "base/nss_util.h" |
14 #include "base/scoped_ptr.h" | 14 #include "base/scoped_ptr.h" |
15 #include "base/time.h" | 15 #include "base/time.h" |
16 #include "net/base/dns_util.h" | 16 #include "net/base/dns_util.h" |
17 | 17 |
18 namespace net { | 18 namespace net { |
19 | 19 |
20 DNSSECKeySet::DNSSECKeySet() | 20 DNSSECKeySet::DNSSECKeySet() |
21 : ignore_timestamps_(false) { | 21 : ignore_timestamps_(false) { |
22 } | 22 } |
23 | 23 |
| 24 DNSSECKeySet::~DNSSECKeySet() { |
| 25 } |
| 26 |
24 bool DNSSECKeySet::AddKey(const base::StringPiece& dnskey) { | 27 bool DNSSECKeySet::AddKey(const base::StringPiece& dnskey) { |
25 uint16 keyid = DNSKEYToKeyID(dnskey); | 28 uint16 keyid = DNSKEYToKeyID(dnskey); |
26 std::string der_encoded = ASN1WrapDNSKEY(dnskey); | 29 std::string der_encoded = ASN1WrapDNSKEY(dnskey); |
27 if (der_encoded.empty()) | 30 if (der_encoded.empty()) |
28 return false; | 31 return false; |
29 | 32 |
30 keyids_.push_back(keyid); | 33 keyids_.push_back(keyid); |
31 public_keys_.push_back(der_encoded); | 34 public_keys_.push_back(der_encoded); |
32 return true; | 35 return true; |
33 } | 36 } |
(...skipping 411 matching lines...) Loading... |
445 NOTREACHED(); | 448 NOTREACHED(); |
446 return false; | 449 return false; |
447 } | 450 } |
448 rv = VFY_End(vfy_context); | 451 rv = VFY_End(vfy_context); |
449 VFY_DestroyContext(vfy_context, PR_TRUE); | 452 VFY_DestroyContext(vfy_context, PR_TRUE); |
450 | 453 |
451 return rv == SECSuccess; | 454 return rv == SECSuccess; |
452 } | 455 } |
453 | 456 |
454 } // namespace net | 457 } // namespace net |
OLD | NEW |