aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2019-01-07 21:02:03 -0800
committerandroid-build-merger <android-build-merger@google.com>2019-01-07 21:02:03 -0800
commit152dfc4b3ee1c6ec3cc1a232e8cb68f2b59f5d88 (patch)
tree85c02346394f05ada50540ae68e2a932c5f43d58
parent2b7fb2c9e5a6dec403448c42bc08ea1f32c852cf (diff)
parent9308b2ac9448f2f8529e849e8c3268f058667673 (diff)
downloadplatform_external_python_cpython2-152dfc4b3ee1c6ec3cc1a232e8cb68f2b59f5d88.tar.gz
platform_external_python_cpython2-152dfc4b3ee1c6ec3cc1a232e8cb68f2b59f5d88.tar.bz2
platform_external_python_cpython2-152dfc4b3ee1c6ec3cc1a232e8cb68f2b59f5d88.zip
Build the _ssl module am: dbcebe04a0
am: 9308b2ac94 Change-Id: I105be93f785f02578eecd1556d161a0471cf8403
-rw-r--r--Android.bp16
-rw-r--r--Modules/_ssl.c2
-rw-r--r--Modules/config.c2
3 files changed, 19 insertions, 1 deletions
diff --git a/Android.bp b/Android.bp
index 3ad97a2896..f161d8f86d 100644
--- a/Android.bp
+++ b/Android.bp
@@ -277,6 +277,7 @@ cc_binary {
"py2-c-module-_csv",
"py2-c-module-_socket",
"py2-c-module-termios",
+ "py2-c-module-_ssl",
"py2-c-module-_md5",
"py2-c-module-_sha",
"py2-c-module-_sha256",
@@ -307,8 +308,10 @@ cc_binary {
"py2-c-module-_sqlite3",
"py2-c-module-_ctypes_test",
"py2-c-module-_ctypes",
- "libz",
+ "libcrypto",
"libexpat",
+ "libssl",
+ "libz",
],
target: {
linux_glibc_x86_64: {
@@ -531,6 +534,17 @@ cc_library_static {
}
cc_library_static {
+ name: "py2-c-module-_ssl",
+ defaults: ["py2-interp-defaults"],
+ srcs: ["Modules/_ssl.c"],
+ cflags: ["-Wno-incompatible-pointer-types-discards-qualifiers"],
+ static_libs: [
+ "libssl",
+ "libcrypto",
+ ],
+}
+
+cc_library_static {
name: "py2-c-module-_md5",
defaults: ["py2-interp-defaults"],
srcs: [
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index d0ce913d3d..0e0dacd9d2 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -591,7 +591,9 @@ newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock,
Py_INCREF(sslctx);
/* Make sure the SSL error state is initialized */
+#ifndef OPENSSL_IS_BORINGSSL
(void) ERR_get_state();
+#endif
ERR_clear_error();
PySSL_BEGIN_ALLOW_THREADS
diff --git a/Modules/config.c b/Modules/config.c
index 67a0bc643a..677c06367e 100644
--- a/Modules/config.c
+++ b/Modules/config.c
@@ -56,6 +56,7 @@ extern void initmmap(void);
extern void init_csv(void);
extern void init_socket(void);
extern void inittermios(void);
+extern void init_ssl(void);
extern void init_md5(void);
extern void init_sha(void);
extern void init_sha256(void);
@@ -124,6 +125,7 @@ struct _inittab _PyImport_Inittab[] = {
{"_csv", init_csv},
{"_socket", init_socket},
{"termios", inittermios},
+ {"_ssl", init_ssl},
{"_md5", init_md5},
{"_sha", init_sha},
{"_sha256", init_sha256},