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/child/webcrypto/platform_crypto.h" | 5 #include "content/child/webcrypto/platform_crypto.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 #include <openssl/aes.h> | 8 #include <openssl/aes.h> |
9 #include <openssl/evp.h> | 9 #include <openssl/evp.h> |
10 #include <openssl/hmac.h> | 10 #include <openssl/hmac.h> |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 return EVP_aes_256_cbc(); | 56 return EVP_aes_256_cbc(); |
57 default: | 57 default: |
58 return NULL; | 58 return NULL; |
59 } | 59 } |
60 } | 60 } |
61 | 61 |
62 const EVP_MD* GetDigest(blink::WebCryptoAlgorithmId id) { | 62 const EVP_MD* GetDigest(blink::WebCryptoAlgorithmId id) { |
63 switch (id) { | 63 switch (id) { |
64 case blink::WebCryptoAlgorithmIdSha1: | 64 case blink::WebCryptoAlgorithmIdSha1: |
65 return EVP_sha1(); | 65 return EVP_sha1(); |
66 case blink::WebCryptoAlgorithmIdSha224: | |
67 return EVP_sha224(); | |
68 case blink::WebCryptoAlgorithmIdSha256: | 66 case blink::WebCryptoAlgorithmIdSha256: |
69 return EVP_sha256(); | 67 return EVP_sha256(); |
70 case blink::WebCryptoAlgorithmIdSha384: | 68 case blink::WebCryptoAlgorithmIdSha384: |
71 return EVP_sha384(); | 69 return EVP_sha384(); |
72 case blink::WebCryptoAlgorithmIdSha512: | 70 case blink::WebCryptoAlgorithmIdSha512: |
73 return EVP_sha512(); | 71 return EVP_sha512(); |
74 default: | 72 default: |
75 return NULL; | 73 return NULL; |
76 } | 74 } |
77 } | 75 } |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 blink::WebCryptoKey* key) { | 401 blink::WebCryptoKey* key) { |
404 // TODO(eroman): http://crbug.com/267888 | 402 // TODO(eroman): http://crbug.com/267888 |
405 return Status::ErrorUnsupported(); | 403 return Status::ErrorUnsupported(); |
406 } | 404 } |
407 | 405 |
408 } // namespace platform | 406 } // namespace platform |
409 | 407 |
410 } // namespace webcrypto | 408 } // namespace webcrypto |
411 | 409 |
412 } // namespace content | 410 } // namespace content |
OLD | NEW |