aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2019-01-07 20:51:53 -0800
committerandroid-build-merger <android-build-merger@google.com>2019-01-07 20:51:53 -0800
commit9308b2ac9448f2f8529e849e8c3268f058667673 (patch)
tree85c02346394f05ada50540ae68e2a932c5f43d58
parentde73d92766c1406cbbfd6f94ffd88e41b2b4e593 (diff)
parentdbcebe04a0fb6f548d0d1481359cf4e380854698 (diff)
downloadplatform_external_python_cpython2-9308b2ac9448f2f8529e849e8c3268f058667673.tar.gz
platform_external_python_cpython2-9308b2ac9448f2f8529e849e8c3268f058667673.tar.bz2
platform_external_python_cpython2-9308b2ac9448f2f8529e849e8c3268f058667673.zip
Build the _ssl module
am: dbcebe04a0 Change-Id: I70e4ae0ee31b741d2c69308c0f0b2298f1f88c61
-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},