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

Unified Diff: chrome/common/net/x509_certificate_model_nss.cc

Issue 10391197: If the version field is omitted from the certificate, the default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/net/x509_certificate_model_nss.cc
===================================================================
--- chrome/common/net/x509_certificate_model_nss.cc (revision 137201)
+++ chrome/common/net/x509_certificate_model_nss.cc (working copy)
@@ -125,10 +125,13 @@
}
string GetVersion(X509Certificate::OSCertHandle cert_handle) {
- unsigned long version = ULONG_MAX;
- if (SEC_ASN1DecodeInteger(&cert_handle->version, &version) == SECSuccess &&
- version != ULONG_MAX)
wtc 2012/05/18 01:15:57 I guess the version != ULONG_MAX check here is to
mattm 2012/05/18 03:19:50 Honestly I can't remember why it's that way, but t
wtc 2012/05/18 21:47:13 In my testing with several recent versions of NSS,
+ // If the version field is omitted from the certificate, the default
+ // value is v1(0).
+ unsigned long version = 0;
+ if (cert_handle->version.len == 0 ||
+ SEC_ASN1DecodeInteger(&cert_handle->version, &version) == SECSuccess) {
return base::UintToString(version + 1);
+ }
return "";
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698