| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "net/android/keystore_openssl.h" | 5 #include "net/android/keystore_openssl.h" |
| 6 | 6 |
| 7 #include <jni.h> | 7 #include <jni.h> |
| 8 #include <openssl/bn.h> | 8 #include <openssl/bn.h> |
| 9 // This include is required to get the ECDSA_METHOD structure definition | 9 // This include is required to get the ECDSA_METHOD structure definition |
| 10 // which isn't currently part of the OpenSSL official ABI. This should | 10 // which isn't currently part of the OpenSSL official ABI. This should |
| 11 // not be a concern for Chromium which always links against its own | 11 // not be a concern for Chromium which always links against its own |
| 12 // version of the library on Android. | 12 // version of the library on Android. |
| 13 #include <openssl/crypto/ecdsa/ecs_locl.h> | 13 #include <openssl/crypto/ecdsa/ecs_locl.h> |
| 14 // And this one is needed for the EC_GROUP definition. | 14 // And this one is needed for the EC_GROUP definition. |
| 15 #include <openssl/crypto/ec/ec_lcl.h> | 15 #include <openssl/crypto/ec/ec_lcl.h> |
| 16 #include <openssl/dsa.h> | 16 #include <openssl/dsa.h> |
| 17 #include <openssl/ec.h> | 17 #include <openssl/ec.h> |
| 18 #include <openssl/engine.h> | 18 #include <openssl/engine.h> |
| 19 #include <openssl/evp.h> | 19 #include <openssl/evp.h> |
| 20 #include <openssl/rsa.h> | 20 #include <openssl/rsa.h> |
| 21 | 21 |
| 22 #include "base/android/build_info.h" | 22 #include "base/android/build_info.h" |
| 23 #include "base/android/jni_android.h" | 23 #include "base/android/jni_android.h" |
| 24 #include "base/android/scoped_java_ref.h" | 24 #include "base/android/scoped_java_ref.h" |
| 25 #include "base/basictypes.h" | 25 #include "base/basictypes.h" |
| 26 #include "base/lazy_instance.h" | 26 #include "base/lazy_instance.h" |
| 27 #include "base/logging.h" | 27 #include "base/logging.h" |
| 28 #include "crypto/openssl_util.h" | 28 #include "crypto/openssl_util.h" |
| 29 #include "net/android/keystore.h" | 29 #include "net/android/keystore.h" |
| 30 #include "net/base/ssl_client_cert_type.h" | 30 #include "net/ssl/ssl_client_cert_type.h" |
| 31 | 31 |
| 32 // IMPORTANT NOTE: The following code will currently only work when used | 32 // IMPORTANT NOTE: The following code will currently only work when used |
| 33 // to implement client certificate support with OpenSSL. That's because | 33 // to implement client certificate support with OpenSSL. That's because |
| 34 // only the signing operations used in this use case are implemented here. | 34 // only the signing operations used in this use case are implemented here. |
| 35 // | 35 // |
| 36 // Generally speaking, OpenSSL provides many different ways to sign | 36 // Generally speaking, OpenSSL provides many different ways to sign |
| 37 // digests. This code doesn't support all these cases, only the ones that | 37 // digests. This code doesn't support all these cases, only the ones that |
| 38 // are required to sign the MAC during the OpenSSL handshake for TLS < 1.2. | 38 // are required to sign the MAC during the OpenSSL handshake for TLS < 1.2. |
| 39 // | 39 // |
| 40 // The OpenSSL EVP_PKEY type is a generic wrapper around key pairs. | 40 // The OpenSSL EVP_PKEY type is a generic wrapper around key pairs. |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 default: | 690 default: |
| 691 LOG(WARNING) | 691 LOG(WARNING) |
| 692 << "GetOpenSSLPrivateKeyWrapper() called with invalid key type"; | 692 << "GetOpenSSLPrivateKeyWrapper() called with invalid key type"; |
| 693 return NULL; | 693 return NULL; |
| 694 } | 694 } |
| 695 return pkey.release(); | 695 return pkey.release(); |
| 696 } | 696 } |
| 697 | 697 |
| 698 } // namespace android | 698 } // namespace android |
| 699 } // namespace net | 699 } // namespace net |
| OLD | NEW |