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

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

Issue 745443002: Check that usage isn't empty when generateKey() is called (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
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_STATUS_H_ 5 #ifndef CONTENT_CHILD_WEBCRYPTO_STATUS_H_
6 #define CONTENT_CHILD_WEBCRYPTO_STATUS_H_ 6 #define CONTENT_CHILD_WEBCRYPTO_STATUS_H_
7 7
8 #include <string> 8 #include <string>
9 #include "content/common/content_export.h" 9 #include "content/common/content_export.h"
10 #include "third_party/WebKit/public/platform/WebCrypto.h" 10 #include "third_party/WebKit/public/platform/WebCrypto.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 207
208 // The key length specified when generating a key was invalid. Either it was 208 // The key length specified when generating a key was invalid. Either it was
209 // zero, or it was not a multiple of 8 bits. 209 // zero, or it was not a multiple of 8 bits.
210 static Status ErrorGenerateKeyLength(); 210 static Status ErrorGenerateKeyLength();
211 211
212 // Attempted to create a key (either by importKey(), generateKey(), or 212 // Attempted to create a key (either by importKey(), generateKey(), or
213 // unwrapKey()) however the key usages were not applicable for the key type 213 // unwrapKey()) however the key usages were not applicable for the key type
214 // and algorithm. 214 // and algorithm.
215 static Status ErrorCreateKeyBadUsages(); 215 static Status ErrorCreateKeyBadUsages();
216 216
217 // No usages were specified when creating a key.
eroman 2014/11/21 23:35:34 nit: "when creating a private or secret key" (sinc
nharper 2014/11/22 00:26:45 Done.
218 static Status ErrorCreateKeyEmptyUsages();
219
217 // An EC key imported using SPKI/PKCS8 format had the wrong curve specified in 220 // An EC key imported using SPKI/PKCS8 format had the wrong curve specified in
218 // the key. 221 // the key.
219 static Status ErrorImportedEcKeyIncorrectCurve(); 222 static Status ErrorImportedEcKeyIncorrectCurve();
220 223
221 // The "crv" member for a JWK did not match the expectations from importKey() 224 // The "crv" member for a JWK did not match the expectations from importKey()
222 static Status ErrorJwkIncorrectCrv(); 225 static Status ErrorJwkIncorrectCrv();
223 226
224 // The EC key failed validation (coordinates don't lie on curve, out of range, 227 // The EC key failed validation (coordinates don't lie on curve, out of range,
225 // etc.) 228 // etc.)
226 static Status ErrorEcKeyInvalid(); 229 static Status ErrorEcKeyInvalid();
(...skipping 17 matching lines...) Expand all
244 Type type_; 247 Type type_;
245 blink::WebCryptoErrorType error_type_; 248 blink::WebCryptoErrorType error_type_;
246 std::string error_details_; 249 std::string error_details_;
247 }; 250 };
248 251
249 } // namespace webcrypto 252 } // namespace webcrypto
250 253
251 } // namespace content 254 } // namespace content
252 255
253 #endif // CONTENT_CHILD_WEBCRYPTO_STATUS_H_ 256 #endif // CONTENT_CHILD_WEBCRYPTO_STATUS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698