| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ct_log_verifier.h" | 5 #include "net/cert/ct_log_verifier.h" |
| 6 | 6 |
| 7 #include <openssl/evp.h> | 7 #include <openssl/evp.h> |
| 8 #include <openssl/x509.h> | 8 #include <openssl/x509.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "crypto/openssl_util.h" | 11 #include "crypto/openssl_util.h" |
| 12 #include "crypto/sha2.h" | 12 #include "crypto/sha2.h" |
| 13 #include "net/cert/signed_tree_head.h" |
| 13 | 14 |
| 14 namespace net { | 15 namespace net { |
| 15 | 16 |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| 18 const EVP_MD* GetEvpAlg(ct::DigitallySigned::HashAlgorithm alg) { | 19 const EVP_MD* GetEvpAlg(ct::DigitallySigned::HashAlgorithm alg) { |
| 19 switch (alg) { | 20 switch (alg) { |
| 20 case ct::DigitallySigned::HASH_ALGO_MD5: | 21 case ct::DigitallySigned::HASH_ALGO_MD5: |
| 21 return EVP_md5(); | 22 return EVP_md5(); |
| 22 case ct::DigitallySigned::HASH_ALGO_SHA1: | 23 case ct::DigitallySigned::HASH_ALGO_SHA1: |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 1 == EVP_DigestVerifyFinal( | 112 1 == EVP_DigestVerifyFinal( |
| 112 &ctx, | 113 &ctx, |
| 113 reinterpret_cast<unsigned char*>(const_cast<char*>(signature.data())), | 114 reinterpret_cast<unsigned char*>(const_cast<char*>(signature.data())), |
| 114 signature.size())); | 115 signature.size())); |
| 115 | 116 |
| 116 EVP_MD_CTX_cleanup(&ctx); | 117 EVP_MD_CTX_cleanup(&ctx); |
| 117 return ok; | 118 return ok; |
| 118 } | 119 } |
| 119 | 120 |
| 120 } // namespace net | 121 } // namespace net |
| OLD | NEW |