OLD | NEW |
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 "components/webcrypto/algorithms/rsa.h" | 5 #include "components/webcrypto/algorithms/rsa.h" |
6 | 6 |
7 #include <openssl/bn.h> | |
8 #include <openssl/evp.h> | |
9 #include <openssl/rsa.h> | |
10 #include <utility> | 7 #include <utility> |
11 | 8 |
12 #include "base/logging.h" | 9 #include "base/logging.h" |
13 #include "components/webcrypto/algorithms/asymmetric_key_util.h" | 10 #include "components/webcrypto/algorithms/asymmetric_key_util.h" |
14 #include "components/webcrypto/algorithms/util.h" | 11 #include "components/webcrypto/algorithms/util.h" |
15 #include "components/webcrypto/blink_key_handle.h" | 12 #include "components/webcrypto/blink_key_handle.h" |
16 #include "components/webcrypto/crypto_data.h" | 13 #include "components/webcrypto/crypto_data.h" |
17 #include "components/webcrypto/generate_key_result.h" | 14 #include "components/webcrypto/generate_key_result.h" |
18 #include "components/webcrypto/jwk.h" | 15 #include "components/webcrypto/jwk.h" |
19 #include "components/webcrypto/status.h" | 16 #include "components/webcrypto/status.h" |
20 #include "crypto/openssl_util.h" | 17 #include "crypto/openssl_util.h" |
21 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" | 18 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" |
22 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" | 19 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" |
| 20 #include "third_party/boringssl/src/include/openssl/bn.h" |
| 21 #include "third_party/boringssl/src/include/openssl/evp.h" |
| 22 #include "third_party/boringssl/src/include/openssl/rsa.h" |
23 | 23 |
24 namespace webcrypto { | 24 namespace webcrypto { |
25 | 25 |
26 namespace { | 26 namespace { |
27 | 27 |
28 // Describes the RSA components for a parsed key. The names of the properties | 28 // Describes the RSA components for a parsed key. The names of the properties |
29 // correspond with those from the JWK spec. Note that Chromium's WebCrypto | 29 // correspond with those from the JWK spec. Note that Chromium's WebCrypto |
30 // implementation does not support multi-primes, so there is no parsed field | 30 // implementation does not support multi-primes, so there is no parsed field |
31 // for "oth". | 31 // for "oth". |
32 struct JwkRsaInfo { | 32 struct JwkRsaInfo { |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 memcmp(algorithm.rsaHashedParams()->publicExponent().data(), | 573 memcmp(algorithm.rsaHashedParams()->publicExponent().data(), |
574 key->algorithm().rsaHashedParams()->publicExponent().data(), | 574 key->algorithm().rsaHashedParams()->publicExponent().data(), |
575 key->algorithm().rsaHashedParams()->publicExponent().size())) { | 575 key->algorithm().rsaHashedParams()->publicExponent().size())) { |
576 return Status::ErrorUnexpected(); | 576 return Status::ErrorUnexpected(); |
577 } | 577 } |
578 | 578 |
579 return Status::Success(); | 579 return Status::Success(); |
580 } | 580 } |
581 | 581 |
582 } // namespace webcrypto | 582 } // namespace webcrypto |
OLD | NEW |