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

Side by Side Diff: crypto/hmac_nss.cc

Issue 8373022: Fixed slot selection in HMAC class to ensure that we are using softtoken instead of TPM slots. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } 93 }
94 94
95 if (PK11_DigestBegin(context.get()) != SECSuccess) { 95 if (PK11_DigestBegin(context.get()) != SECSuccess) {
96 NOTREACHED(); 96 NOTREACHED();
97 return false; 97 return false;
98 } 98 }
99 99
100 if (PK11_DigestOp(context.get(), 100 if (PK11_DigestOp(context.get(),
101 reinterpret_cast<const unsigned char*>(data.data()), 101 reinterpret_cast<const unsigned char*>(data.data()),
102 data.length()) != SECSuccess) { 102 data.length()) != SECSuccess) {
103 LOG(WARNING) << "PK11_DigestOp failed, error " << PORT_GetError()
104 << ", slot name " << PK11_GetSlotName(plat_->slot_.get())
105 << ", token name " << PK11_GetTokenName(plat_->slot_.get());
106 NOTREACHED(); 103 NOTREACHED();
107 return false; 104 return false;
108 } 105 }
109 106
110 unsigned int len = 0; 107 unsigned int len = 0;
111 if (PK11_DigestFinal(context.get(), 108 if (PK11_DigestFinal(context.get(),
112 digest, &len, digest_length) != SECSuccess) { 109 digest, &len, digest_length) != SECSuccess) {
113 NOTREACHED(); 110 NOTREACHED();
114 return false; 111 return false;
115 } 112 }
116 113
117 return true; 114 return true;
118 } 115 }
119 116
120 } // namespace crypto 117 } // namespace crypto
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698