OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/sha1.h" | 7 #include "base/sha1.h" |
8 #include "crypto/sha2.h" | 8 #include "crypto/sha2.h" |
9 #include "net/cert/internal/cert_errors.h" | 9 #include "net/cert/internal/cert_errors.h" |
10 #include "net/cert/internal/parse_ocsp.h" | 10 #include "net/cert/internal/parse_ocsp.h" |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 if (!outer_parser.ReadSequence(&parser)) | 317 if (!outer_parser.ReadSequence(&parser)) |
318 return false; | 318 return false; |
319 if (outer_parser.HasMore()) | 319 if (outer_parser.HasMore()) |
320 return false; | 320 return false; |
321 | 321 |
322 if (!parser.ReadRawTLV(&(out->data))) | 322 if (!parser.ReadRawTLV(&(out->data))) |
323 return false; | 323 return false; |
324 der::Input sigalg_tlv; | 324 der::Input sigalg_tlv; |
325 if (!parser.ReadRawTLV(&sigalg_tlv)) | 325 if (!parser.ReadRawTLV(&sigalg_tlv)) |
326 return false; | 326 return false; |
327 out->signature_algorithm = SignatureAlgorithm::CreateFromDer(sigalg_tlv); | 327 // TODO(crbug.com/634443): Propagate the errors. |
| 328 net::CertErrors errors; |
| 329 out->signature_algorithm = SignatureAlgorithm::Create(sigalg_tlv, &errors); |
328 if (!out->signature_algorithm) | 330 if (!out->signature_algorithm) |
329 return false; | 331 return false; |
330 if (!parser.ReadBitString(&(out->signature))) | 332 if (!parser.ReadBitString(&(out->signature))) |
331 return false; | 333 return false; |
332 der::Input certs_input; | 334 der::Input certs_input; |
333 if (!parser.ReadOptionalTag(der::ContextSpecificConstructed(0), &certs_input, | 335 if (!parser.ReadOptionalTag(der::ContextSpecificConstructed(0), &certs_input, |
334 &(out->has_certs))) { | 336 &(out->has_certs))) { |
335 return false; | 337 return false; |
336 } | 338 } |
337 | 339 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 &earliest_this_update)) { | 554 &earliest_this_update)) { |
553 return false; | 555 return false; |
554 } | 556 } |
555 if (response.this_update < earliest_this_update) | 557 if (response.this_update < earliest_this_update) |
556 return false; // Response is too old. | 558 return false; // Response is too old. |
557 | 559 |
558 return true; | 560 return true; |
559 } | 561 } |
560 | 562 |
561 } // namespace net | 563 } // namespace net |
OLD | NEW |