| OLD | NEW |
| 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 "net/cert/internal/verify_signed_data.h" | 5 #include "net/cert/internal/verify_signed_data.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "net/der/parse_values.h" | 8 #include "net/der/parse_values.h" |
| 9 | 9 |
| 10 // TODO(eroman): There is no intention to implement this for non-OpenSSL. Remove | |
| 11 // this branch once the migration is complete. This could have been done as a | |
| 12 // conditional file (_openssl.cc) in the build file instead, but that is likely | |
| 13 // not worth the effort at this point. | |
| 14 | |
| 15 #if !defined(USE_OPENSSL) | |
| 16 | |
| 17 namespace net { | |
| 18 | |
| 19 bool VerifySignedData(const SignatureAlgorithm& signature_algorithm, | |
| 20 const der::Input& signed_data, | |
| 21 const der::BitString& signature_value, | |
| 22 const der::Input& public_key, | |
| 23 const SignaturePolicy* policy) { | |
| 24 NOTIMPLEMENTED(); | |
| 25 return false; | |
| 26 } | |
| 27 | |
| 28 } // namespace net | |
| 29 | |
| 30 #else | |
| 31 | |
| 32 #include <openssl/bytestring.h> | 10 #include <openssl/bytestring.h> |
| 33 #include <openssl/digest.h> | 11 #include <openssl/digest.h> |
| 34 #include <openssl/ec.h> | 12 #include <openssl/ec.h> |
| 35 #include <openssl/ec_key.h> | 13 #include <openssl/ec_key.h> |
| 36 #include <openssl/evp.h> | 14 #include <openssl/evp.h> |
| 37 #include <openssl/rsa.h> | 15 #include <openssl/rsa.h> |
| 38 | 16 |
| 39 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
| 40 #include "crypto/openssl_util.h" | 18 #include "crypto/openssl_util.h" |
| 41 #include "crypto/scoped_openssl_types.h" | 19 #include "crypto/scoped_openssl_types.h" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 if (!ParseEcKeyFromSpki(public_key_spki, &public_key, policy)) | 283 if (!ParseEcKeyFromSpki(public_key_spki, &public_key, policy)) |
| 306 return false; | 284 return false; |
| 307 break; | 285 break; |
| 308 } | 286 } |
| 309 | 287 |
| 310 return DoVerify(signature_algorithm, signed_data, signature_value, | 288 return DoVerify(signature_algorithm, signed_data, signature_value, |
| 311 public_key.get()); | 289 public_key.get()); |
| 312 } | 290 } |
| 313 | 291 |
| 314 } // namespace net | 292 } // namespace net |
| 315 | |
| 316 #endif | |
| OLD | NEW |