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 "content/renderer/webcrypto/platform_crypto.h" | 5 #include "content/renderer/webcrypto/platform_crypto.h" |
6 | 6 |
7 #include <cryptohi.h> | 7 #include <cryptohi.h> |
8 #include <pk11pub.h> | 8 #include <pk11pub.h> |
9 #include <sechash.h> | 9 #include <sechash.h> |
10 | 10 |
(...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1183 crypto::ScopedPK11SymKey unwrapped_key(PK11_UnwrapSymKey(wrapping_key->key(), | 1183 crypto::ScopedPK11SymKey unwrapped_key(PK11_UnwrapSymKey(wrapping_key->key(), |
1184 CKM_NSS_AES_KEY_WRAP, | 1184 CKM_NSS_AES_KEY_WRAP, |
1185 param_item.get(), | 1185 param_item.get(), |
1186 &cipher_text, | 1186 &cipher_text, |
1187 mechanism, | 1187 mechanism, |
1188 flags, | 1188 flags, |
1189 plaintext_length)); | 1189 plaintext_length)); |
1190 if (!unwrapped_key) | 1190 if (!unwrapped_key) |
1191 return Status::Error(); | 1191 return Status::Error(); |
1192 | 1192 |
1193 blink::WebCryptoKeyAlgorithm key_algorithm; | |
1194 if (!CreateSecretKeyAlgorithm(algorithm, plaintext_length, &key_algorithm)) | |
1195 return Status::ErrorUnexpected(); | |
1196 | |
1193 *key = blink::WebCryptoKey::create(new SymKey(unwrapped_key.Pass()), | 1197 *key = blink::WebCryptoKey::create(new SymKey(unwrapped_key.Pass()), |
1194 blink::WebCryptoKeyTypeSecret, | 1198 blink::WebCryptoKeyTypeSecret, |
1195 extractable, | 1199 extractable, |
1196 algorithm, | 1200 key_algorithm, |
eroman
2014/03/04 02:55:14
Not sure I understand this change --> wouldn't it
padolph
2014/03/04 17:38:20
Yes, it's an artifact of my workflow. This is a fi
| |
1197 usage_mask); | 1201 usage_mask); |
1198 return Status::Success(); | 1202 return Status::Success(); |
1199 } | 1203 } |
1200 | 1204 |
1201 } // namespace platform | 1205 } // namespace platform |
1202 | 1206 |
1203 } // namespace webcrypto | 1207 } // namespace webcrypto |
1204 | 1208 |
1205 } // namespace content | 1209 } // namespace content |
OLD | NEW |