| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "crypto/signature_verifier.h" | 5 #include "crypto/signature_verifier.h" |
| 6 | 6 |
| 7 #include <cryptohi.h> | 7 #include <cryptohi.h> |
| 8 #include <keyhi.h> | 8 #include <keyhi.h> |
| 9 #include <pk11pub.h> | 9 #include <pk11pub.h> |
| 10 #include <secerr.h> | 10 #include <secerr.h> |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 } // namespace | 60 } // namespace |
| 61 | 61 |
| 62 SignatureVerifier::SignatureVerifier() | 62 SignatureVerifier::SignatureVerifier() |
| 63 : vfy_context_(NULL), | 63 : vfy_context_(NULL), |
| 64 hash_alg_(SHA1), | 64 hash_alg_(SHA1), |
| 65 mask_hash_alg_(SHA1), | 65 mask_hash_alg_(SHA1), |
| 66 salt_len_(0), | 66 salt_len_(0), |
| 67 public_key_(NULL), | 67 public_key_(NULL), |
| 68 hash_context_(NULL) { | 68 hash_context_(NULL) { |
| 69 LOG(ERROR) << "HIIIIIIIIIIIIIIIIIIIIIIIIIII"; |
| 69 EnsureNSSInit(); | 70 EnsureNSSInit(); |
| 70 } | 71 } |
| 71 | 72 |
| 72 SignatureVerifier::~SignatureVerifier() { | 73 SignatureVerifier::~SignatureVerifier() { |
| 73 Reset(); | 74 Reset(); |
| 74 } | 75 } |
| 75 | 76 |
| 76 bool SignatureVerifier::VerifyInit(const uint8* signature_algorithm, | 77 bool SignatureVerifier::VerifyInit(const uint8* signature_algorithm, |
| 77 int signature_algorithm_len, | 78 int signature_algorithm_len, |
| 78 const uint8* signature, | 79 const uint8* signature, |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 hash_context_ = NULL; | 218 hash_context_ = NULL; |
| 218 } | 219 } |
| 219 if (public_key_) { | 220 if (public_key_) { |
| 220 SECKEY_DestroyPublicKey(public_key_); | 221 SECKEY_DestroyPublicKey(public_key_); |
| 221 public_key_ = NULL; | 222 public_key_ = NULL; |
| 222 } | 223 } |
| 223 signature_.clear(); | 224 signature_.clear(); |
| 224 } | 225 } |
| 225 | 226 |
| 226 } // namespace crypto | 227 } // namespace crypto |
| OLD | NEW |