| OLD | NEW |
| 1 // Copyright (c) 2009 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 "base/crypto/signature_verifier.h" | 5 #include "base/crypto/signature_verifier.h" |
| 6 | 6 |
| 7 #include <cryptohi.h> | 7 #include <cryptohi.h> |
| 8 #include <keyhi.h> | 8 #include <keyhi.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/nss_util.h" | 12 #include "base/nss_util.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace crypto { |
| 15 | 15 |
| 16 SignatureVerifier::SignatureVerifier() : vfy_context_(NULL) { | 16 SignatureVerifier::SignatureVerifier() : vfy_context_(NULL) { |
| 17 EnsureNSSInit(); | 17 EnsureNSSInit(); |
| 18 } | 18 } |
| 19 | 19 |
| 20 SignatureVerifier::~SignatureVerifier() { | 20 SignatureVerifier::~SignatureVerifier() { |
| 21 Reset(); | 21 Reset(); |
| 22 } | 22 } |
| 23 | 23 |
| 24 bool SignatureVerifier::VerifyInit(const uint8* signature_algorithm, | 24 bool SignatureVerifier::VerifyInit(const uint8* signature_algorithm, |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 } | 103 } |
| 104 | 104 |
| 105 void SignatureVerifier::Reset() { | 105 void SignatureVerifier::Reset() { |
| 106 if (vfy_context_) { | 106 if (vfy_context_) { |
| 107 VFY_DestroyContext(vfy_context_, PR_TRUE); | 107 VFY_DestroyContext(vfy_context_, PR_TRUE); |
| 108 vfy_context_ = NULL; | 108 vfy_context_ = NULL; |
| 109 } | 109 } |
| 110 signature_.clear(); | 110 signature_.clear(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 } // namespace base | 113 } // namespace crypto |
| OLD | NEW |