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 <secerr.h> | 5 #include <secerr.h> |
6 | 6 |
7 #include "base/numerics/safe_math.h" | 7 #include "base/numerics/safe_math.h" |
8 #include "content/child/webcrypto/crypto_data.h" | 8 #include "components/webcrypto/crypto_data.h" |
9 #include "content/child/webcrypto/nss/aes_algorithm_nss.h" | 9 #include "components/webcrypto/nss/aes_algorithm_nss.h" |
10 #include "content/child/webcrypto/nss/key_nss.h" | 10 #include "components/webcrypto/nss/key_nss.h" |
11 #include "content/child/webcrypto/nss/sym_key_nss.h" | 11 #include "components/webcrypto/nss/sym_key_nss.h" |
12 #include "content/child/webcrypto/nss/util_nss.h" | 12 #include "components/webcrypto/nss/util_nss.h" |
13 #include "content/child/webcrypto/status.h" | 13 #include "components/webcrypto/status.h" |
14 #include "content/child/webcrypto/webcrypto_util.h" | 14 #include "components/webcrypto/webcrypto_util.h" |
15 #include "crypto/scoped_nss_types.h" | 15 #include "crypto/scoped_nss_types.h" |
16 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" | 16 #include "third_party/WebKit/public/platform/WebCryptoAlgorithmParams.h" |
17 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" | 17 #include "third_party/WebKit/public/platform/WebCryptoKeyAlgorithm.h" |
18 | 18 |
19 namespace content { | |
20 | |
21 namespace webcrypto { | 19 namespace webcrypto { |
22 | 20 |
23 namespace { | 21 namespace { |
24 | 22 |
25 // The Default IV for AES-KW. See http://www.ietf.org/rfc/rfc3394.txt | 23 // The Default IV for AES-KW. See http://www.ietf.org/rfc/rfc3394.txt |
26 // Section 2.2.3.1. | 24 // Section 2.2.3.1. |
27 const unsigned char kAesIv[] = {0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6}; | 25 const unsigned char kAesIv[] = {0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6}; |
28 | 26 |
29 // The result of unwrapping is a SymKey rather than a buffer. This is a | 27 // The result of unwrapping is a SymKey rather than a buffer. This is a |
30 // consequence of how NSS exposes AES-KW. Subsequent code can extract the value | 28 // consequence of how NSS exposes AES-KW. Subsequent code can extract the value |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 } | 177 } |
180 }; | 178 }; |
181 | 179 |
182 } // namespace | 180 } // namespace |
183 | 181 |
184 AlgorithmImplementation* CreatePlatformAesKwImplementation() { | 182 AlgorithmImplementation* CreatePlatformAesKwImplementation() { |
185 return new AesKwCryptoAlgorithmNss; | 183 return new AesKwCryptoAlgorithmNss; |
186 } | 184 } |
187 | 185 |
188 } // namespace webcrypto | 186 } // namespace webcrypto |
189 | |
190 } // namespace content | |
OLD | NEW |