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

Side by Side Diff: content/child/webcrypto/nss/rsa_oaep_nss.cc

Issue 670773003: Cleanup: rename usage_mask --> usages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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
« no previous file with comments | « content/child/webcrypto/nss/rsa_key_nss.cc ('k') | content/child/webcrypto/nss/sym_key_nss.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <cryptohi.h> 5 #include <cryptohi.h>
6 #include <keyhi.h> 6 #include <keyhi.h>
7 #include <pk11pub.h> 7 #include <pk11pub.h>
8 #include <secerr.h> 8 #include <secerr.h>
9 #include <sechash.h> 9 #include <sechash.h>
10 10
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 public: 163 public:
164 RsaOaepImplementation() 164 RsaOaepImplementation()
165 : RsaHashedAlgorithm( 165 : RsaHashedAlgorithm(
166 CKF_ENCRYPT | CKF_DECRYPT | CKF_WRAP | CKF_UNWRAP, 166 CKF_ENCRYPT | CKF_DECRYPT | CKF_WRAP | CKF_UNWRAP,
167 blink::WebCryptoKeyUsageEncrypt | blink::WebCryptoKeyUsageWrapKey, 167 blink::WebCryptoKeyUsageEncrypt | blink::WebCryptoKeyUsageWrapKey,
168 blink::WebCryptoKeyUsageDecrypt | 168 blink::WebCryptoKeyUsageDecrypt |
169 blink::WebCryptoKeyUsageUnwrapKey) {} 169 blink::WebCryptoKeyUsageUnwrapKey) {}
170 170
171 virtual Status GenerateKey(const blink::WebCryptoAlgorithm& algorithm, 171 virtual Status GenerateKey(const blink::WebCryptoAlgorithm& algorithm,
172 bool extractable, 172 bool extractable,
173 blink::WebCryptoKeyUsageMask usage_mask, 173 blink::WebCryptoKeyUsageMask usages,
174 GenerateKeyResult* result) const override { 174 GenerateKeyResult* result) const override {
175 Status status = NssSupportsRsaOaep(); 175 Status status = NssSupportsRsaOaep();
176 if (status.IsError()) 176 if (status.IsError())
177 return status; 177 return status;
178 return RsaHashedAlgorithm::GenerateKey( 178 return RsaHashedAlgorithm::GenerateKey(
179 algorithm, extractable, usage_mask, result); 179 algorithm, extractable, usages, result);
180 } 180 }
181 181
182 virtual Status VerifyKeyUsagesBeforeImportKey( 182 virtual Status VerifyKeyUsagesBeforeImportKey(
183 blink::WebCryptoKeyFormat format, 183 blink::WebCryptoKeyFormat format,
184 blink::WebCryptoKeyUsageMask usage_mask) const override { 184 blink::WebCryptoKeyUsageMask usages) const override {
185 Status status = NssSupportsRsaOaep(); 185 Status status = NssSupportsRsaOaep();
186 if (status.IsError()) 186 if (status.IsError())
187 return status; 187 return status;
188 return RsaHashedAlgorithm::VerifyKeyUsagesBeforeImportKey(format, 188 return RsaHashedAlgorithm::VerifyKeyUsagesBeforeImportKey(format, usages);
189 usage_mask);
190 } 189 }
191 190
192 virtual const char* GetJwkAlgorithm( 191 virtual const char* GetJwkAlgorithm(
193 const blink::WebCryptoAlgorithmId hash) const override { 192 const blink::WebCryptoAlgorithmId hash) const override {
194 switch (hash) { 193 switch (hash) {
195 case blink::WebCryptoAlgorithmIdSha1: 194 case blink::WebCryptoAlgorithmIdSha1:
196 return "RSA-OAEP"; 195 return "RSA-OAEP";
197 case blink::WebCryptoAlgorithmIdSha256: 196 case blink::WebCryptoAlgorithmIdSha256:
198 return "RSA-OAEP-256"; 197 return "RSA-OAEP-256";
199 case blink::WebCryptoAlgorithmIdSha384: 198 case blink::WebCryptoAlgorithmIdSha384:
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 237
239 } // namespace 238 } // namespace
240 239
241 AlgorithmImplementation* CreatePlatformRsaOaepImplementation() { 240 AlgorithmImplementation* CreatePlatformRsaOaepImplementation() {
242 return new RsaOaepImplementation; 241 return new RsaOaepImplementation;
243 } 242 }
244 243
245 } // namespace webcrypto 244 } // namespace webcrypto
246 245
247 } // namespace content 246 } // namespace content
OLDNEW
« no previous file with comments | « content/child/webcrypto/nss/rsa_key_nss.cc ('k') | content/child/webcrypto/nss/sym_key_nss.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698