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

Side by Side Diff: net/der/parse_values.cc

Issue 2091103002: Add CheckOCSPDateValid() to net/cert/internal (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« net/der/parse_values.h ('K') | « net/der/parse_values.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <tuple> 5 #include <tuple>
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/numerics/safe_math.h" 8 #include "base/numerics/safe_math.h"
9 #include "net/der/parse_values.h" 9 #include "net/der/parse_values.h"
10 10
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 } 376 }
377 uint8_t zulu; 377 uint8_t zulu;
378 if (!reader.ReadByte(&zulu) || zulu != 'Z' || reader.HasMore()) 378 if (!reader.ReadByte(&zulu) || zulu != 'Z' || reader.HasMore())
379 return false; 379 return false;
380 if (!ValidateGeneralizedTime(time)) 380 if (!ValidateGeneralizedTime(time))
381 return false; 381 return false;
382 *value = time; 382 *value = time;
383 return true; 383 return true;
384 } 384 }
385 385
386 der::GeneralizedTime ConvertBaseUTCTime(const base::Time& time) {
svaldez 2016/06/24 13:40:46 Might need a basic unittest.
387 base::Time::Exploded exploded;
388 time.UTCExplode(&exploded);
389
390 der::GeneralizedTime result;
391 result.year = exploded.year;
392 result.month = exploded.month;
393 result.day = exploded.day_of_month;
394 result.hours = exploded.hour;
395 result.minutes = exploded.minute;
396 result.seconds = exploded.second;
397 return result;
398 }
399
386 } // namespace der 400 } // namespace der
387 401
388 } // namespace net 402 } // namespace net
OLDNEW
« net/der/parse_values.h ('K') | « net/der/parse_values.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698