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

Unified Diff: net/base/dnssec_keyset.cc

Issue 10082010: net: support SHA512 hashes in DNSSEC chains. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/dns_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/dnssec_keyset.cc
diff --git a/net/base/dnssec_keyset.cc b/net/base/dnssec_keyset.cc
index 9d81f9dd3c189ec624afedcb0697fcbdfd1266a0..d3efc708c5d0b7652361694a97f329a7a4fc0134 100644
--- a/net/base/dnssec_keyset.cc
+++ b/net/base/dnssec_keyset.cc
@@ -16,13 +16,25 @@
namespace {
-// These are encoded AlgorithmIdentifiers for the given signature algorithm.
+// These are encoded AlgorithmIdentifiers for the given signature algorithm
+// from RFC 4055.
+
+// 1.2.840.113549.1.1.5
const unsigned char kRSAWithSHA1[] = {
- 0x30, 0xd, 0x6, 0x9, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0xd, 0x1, 0x1, 0x5, 5, 0
+ 0x30, 0xd, 0x6, 0x9, 0x2a, 0x86, 0x48, 0x86,
+ 0xf7, 0xd, 0x1, 0x1, 0x5, 0x5, 0x0,
};
+// 1.2.840.113549.1.1.11
const unsigned char kRSAWithSHA256[] = {
- 0x30, 0xd, 0x6, 0x9, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0xd, 0x1, 0x1, 0xb, 5, 0
+ 0x30, 0xd, 0x6, 0x9, 0x2a, 0x86, 0x48, 0x86,
+ 0xf7, 0xd, 0x1, 0x1, 0xb, 0x5, 0x0,
+};
+
+// 1.2.840.113549.1.1.13
+const unsigned char kRSAWithSHA512[] = {
+ 0x30, 0xd, 0x6, 0x9, 0x2a, 0x86, 0x48, 0x86,
+ 0xf7, 0xd, 0x1, 0x1, 0xd, 0x5, 0x0,
};
} // namespace
@@ -143,6 +155,10 @@ bool DNSSECKeySet::CheckSignature(
signature_algorithm = base::StringPiece(
reinterpret_cast<const char*>(kRSAWithSHA256),
sizeof(kRSAWithSHA256));
+ } else if (algorithm == kDNSSEC_RSA_SHA512) {
+ signature_algorithm = base::StringPiece(
+ reinterpret_cast<const char*>(kRSAWithSHA512),
+ sizeof(kRSAWithSHA512));
} else {
// Unknown algorithm.
return false;
@@ -330,7 +346,8 @@ std::string DNSSECKeySet::ASN1WrapDNSKEY(const base::StringPiece& dnskey) {
const uint8 algorithm = data[3];
if (algorithm != kDNSSEC_RSA_SHA1 &&
algorithm != kDNSSEC_RSA_SHA1_NSEC3 &&
- algorithm != kDNSSEC_RSA_SHA256) {
+ algorithm != kDNSSEC_RSA_SHA256 &&
+ algorithm != kDNSSEC_RSA_SHA512) {
return "";
}
« no previous file with comments | « net/base/dns_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698