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

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

Issue 416993009: [webcrypto] JWK: Reject keys with non-minimal bigintegers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address sleevi comment Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « content/child/webcrypto/shared_crypto_unittest.cc ('k') | 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // The "kty" parameter was given and was a string, however it was not the 96 // The "kty" parameter was given and was a string, however it was not the
97 // expected value. 97 // expected value.
98 static Status ErrorJwkUnexpectedKty(const std::string& expected); 98 static Status ErrorJwkUnexpectedKty(const std::string& expected);
99 99
100 // The amount of key data provided was incompatible with the selected 100 // The amount of key data provided was incompatible with the selected
101 // algorithm. For instance if the algorith name was A128CBC then EXACTLY 101 // algorithm. For instance if the algorith name was A128CBC then EXACTLY
102 // 128-bits of key data must have been provided. If 192-bits of key data were 102 // 128-bits of key data must have been provided. If 192-bits of key data were
103 // given that is an error. 103 // given that is an error.
104 static Status ErrorJwkIncorrectKeyLength(); 104 static Status ErrorJwkIncorrectKeyLength();
105 105
106 // The JWK was for an RSA private key but only partially provided the optional 106 // The JWK property |property| is supposed to represent a big-endian unsigned
107 // parameters (p, q, dq, dq, qi). 107 // integer, however was the empty string.
108 static Status ErrorJwkIncompleteOptionalRsaPrivateKey(); 108 static Status ErrorJwkEmptyBigInteger(const std::string& property);
109
110 // The big-endian unsigned integer |property| contained leading zeros. This
111 // violates the JWA requirement that such octet strings be minimal.
112 static Status ErrorJwkBigIntegerHasLeadingZero(const std::string& property);
109 113
110 // ------------------------------------ 114 // ------------------------------------
111 // Other errors 115 // Other errors
112 // ------------------------------------ 116 // ------------------------------------
113 117
114 // No key data was provided when importing an spki, pkcs8, or jwk formatted 118 // No key data was provided when importing an spki, pkcs8, or jwk formatted
115 // key. This does not apply to raw format, since it is possible to have empty 119 // key. This does not apply to raw format, since it is possible to have empty
116 // key data there. 120 // key data there.
117 static Status ErrorImportEmptyKeyData(); 121 static Status ErrorImportEmptyKeyData();
118 122
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 Type type_; 211 Type type_;
208 blink::WebCryptoErrorType error_type_; 212 blink::WebCryptoErrorType error_type_;
209 std::string error_details_; 213 std::string error_details_;
210 }; 214 };
211 215
212 } // namespace webcrypto 216 } // namespace webcrypto
213 217
214 } // namespace content 218 } // namespace content
215 219
216 #endif // CONTENT_CHILD_WEBCRYPTO_STATUS_H_ 220 #endif // CONTENT_CHILD_WEBCRYPTO_STATUS_H_
OLDNEW
« no previous file with comments | « content/child/webcrypto/shared_crypto_unittest.cc ('k') | content/child/webcrypto/status.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698