| 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 <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "crypto/cssm_init.h" | 10 #include "crypto/cssm_init.h" |
| 11 | 11 |
| 12 namespace crypto { | 12 namespace crypto { |
| 13 | 13 |
| 14 SignatureVerifier::SignatureVerifier() : sig_handle_(0) { | 14 SignatureVerifier::SignatureVerifier() : sig_handle_(0) { |
| 15 memset(&public_key_, 0, sizeof(public_key_)); |
| 15 EnsureCSSMInit(); | 16 EnsureCSSMInit(); |
| 16 } | 17 } |
| 17 | 18 |
| 18 SignatureVerifier::~SignatureVerifier() { | 19 SignatureVerifier::~SignatureVerifier() { |
| 19 Reset(); | 20 Reset(); |
| 20 } | 21 } |
| 21 | 22 |
| 22 bool SignatureVerifier::VerifyInit(const uint8* signature_algorithm, | 23 bool SignatureVerifier::VerifyInit(const uint8* signature_algorithm, |
| 23 int signature_algorithm_len, | 24 int signature_algorithm_len, |
| 24 const uint8* signature, | 25 const uint8* signature, |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 sig_handle_ = 0; | 97 sig_handle_ = 0; |
| 97 } | 98 } |
| 98 signature_.clear(); | 99 signature_.clear(); |
| 99 | 100 |
| 100 // Can't call CSSM_FreeKey on public_key_ because we constructed | 101 // Can't call CSSM_FreeKey on public_key_ because we constructed |
| 101 // public_key_ manually. | 102 // public_key_ manually. |
| 102 } | 103 } |
| 103 | 104 |
| 104 } // namespace crypto | 105 } // namespace crypto |
| 105 | 106 |
| OLD | NEW |