Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(467)

Side by Side Diff: crypto/hmac_nss.cc

Issue 36593002: crypto/nss_util: Get TPM slot id, do lookup by id instead of by name. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sandbox debugging crap Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/hmac.h" 5 #include "crypto/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/logging.h" 10 #include "base/logging.h"
(...skipping 22 matching lines...) Expand all
33 default: 33 default:
34 NOTREACHED() << "Unsupported hash algorithm"; 34 NOTREACHED() << "Unsupported hash algorithm";
35 break; 35 break;
36 } 36 }
37 } 37 }
38 38
39 HMAC::~HMAC() { 39 HMAC::~HMAC() {
40 } 40 }
41 41
42 bool HMAC::Init(const unsigned char *key, size_t key_length) { 42 bool HMAC::Init(const unsigned char *key, size_t key_length) {
43 LOG(ERROR) << "HIIIIIIIIIIIIIIIIIIIIIIIIIII";
43 EnsureNSSInit(); 44 EnsureNSSInit();
44 45
45 if (plat_->slot_.get()) { 46 if (plat_->slot_.get()) {
46 // Init must not be called more than twice on the same HMAC object. 47 // Init must not be called more than twice on the same HMAC object.
47 NOTREACHED(); 48 NOTREACHED();
48 return false; 49 return false;
49 } 50 }
50 51
51 plat_->slot_.reset(PK11_GetInternalSlot()); 52 plat_->slot_.reset(PK11_GetInternalSlot());
52 if (!plat_->slot_.get()) { 53 if (!plat_->slot_.get()) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 if (PK11_DigestFinal(context.get(), 109 if (PK11_DigestFinal(context.get(),
109 digest, &len, digest_length) != SECSuccess) { 110 digest, &len, digest_length) != SECSuccess) {
110 NOTREACHED(); 111 NOTREACHED();
111 return false; 112 return false;
112 } 113 }
113 114
114 return true; 115 return true;
115 } 116 }
116 117
117 } // namespace crypto 118 } // namespace crypto
OLDNEW
« no previous file with comments | « crypto/encryptor_nss.cc ('k') | crypto/nss_util.h » ('j') | crypto/nss_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698