-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit of BoringSSL for Android.
- Loading branch information
0 parents
commit d9e397b
Showing
716 changed files
with
396,653 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
# Note that some host libraries have the same module name as the target | ||
# libraries. This is currently needed to build, for example, adb. But it's | ||
# probably something that should be changed. | ||
|
||
LOCAL_PATH := $(call my-dir) | ||
|
||
## libcrypto | ||
|
||
# Target static library | ||
include $(CLEAR_VARS) | ||
LOCAL_MODULE_TAGS := optional | ||
LOCAL_MODULE := libcrypto_static | ||
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src/include | ||
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/crypto-sources.mk | ||
include $(LOCAL_PATH)/crypto-sources.mk | ||
include $(BUILD_STATIC_LIBRARY) | ||
|
||
# Target shared library | ||
include $(CLEAR_VARS) | ||
LOCAL_MODULE_TAGS := optional | ||
LOCAL_MODULE := libcrypto | ||
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src/include | ||
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/crypto-sources.mk | ||
LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION | ||
include $(LOCAL_PATH)/crypto-sources.mk | ||
include $(BUILD_SHARED_LIBRARY) | ||
|
||
# Target static tool | ||
include $(CLEAR_VARS) | ||
LOCAL_CFLAGS += -Wall -Werror -std=c++0x | ||
LOCAL_CPP_EXTENSION := cc | ||
LOCAL_MODULE := bssl | ||
LOCAL_MODULE_TAGS := optional | ||
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/sources.mk | ||
LOCAL_SHARED_LIBRARIES=libcrypto libssl | ||
include $(LOCAL_PATH)/sources.mk | ||
LOCAL_SRC_FILES = $(tool_sources) | ||
include $(BUILD_EXECUTABLE) | ||
|
||
# Host static library | ||
include $(CLEAR_VARS) | ||
LOCAL_MODULE_TAGS := optional | ||
LOCAL_MODULE := libcrypto_static | ||
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src/include | ||
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/crypto-sources.mk | ||
include $(LOCAL_PATH)/crypto-sources.mk | ||
include $(BUILD_HOST_STATIC_LIBRARY) | ||
|
||
# Host shared library | ||
include $(CLEAR_VARS) | ||
LOCAL_MODULE_TAGS := optional | ||
LOCAL_MODULE := libcrypto-host | ||
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include | ||
LOCAL_MULTILIB := both | ||
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/crypto-sources.mk | ||
LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION | ||
include $(LOCAL_PATH)/crypto-sources.mk | ||
include $(BUILD_HOST_SHARED_LIBRARY) | ||
|
||
|
||
## libssl | ||
|
||
# Target static library | ||
include $(CLEAR_VARS) | ||
LOCAL_MODULE_TAGS := optional | ||
LOCAL_MODULE := libssl_static | ||
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src/include | ||
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/ssl-sources.mk | ||
include $(LOCAL_PATH)/ssl-sources.mk | ||
include $(BUILD_STATIC_LIBRARY) | ||
|
||
# Target shared library | ||
include $(CLEAR_VARS) | ||
LOCAL_MODULE_TAGS := optional | ||
LOCAL_MODULE := libssl | ||
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src/include | ||
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/ssl-sources.mk | ||
LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION | ||
LOCAL_SHARED_LIBRARIES=libcrypto | ||
include $(LOCAL_PATH)/ssl-sources.mk | ||
include $(BUILD_SHARED_LIBRARY) | ||
|
||
# Host static library | ||
include $(CLEAR_VARS) | ||
LOCAL_MODULE_TAGS := optional | ||
LOCAL_MODULE := libssl_static-host | ||
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src/include | ||
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/ssl-sources.mk | ||
include $(LOCAL_PATH)/ssl-sources.mk | ||
include $(BUILD_HOST_STATIC_LIBRARY) | ||
|
||
# Host shared library | ||
include $(CLEAR_VARS) | ||
LOCAL_MODULE_TAGS := optional | ||
LOCAL_MODULE := libssl-host | ||
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/src/include | ||
LOCAL_MULTILIB := both | ||
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/ssl-sources.mk | ||
LOCAL_CFLAGS += -fvisibility=hidden -DBORINGSSL_SHARED_LIBRARY -DBORINGSSL_IMPLEMENTATION | ||
LOCAL_SHARED_LIBRARIES += libcrypto-host | ||
include $(LOCAL_PATH)/ssl-sources.mk | ||
include $(BUILD_HOST_SHARED_LIBRARY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
4cc1e838aef70be6194c2c77e1de9015b9b7410a |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
|
||
LICENSE ISSUES | ||
============== | ||
|
||
The OpenSSL toolkit stays under a dual license, i.e. both the conditions of | ||
the OpenSSL License and the original SSLeay license apply to the toolkit. | ||
See below for the actual license texts. Actually both licenses are BSD-style | ||
Open Source licenses. In case of any license issues related to OpenSSL | ||
please contact [email protected]. | ||
|
||
OpenSSL License | ||
--------------- | ||
|
||
/* ==================================================================== | ||
* Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in | ||
* the documentation and/or other materials provided with the | ||
* distribution. | ||
* | ||
* 3. All advertising materials mentioning features or use of this | ||
* software must display the following acknowledgment: | ||
* "This product includes software developed by the OpenSSL Project | ||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
* | ||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
* endorse or promote products derived from this software without | ||
* prior written permission. For written permission, please contact | ||
* [email protected]. | ||
* | ||
* 5. Products derived from this software may not be called "OpenSSL" | ||
* nor may "OpenSSL" appear in their names without prior written | ||
* permission of the OpenSSL Project. | ||
* | ||
* 6. Redistributions of any form whatsoever must retain the following | ||
* acknowledgment: | ||
* "This product includes software developed by the OpenSSL Project | ||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
* OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* ==================================================================== | ||
* | ||
* This product includes cryptographic software written by Eric Young | ||
* ([email protected]). This product includes software written by Tim | ||
* Hudson ([email protected]). | ||
* | ||
*/ | ||
|
||
Original SSLeay License | ||
----------------------- | ||
|
||
/* Copyright (C) 1995-1998 Eric Young ([email protected]) | ||
* All rights reserved. | ||
* | ||
* This package is an SSL implementation written | ||
* by Eric Young ([email protected]). | ||
* The implementation was written so as to conform with Netscapes SSL. | ||
* | ||
* This library is free for commercial and non-commercial use as long as | ||
* the following conditions are aheared to. The following conditions | ||
* apply to all code found in this distribution, be it the RC4, RSA, | ||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
* included with this distribution is covered by the same copyright terms | ||
* except that the holder is Tim Hudson ([email protected]). | ||
* | ||
* Copyright remains Eric Young's, and as such any Copyright notices in | ||
* the code are not to be removed. | ||
* If this package is used in a product, Eric Young should be given attribution | ||
* as the author of the parts of the library used. | ||
* This can be in the form of a textual message at program startup or | ||
* in documentation (online or textual) provided with the package. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* 1. Redistributions of source code must retain the copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* 3. All advertising materials mentioning features or use of this software | ||
* must display the following acknowledgement: | ||
* "This product includes cryptographic software written by | ||
* Eric Young ([email protected])" | ||
* The word 'cryptographic' can be left out if the rouines from the library | ||
* being used are not cryptographic related :-). | ||
* 4. If you include any Windows specific code (or a derivative thereof) from | ||
* the apps directory (application code) you must include an acknowledgement: | ||
* "This product includes software written by Tim Hudson ([email protected])" | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
* SUCH DAMAGE. | ||
* | ||
* The licence and distribution terms for any publically available version or | ||
* derivative of this code cannot be changed. i.e. this code cannot simply be | ||
* copied and put under another distribution licence | ||
* [including the GNU Public Licence.] | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* Copyright (c) 2014, Google Inc. | ||
* | ||
* Permission to use, copy, modify, and/or distribute this software for any | ||
* purpose with or without fee is hereby granted, provided that the above | ||
* copyright notice and this permission notice appear in all copies. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY | ||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION | ||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN | ||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ | ||
|
||
/* This file contains odd functions that are needed, temporarily, on Android | ||
* because wpa_supplicant will take a little while to sync with upstream. | ||
* | ||
* The declarations for these functions are in the main BoringSSL headers but | ||
* the only definitions are here, in Android land. */ | ||
|
||
#include <openssl/base.h> | ||
|
||
#include <assert.h> | ||
|
||
#include <openssl/bn.h> | ||
#include <openssl/cipher.h> | ||
#include <openssl/err.h> | ||
#include <openssl/ssl.h> | ||
|
||
|
||
const EVP_CIPHER *EVP_aes_192_ecb(void) { return NULL; } | ||
|
||
const EVP_CIPHER *EVP_aes_192_cbc(void) { return NULL; } | ||
|
||
BIGNUM *get_rfc3526_prime_1536(BIGNUM *bn) { | ||
assert(bn == NULL); | ||
|
||
static const uint8_t data[] = { | ||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC9, 0x0F, 0xDA, 0xA2, | ||
0x21, 0x68, 0xC2, 0x34, 0xC4, 0xC6, 0x62, 0x8B, 0x80, 0xDC, 0x1C, 0xD1, | ||
0x29, 0x02, 0x4E, 0x08, 0x8A, 0x67, 0xCC, 0x74, 0x02, 0x0B, 0xBE, 0xA6, | ||
0x3B, 0x13, 0x9B, 0x22, 0x51, 0x4A, 0x08, 0x79, 0x8E, 0x34, 0x04, 0xDD, | ||
0xEF, 0x95, 0x19, 0xB3, 0xCD, 0x3A, 0x43, 0x1B, 0x30, 0x2B, 0x0A, 0x6D, | ||
0xF2, 0x5F, 0x14, 0x37, 0x4F, 0xE1, 0x35, 0x6D, 0x6D, 0x51, 0xC2, 0x45, | ||
0xE4, 0x85, 0xB5, 0x76, 0x62, 0x5E, 0x7E, 0xC6, 0xF4, 0x4C, 0x42, 0xE9, | ||
0xA6, 0x37, 0xED, 0x6B, 0x0B, 0xFF, 0x5C, 0xB6, 0xF4, 0x06, 0xB7, 0xED, | ||
0xEE, 0x38, 0x6B, 0xFB, 0x5A, 0x89, 0x9F, 0xA5, 0xAE, 0x9F, 0x24, 0x11, | ||
0x7C, 0x4B, 0x1F, 0xE6, 0x49, 0x28, 0x66, 0x51, 0xEC, 0xE4, 0x5B, 0x3D, | ||
0xC2, 0x00, 0x7C, 0xB8, 0xA1, 0x63, 0xBF, 0x05, 0x98, 0xDA, 0x48, 0x36, | ||
0x1C, 0x55, 0xD3, 0x9A, 0x69, 0x16, 0x3F, 0xA8, 0xFD, 0x24, 0xCF, 0x5F, | ||
0x83, 0x65, 0x5D, 0x23, 0xDC, 0xA3, 0xAD, 0x96, 0x1C, 0x62, 0xF3, 0x56, | ||
0x20, 0x85, 0x52, 0xBB, 0x9E, 0xD5, 0x29, 0x07, 0x70, 0x96, 0x96, 0x6D, | ||
0x67, 0x0C, 0x35, 0x4E, 0x4A, 0xBC, 0x98, 0x04, 0xF1, 0x74, 0x6C, 0x08, | ||
0xCA, 0x23, 0x73, 0x27, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, | ||
}; | ||
|
||
return BN_bin2bn(data, sizeof(data), NULL); | ||
} | ||
|
||
void ERR_remove_state(unsigned long pid) { | ||
assert(pid == 0); | ||
ERR_remove_thread_state(NULL); | ||
} | ||
|
||
int SSL_set_session_ticket_ext(SSL *s, void *ext_data, int ext_len) { | ||
return 0; | ||
} | ||
|
||
int SSL_set_session_ticket_ext_cb(SSL *s, void *cb, void *arg) { | ||
return 0; | ||
} | ||
|
||
int SSL_set_session_secret_cb(SSL *s, void *cb, void *arg) { | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/crypto/arm_arch.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/sources.mk | ||
include $(LOCAL_PATH)/sources.mk | ||
|
||
LOCAL_CFLAGS += -I$(LOCAL_PATH)/src/include -I$(LOCAL_PATH)/src/crypto -Wno-unused-parameter | ||
LOCAL_SRC_FILES_x86 = $(linux_x86_sources) | ||
LOCAL_SRC_FILES_x86_64 = $(linux_x86_64_sources) | ||
LOCAL_SRC_FILES_arm = $(linux_arm_sources) | ||
LOCAL_SRC_FILES_arm64 = $(linux_aarch64_sources) | ||
LOCAL_SRC_FILES += $(crypto_sources) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# This makefile exists to be included by makefiles in other directories so that | ||
# they can detect whether BoringSSL or OpenSSL is being used. | ||
|
||
OPENSSL_FLAVOR=BoringSSL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/include |
Oops, something went wrong.