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

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

Issue 668313002: Reject JWK key import when key_ops contains duplicate values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove heap-allocated std::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
« no previous file with comments | « content/child/webcrypto/status.h ('k') | content/child/webcrypto/test/aes_cbc_unittest.cc » ('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 "content/child/webcrypto/status.h" 5 #include "content/child/webcrypto/status.h"
6 6
7 namespace content { 7 namespace content {
8 8
9 namespace webcrypto { 9 namespace webcrypto {
10 10
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 return Status(blink::WebCryptoErrorTypeData, 109 return Status(blink::WebCryptoErrorTypeData,
110 "The JWK \"" + property + "\" property was empty."); 110 "The JWK \"" + property + "\" property was empty.");
111 } 111 }
112 112
113 Status Status::ErrorJwkBigIntegerHasLeadingZero(const std::string& property) { 113 Status Status::ErrorJwkBigIntegerHasLeadingZero(const std::string& property) {
114 return Status( 114 return Status(
115 blink::WebCryptoErrorTypeData, 115 blink::WebCryptoErrorTypeData,
116 "The JWK \"" + property + "\" property contained a leading zero."); 116 "The JWK \"" + property + "\" property contained a leading zero.");
117 } 117 }
118 118
119 Status Status::ErrorJwkDuplicateKeyOps() {
120 return Status(blink::WebCryptoErrorTypeData,
121 "The \"key_ops\" property of the JWK dictionary contains "
122 "duplicate usages.");
123 }
124
119 Status Status::ErrorImportEmptyKeyData() { 125 Status Status::ErrorImportEmptyKeyData() {
120 return Status(blink::WebCryptoErrorTypeData, "No key data was provided"); 126 return Status(blink::WebCryptoErrorTypeData, "No key data was provided");
121 } 127 }
122 128
123 Status Status::ErrorUnsupportedImportKeyFormat() { 129 Status Status::ErrorUnsupportedImportKeyFormat() {
124 return Status(blink::WebCryptoErrorTypeNotSupported, 130 return Status(blink::WebCryptoErrorTypeNotSupported,
125 "Unsupported import key format for algorithm"); 131 "Unsupported import key format for algorithm");
126 } 132 }
127 133
128 Status Status::ErrorUnsupportedExportKeyFormat() { 134 Status Status::ErrorUnsupportedExportKeyFormat() {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 error_type_(error_type), 249 error_type_(error_type),
244 error_details_(error_details_utf8) { 250 error_details_(error_details_utf8) {
245 } 251 }
246 252
247 Status::Status(Type type) : type_(type) { 253 Status::Status(Type type) : type_(type) {
248 } 254 }
249 255
250 } // namespace webcrypto 256 } // namespace webcrypto
251 257
252 } // namespace content 258 } // namespace content
OLDNEW
« no previous file with comments | « content/child/webcrypto/status.h ('k') | content/child/webcrypto/test/aes_cbc_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698