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

Unified Diff: net/base/x509_certificate_openssl.cc

Issue 9950065: Properly parse IPv6 subjectAltNames when USE_OPENSSL is set (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pedantry Created 8 years, 9 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 | « no previous file | net/base/x509_certificate_unittest.cc » ('j') | net/base/x509_certificate_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/x509_certificate_openssl.cc
diff --git a/net/base/x509_certificate_openssl.cc b/net/base/x509_certificate_openssl.cc
index f37c9aacc701db546bf996f21bfc4690b2b173a6..43198dc76c1879660766785bf0a63248732fd537 100644
--- a/net/base/x509_certificate_openssl.cc
+++ b/net/base/x509_certificate_openssl.cc
@@ -20,6 +20,7 @@
#include "base/string_util.h"
#include "crypto/openssl_util.h"
#include "net/base/net_errors.h"
+#include "net/base/net_util.h"
#include "net/base/x509_util_openssl.h"
#if defined(OS_ANDROID)
@@ -123,7 +124,8 @@ void ParseSubjectAltName(X509Certificate::OSCertHandle cert,
if (!ip_addr)
continue;
int ip_addr_len = name->d.iPAddress->length;
- if (ip_addr_len != 4 && ip_addr_len != 8) {
+ if (ip_addr_len != static_cast<int>(kIPv4AddressSize) &&
+ ip_addr_len != static_cast<int>(kIPv6AddressSize)) {
// http://www.ietf.org/rfc/rfc3280.txt requires subjectAltName iPAddress
// to have 4 or 16 bytes, whereas in a name constraint it includes a
// net mask hence 8 or 32 bytes. Logging to help diagnose any mixup.
« no previous file with comments | « no previous file | net/base/x509_certificate_unittest.cc » ('j') | net/base/x509_certificate_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698