OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "content/child/webcrypto/openssl/util_openssl.h" | |
6 | |
7 #include <openssl/evp.h> | |
8 | |
9 #include "content/child/webcrypto/crypto_data.h" | |
10 #include "content/child/webcrypto/platform_crypto.h" | |
11 #include "crypto/openssl_util.h" | |
12 | |
13 namespace content { | |
14 | |
15 namespace webcrypto { | |
16 | |
17 void PlatformInit() { | |
18 crypto::EnsureOpenSSLInit(); | |
19 } | |
20 | |
21 const EVP_MD* GetDigest(blink::WebCryptoAlgorithmId id) { | |
22 switch (id) { | |
23 case blink::WebCryptoAlgorithmIdSha1: | |
24 return EVP_sha1(); | |
25 case blink::WebCryptoAlgorithmIdSha256: | |
26 return EVP_sha256(); | |
27 case blink::WebCryptoAlgorithmIdSha384: | |
28 return EVP_sha384(); | |
29 case blink::WebCryptoAlgorithmIdSha512: | |
30 return EVP_sha512(); | |
31 default: | |
32 return NULL; | |
33 } | |
34 } | |
35 | |
36 AlgorithmImplementation* CreatePlatformRsaOaepImplementation() { | |
37 // TODO(eroman): | |
38 return NULL; | |
39 } | |
40 | |
41 AlgorithmImplementation* CreatePlatformRsaSsaImplementation() { | |
42 // TODO(eroman): | |
43 return NULL; | |
44 } | |
45 | |
46 } // namespace webcrypto | |
47 | |
48 } // namespace content | |
OLD | NEW |