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

Side by Side Diff: content/child/webcrypto/webcrypto_util.h

Issue 777403004: [WebCrypto] Throw syntaxError if keyUsage is empty in ImportKey (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved import key empty usage to CheckKeyCreationUsages Created 6 years 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
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 #ifndef CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ 5 #ifndef CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_
6 #define CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ 6 #define CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string> 9 #include <string>
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 Status GetAesKeyGenLengthInBits(const blink::WebCryptoAesKeyGenParams* params, 62 Status GetAesKeyGenLengthInBits(const blink::WebCryptoAesKeyGenParams* params,
63 unsigned int* keylen_bits); 63 unsigned int* keylen_bits);
64 64
65 Status GetHmacKeyGenLengthInBits(const blink::WebCryptoHmacKeyGenParams* params, 65 Status GetHmacKeyGenLengthInBits(const blink::WebCryptoHmacKeyGenParams* params,
66 unsigned int* keylen_bits); 66 unsigned int* keylen_bits);
67 67
68 Status VerifyAesKeyLengthForImport(unsigned int keylen_bytes); 68 Status VerifyAesKeyLengthForImport(unsigned int keylen_bytes);
69 69
70 Status CheckKeyCreationUsages(blink::WebCryptoKeyUsageMask all_possible_usages, 70 Status CheckKeyCreationUsages(blink::WebCryptoKeyUsageMask all_possible_usages,
71 blink::WebCryptoKeyUsageMask actual_usages); 71 blink::WebCryptoKeyUsageMask actual_usages,
72 bool checkImportKeyEmptyUsage = false);
eroman 2014/12/09 17:42:55 The style forbids default parameters, and also thi
72 73
73 // Extracts the public exponent and modulus length from the Blink parameters. 74 // Extracts the public exponent and modulus length from the Blink parameters.
74 // On success it is guaranteed that: 75 // On success it is guaranteed that:
75 // * public_exponent is either 3 or 65537 76 // * public_exponent is either 3 or 65537
76 // * modulus_length_bits is a multiple of 8 77 // * modulus_length_bits is a multiple of 8
77 // * modulus_length is >= 256 78 // * modulus_length is >= 256
78 // * modulus_length is <= 16K 79 // * modulus_length is <= 16K
79 Status GetRsaKeyGenParameters( 80 Status GetRsaKeyGenParameters(
80 const blink::WebCryptoRsaHashedKeyGenParams* params, 81 const blink::WebCryptoRsaHashedKeyGenParams* params,
81 unsigned int* public_exponent, 82 unsigned int* public_exponent,
82 unsigned int* modulus_length_bits); 83 unsigned int* modulus_length_bits);
83 84
84 } // namespace webcrypto 85 } // namespace webcrypto
85 86
86 } // namespace content 87 } // namespace content
87 88
88 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_ 89 #endif // CONTENT_CHILD_WEBCRYPTO_WEBCRYPTO_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698