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

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

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 | « no previous file | content/child/webcrypto/status.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 #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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 static Status ErrorJwkIncorrectKeyLength(); 104 static Status ErrorJwkIncorrectKeyLength();
105 105
106 // The JWK property |property| is supposed to represent a big-endian unsigned 106 // The JWK property |property| is supposed to represent a big-endian unsigned
107 // integer, however was the empty string. 107 // integer, however was the empty string.
108 static Status ErrorJwkEmptyBigInteger(const std::string& property); 108 static Status ErrorJwkEmptyBigInteger(const std::string& property);
109 109
110 // The big-endian unsigned integer |property| contained leading zeros. This 110 // The big-endian unsigned integer |property| contained leading zeros. This
111 // violates the JWA requirement that such octet strings be minimal. 111 // violates the JWA requirement that such octet strings be minimal.
112 static Status ErrorJwkBigIntegerHasLeadingZero(const std::string& property); 112 static Status ErrorJwkBigIntegerHasLeadingZero(const std::string& property);
113 113
114 // The key_ops lists a usage more than once.
115 static Status ErrorJwkDuplicateKeyOps();
116
114 // ------------------------------------ 117 // ------------------------------------
115 // Other errors 118 // Other errors
116 // ------------------------------------ 119 // ------------------------------------
117 120
118 // No key data was provided when importing an spki, pkcs8, or jwk formatted 121 // No key data was provided when importing an spki, pkcs8, or jwk formatted
119 // key. This does not apply to raw format, since it is possible to have empty 122 // key. This does not apply to raw format, since it is possible to have empty
120 // key data there. 123 // key data there.
121 static Status ErrorImportEmptyKeyData(); 124 static Status ErrorImportEmptyKeyData();
122 125
123 // Tried importing a key using an unsupported format for the key type (for 126 // Tried importing a key using an unsupported format for the key type (for
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 Type type_; 226 Type type_;
224 blink::WebCryptoErrorType error_type_; 227 blink::WebCryptoErrorType error_type_;
225 std::string error_details_; 228 std::string error_details_;
226 }; 229 };
227 230
228 } // namespace webcrypto 231 } // namespace webcrypto
229 232
230 } // namespace content 233 } // namespace content
231 234
232 #endif // CONTENT_CHILD_WEBCRYPTO_STATUS_H_ 235 #endif // CONTENT_CHILD_WEBCRYPTO_STATUS_H_
OLDNEW
« no previous file with comments | « no previous file | content/child/webcrypto/status.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698