| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/hmac.h" | 5 #include "base/hmac.h" |
| 6 | 6 |
| 7 #include <nss.h> | 7 #include <nss.h> |
| 8 #include <pk11pub.h> | 8 #include <pk11pub.h> |
| 9 | 9 |
| 10 #include "base/crypto/scoped_nss_types.h" | 10 #include "base/crypto/scoped_nss_types.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/nss_util.h" | 13 #include "base/nss_util.h" |
| 13 #include "base/scoped_ptr.h" | |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 | 16 |
| 17 struct HMACPlatformData { | 17 struct HMACPlatformData { |
| 18 CK_MECHANISM_TYPE mechanism_; | 18 CK_MECHANISM_TYPE mechanism_; |
| 19 ScopedPK11Slot slot_; | 19 ScopedPK11Slot slot_; |
| 20 ScopedPK11SymKey sym_key_; | 20 ScopedPK11SymKey sym_key_; |
| 21 }; | 21 }; |
| 22 | 22 |
| 23 HMAC::HMAC(HashAlgorithm hash_alg) | 23 HMAC::HMAC(HashAlgorithm hash_alg) |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 if (PK11_DigestFinal(context.get(), | 108 if (PK11_DigestFinal(context.get(), |
| 109 digest, &len, digest_length) != SECSuccess) { | 109 digest, &len, digest_length) != SECSuccess) { |
| 110 NOTREACHED(); | 110 NOTREACHED(); |
| 111 return false; | 111 return false; |
| 112 } | 112 } |
| 113 | 113 |
| 114 return true; | 114 return true; |
| 115 } | 115 } |
| 116 | 116 |
| 117 } // namespace base | 117 } // namespace base |
| OLD | NEW |