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

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

Issue 2040513003: Implement Expect-Staple (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move OCSP into cert_verify_proc 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
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 ConvertBaseTime(const base::Time::Exploded& exploded) {
svaldez 2016/06/23 14:03:15 Is this called from anywhere other than here? Migh
387 der::GeneralizedTime result;
388 result.year = exploded.year;
389 result.month = exploded.month;
390 result.day = exploded.day_of_month;
391 result.hours = exploded.hour;
392 result.minutes = exploded.minute;
393 result.seconds = exploded.second;
394 return result;
395 }
396
397 der::GeneralizedTime ConvertBaseUTCTime(const base::Time& time) {
398 base::Time::Exploded exploded;
399 time.UTCExplode(&exploded);
400 return ConvertBaseTime(exploded);
401 }
402
386 } // namespace der 403 } // namespace der
387 404
388 } // namespace net 405 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698