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 ""; |
} |