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" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 EVP_MD_CTX ctx; | 106 EVP_MD_CTX ctx; |
107 EVP_MD_CTX_init(&ctx); | 107 EVP_MD_CTX_init(&ctx); |
108 | 108 |
109 bool ok = ( | 109 bool ok = ( |
110 1 == EVP_DigestVerifyInit(&ctx, NULL, hash_alg, NULL, public_key_) && | 110 1 == EVP_DigestVerifyInit(&ctx, NULL, hash_alg, NULL, public_key_) && |
111 1 == EVP_DigestVerifyUpdate( | 111 1 == EVP_DigestVerifyUpdate( |
112 &ctx, data_to_sign.data(), data_to_sign.size()) && | 112 &ctx, data_to_sign.data(), data_to_sign.size()) && |
113 1 == EVP_DigestVerifyFinal( | 113 1 == EVP_DigestVerifyFinal( |
114 &ctx, | 114 &ctx, |
115 reinterpret_cast<unsigned char*>(const_cast<char*>(signature.data())), | 115 reinterpret_cast<const uint8_t*>(signature.data()), |
116 signature.size())); | 116 signature.size())); |
117 | 117 |
118 EVP_MD_CTX_cleanup(&ctx); | 118 EVP_MD_CTX_cleanup(&ctx); |
119 return ok; | 119 return ok; |
120 } | 120 } |
121 | 121 |
122 } // namespace net | 122 } // namespace net |
OLD | NEW |