summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wendler <polynomial-c@gentoo.org>2018-06-13 17:53:08 +0200
committerLars Wendler <polynomial-c@gentoo.org>2018-06-13 18:20:41 +0200
commit02e7c018532a058fa4d5c73cbe74fca48f085f19 (patch)
tree04a05c4c463013c3666efb937d7f2be62c1c2bb7 /media-video/gpac
parentgames-strategy/wesnoth: Removed old. (diff)
downloadgentoo-02e7c018532a058fa4d5c73cbe74fca48f085f19.tar.gz
gentoo-02e7c018532a058fa4d5c73cbe74fca48f085f19.tar.bz2
gentoo-02e7c018532a058fa4d5c73cbe74fca48f085f19.zip
media-video/gpac: Fixed build with openssl-1.1
Closes: https://bugs.gentoo.org/592550 Package-Manager: Portage-2.3.40, Repoman-2.3.9
Diffstat (limited to 'media-video/gpac')
-rw-r--r--media-video/gpac/files/gpac-0.7.1-openssl-1.1.patch126
-rw-r--r--media-video/gpac/gpac-0.7.1.ebuild1
2 files changed, 127 insertions, 0 deletions
diff --git a/media-video/gpac/files/gpac-0.7.1-openssl-1.1.patch b/media-video/gpac/files/gpac-0.7.1-openssl-1.1.patch
new file mode 100644
index 000000000000..e25a5bca78bb
--- /dev/null
+++ b/media-video/gpac/files/gpac-0.7.1-openssl-1.1.patch
@@ -0,0 +1,126 @@
+From e64a7d229fdcb5c190064b7860ade50124dcc735 Mon Sep 17 00:00:00 2001
+From: Aurelien David <aurelien.david@telecom-paristech.fr>
+Date: Fri, 6 Oct 2017 16:46:18 +0200
+Subject: [PATCH] compatibility with OpenSSL 1.1.x (#616)
+
+diff --git a/src/utils/downloader.c b/src/utils/downloader.c
+index b8c923b88..3b7d37b41 100644
+--- a/src/utils/downloader.c
++++ b/src/utils/downloader.c
+@@ -204,7 +204,7 @@ struct __gf_download_manager
+ u32 limit_data_rate, read_buf_size;
+ u64 max_cache_size;
+ Bool allow_broken_certificate;
+-
++
+ GF_List *skip_proxy_servers;
+ GF_List *credentials;
+ GF_List *cache_entries;
+@@ -392,10 +392,18 @@ static Bool init_ssl_lib() {
+ GF_LOG(GF_LOG_ERROR, GF_LOG_NETWORK, ("[HTTPS] Error while initializing Random Number generator, failed to init SSL !\n"));
+ return GF_TRUE;
+ }
++
++ /* per https://www.openssl.org/docs/man1.1.0/ssl/OPENSSL_init_ssl.html
++ ** As of version 1.1.0 OpenSSL will automatically allocate all resources that it needs so no explicit initialisation is required.
++ ** Similarly it will also automatically deinitialise as required.
++ */
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ SSL_library_init();
+ SSL_load_error_strings();
+ SSLeay_add_all_algorithms();
+ SSLeay_add_ssl_algorithms();
++#endif
++
+ _ssl_is_initialized = GF_TRUE;
+ GF_LOG(GF_LOG_DEBUG, GF_LOG_NETWORK, ("[HTTPS] Initalization of SSL library complete.\n"));
+ return GF_FALSE;
+@@ -422,6 +430,7 @@ static int ssl_init(GF_DownloadManager *dm, u32 mode)
+ }
+
+ switch (mode) {
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ case 0:
+ meth = SSLv23_client_method();
+ break;
+@@ -436,6 +445,11 @@ static int ssl_init(GF_DownloadManager *dm, u32 mode)
+ case 3:
+ meth = TLSv1_client_method();
+ break;
++#else /* for openssl 1.1+ this is the prefered method */
++ case 0:
++ meth = TLS_client_method();
++ break;
++#endif
+ default:
+ goto error;
+ }
+@@ -771,7 +785,7 @@ void gf_dm_sess_del(GF_DownloadSession *sess)
+ gf_sk_del(sess->sock);
+ gf_list_del(sess->headers);
+ gf_mx_del(sess->mx);
+-
++
+ gf_free(sess);
+ GF_LOG(GF_LOG_DEBUG, GF_LOG_NETWORK, ("[Downloader] gf_dm_sess_del(%p) : DONE\n", sess ));
+ }
+@@ -1145,7 +1159,7 @@ GF_DownloadSession *gf_dm_sess_new_simple(GF_DownloadManager * dm, const char *u
+ {
+ GF_DownloadSession *sess;
+ if (!dm) return NULL;
+-
++
+ GF_SAFEALLOC(sess, GF_DownloadSession);
+ if (!sess) {
+ GF_LOG(GF_LOG_ERROR, GF_LOG_NETWORK, ("%s:%d Cannot allocate session for URL %s: OUT OF MEMORY!\n", __FILE__, __LINE__, url));
+@@ -1166,8 +1180,8 @@ GF_DownloadSession *gf_dm_sess_new_simple(GF_DownloadManager * dm, const char *u
+ gf_free(sess);
+ return NULL;
+ }
+-
+-
++
++
+ assert( dm );
+
+ *e = gf_dm_sess_setup_from_url(sess, url);
+@@ -1225,7 +1239,7 @@ static GF_Err gf_dm_read_data(GF_DownloadSession *sess, char *data, u32 data_siz
+ gf_mx_v(sess->mx);
+ return GF_IP_CONNECTION_CLOSED;
+ }
+-
++
+ #ifdef GPAC_HAS_SSL
+ if (sess->ssl) {
+ s32 size;
+@@ -1451,7 +1465,11 @@ static void gf_dm_connect(GF_DownloadSession *sess)
+ const GENERAL_NAME *altname = sk_GENERAL_NAME_value(altnames, i);
+ if (altname->type == GEN_DNS)
+ {
+- unsigned char *altname_str = ASN1_STRING_data(altname->d.ia5);
++ #if OPENSSL_VERSION_NUMBER < 0x10100000L
++ unsigned char *altname_str = ASN1_STRING_data(altname->d.ia5);
++ #else
++ unsigned char *altname_str = (unsigned char *)ASN1_STRING_get0_data(altname->d.ia5);
++ #endif
+ gf_list_add(valid_names, altname_str);
+ }
+ }
+@@ -1806,7 +1824,7 @@ GF_DownloadManager *gf_dm_new(GF_Config *cfg)
+ dm->limit_data_rate = 1000 * atoi(opt) / 8;
+ else
+ gf_cfg_set_key(cfg, "Downloader", "MaxRate", "0");
+-
++
+
+ dm->read_buf_size = GF_DOWNLOAD_BUFFER_SIZE;
+ //when rate is limited, use smaller smaller read size
+@@ -2943,7 +2961,7 @@ static GF_Err wait_for_header_and_parse(GF_DownloadSession *sess, char * sHTTP)
+ hdrp->value = gf_strdup(hdr_val);
+ gf_list_add(sess->headers, hdrp);
+ }
+-
++
+ if (sep) sep[0]=':';
+ if (hdr_sep) hdr_sep[0] = '\r';
+ }
diff --git a/media-video/gpac/gpac-0.7.1.ebuild b/media-video/gpac/gpac-0.7.1.ebuild
index ed5c090d045f..fea54fdfefe0 100644
--- a/media-video/gpac/gpac-0.7.1.ebuild
+++ b/media-video/gpac/gpac-0.7.1.ebuild
@@ -64,6 +64,7 @@ PATCHES=(
"${FILESDIR}/${PN}-0.7.1-configure.patch"
"${FILESDIR}/ffmpeg4.patch"
"${FILESDIR}/${PN}-freetype.patch"
+ "${FILESDIR}/${P}-openssl-1.1.patch"
)
DOCS=(