summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2012-05-16 00:48:37 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2012-05-16 00:48:37 +0000
commitdf7bbc055791b3a3d7f9a8d09b9509cc3e85d902 (patch)
treec6c992f6b2d34fb68d18d916f4dff1c6046ee9a0 /app-pda/libimobiledevice/files
parentkeyword ~amd64-fbsd (compile tested only) (diff)
downloadgentoo-2-df7bbc055791b3a3d7f9a8d09b9509cc3e85d902.tar.gz
gentoo-2-df7bbc055791b3a3d7f9a8d09b9509cc3e85d902.tar.bz2
gentoo-2-df7bbc055791b3a3d7f9a8d09b9509cc3e85d902.zip
Upstream patch for "fix openssl initialization and handle error to avoid crash". Since Cython 0.16 is not supported yet, avoid bailing out when it's installed wrt #414063.
(Portage version: 2.2.0_alpha105/cvs/Linux x86_64)
Diffstat (limited to 'app-pda/libimobiledevice/files')
-rw-r--r--app-pda/libimobiledevice/files/libimobiledevice-1.1.4-openssl.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/app-pda/libimobiledevice/files/libimobiledevice-1.1.4-openssl.patch b/app-pda/libimobiledevice/files/libimobiledevice-1.1.4-openssl.patch
new file mode 100644
index 000000000000..dbb052c04080
--- /dev/null
+++ b/app-pda/libimobiledevice/files/libimobiledevice-1.1.4-openssl.patch
@@ -0,0 +1,49 @@
+From 54dad58468a9879fb44aff0d760bbd6c3288b812 Mon Sep 17 00:00:00 2001
+From: Nikias Bassen
+Date: Wed, 18 Apr 2012 15:07:04 +0000
+Subject: idevice: fix openssl initialization and handle error to avoid crash
+
+---
+diff --git a/src/idevice.c b/src/idevice.c
+index 91d67e6..a1cc013 100644
+--- a/src/idevice.c
++++ b/src/idevice.c
+@@ -559,6 +559,7 @@ static void internal_ssl_cleanup(ssl_data_t ssl_data)
+ if (ssl_data->ctx) {
+ SSL_CTX_free(ssl_data->ctx);
+ }
++ openssl_init_done = 0;
+ #else
+ if (ssl_data->session) {
+ gnutls_deinit(ssl_data->session);
+@@ -667,6 +668,11 @@ idevice_error_t idevice_connection_enable_ssl(idevice_connection_t connection)
+ }
+
+ /* Set up OpenSSL */
++ if (openssl_init_done == 0) {
++ SSL_library_init();
++ openssl_init_done = 1;
++ }
++
+ BIO *ssl_bio = BIO_new(BIO_s_socket());
+ if (!ssl_bio) {
+ debug_info("ERROR: Could not create SSL bio.");
+@@ -674,11 +680,12 @@ idevice_error_t idevice_connection_enable_ssl(idevice_connection_t connection)
+ }
+ BIO_set_fd(ssl_bio, (int)(long)connection->data, BIO_NOCLOSE);
+
+- if (openssl_init_done == 0) {
+- SSL_library_init();
+- openssl_init_done = 1;
+- }
+ SSL_CTX *ssl_ctx = SSL_CTX_new(SSLv3_method());
++ if (ssl_ctx == NULL) {
++ debug_info("ERROR: Could not create SSL context.");
++ BIO_free(ssl_bio);
++ return ret;
++ }
+
+ BIO* membp;
+ X509* rootCert = NULL;
+--
+cgit v0.8.3.1-34-gbf3d