| 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)
|
| + // 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 "";
|
| }
|
|
|
|
|