| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/cert/x509_cert_types.h" | 5 #include "net/cert/x509_cert_types.h" |
| 6 | 6 |
| 7 #include <cstdlib> | 7 #include <cstdlib> |
| 8 #include <cstring> | 8 #include <cstring> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 exploded.minute = ParseIntAndAdvance(&field, 2, &valid); | 69 exploded.minute = ParseIntAndAdvance(&field, 2, &valid); |
| 70 exploded.second = ParseIntAndAdvance(&field, 2, &valid); | 70 exploded.second = ParseIntAndAdvance(&field, 2, &valid); |
| 71 if (valid && year_length == 2) | 71 if (valid && year_length == 2) |
| 72 exploded.year += exploded.year < 50 ? 2000 : 1900; | 72 exploded.year += exploded.year < 50 ? 2000 : 1900; |
| 73 | 73 |
| 74 valid &= exploded.HasValidValues(); | 74 valid &= exploded.HasValidValues(); |
| 75 | 75 |
| 76 if (!valid) | 76 if (!valid) |
| 77 return false; | 77 return false; |
| 78 | 78 |
| 79 *time = base::Time::FromUTCExploded(exploded); | 79 // FromUTCExploded() can fail even though exploded.HasValidValues() |
| 80 return true; | 80 // returned true. |
| 81 return base::Time::FromUTCExploded(exploded, time); |
| 81 } | 82 } |
| 82 | 83 |
| 83 } // namespace net | 84 } // namespace net |
| OLD | NEW |