From f71e23a6aae41280eb8ccacac4c5166e5fc55a7a Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Aug 09 2012 13:03:57 +0000 Subject: update to wget-1.14 --- diff --git a/.gitignore b/.gitignore index 4ab0d12..f2f8f7f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ wget-1.12.tar.bz2 /wget-1.13.4.tar.bz2 +/wget-1.14.tar.xz diff --git a/openssl-1.13.4-sslreadtimeout.patch b/openssl-1.13.4-sslreadtimeout.patch deleted file mode 100644 index 3ab0a8c..0000000 --- a/openssl-1.13.4-sslreadtimeout.patch +++ /dev/null @@ -1,107 +0,0 @@ -diff -up wget-1.13.4/src/openssl.c.sslreadtimeout wget-1.13.4/src/openssl.c ---- wget-1.13.4/src/openssl.c.sslreadtimeout 2011-08-29 10:01:24.000000000 +0200 -+++ wget-1.13.4/src/openssl.c 2012-05-29 12:30:42.000000000 +0200 -@@ -254,19 +254,47 @@ struct openssl_transport_context { - char *last_error; /* last error printed with openssl_errstr */ - }; - --static int --openssl_read (int fd, char *buf, int bufsize, void *arg) -+struct openssl_read_args { -+ int fd; -+ struct openssl_transport_context *ctx; -+ char *buf; -+ int bufsize; -+ int retval; -+}; -+ -+static void openssl_read_callback(void *arg) - { -- int ret; -- struct openssl_transport_context *ctx = arg; -+ struct openssl_read_args *args = (struct openssl_read_args *) arg; -+ struct openssl_transport_context *ctx = args->ctx; - SSL *conn = ctx->conn; -+ char *buf = args->buf; -+ int bufsize = args->bufsize; -+ -+ int ret; -+ - do - ret = SSL_read (conn, buf, bufsize); - while (ret == -1 - && SSL_get_error (conn, ret) == SSL_ERROR_SYSCALL - && errno == EINTR); - -- return ret; -+ args->retval = ret; -+} -+ -+static int -+openssl_read (int fd, char *buf, int bufsize, void *arg) -+{ -+ struct openssl_read_args args; -+ args.fd = fd; -+ args.buf = buf; -+ args.bufsize = bufsize; -+ args.ctx = (struct openssl_transport_context*) arg; -+ -+ if (run_with_timeout(opt.read_timeout, openssl_read_callback, &args)) { -+ return -1; -+ } -+ -+ return args.retval; - } - - static int -@@ -384,6 +412,18 @@ static struct transport_implementation o - openssl_peek, openssl_errstr, openssl_close - }; - -+struct scwt_context { -+ SSL *ssl; -+ int result; -+}; -+ -+static void -+ssl_connect_with_timeout_callback(void *arg) -+{ -+ struct scwt_context *ctx = (struct scwt_context *)arg; -+ ctx->result = SSL_connect(ctx->ssl); -+} -+ - /* Perform the SSL handshake on file descriptor FD, which is assumed - to be connected to an SSL server. The SSL handle provided by - OpenSSL is registered with the file descriptor FD using -@@ -396,6 +436,7 @@ bool - ssl_connect_wget (int fd) - { - SSL *conn; -+ struct scwt_context scwt_ctx; - struct openssl_transport_context *ctx; - - DEBUGP (("Initiating SSL handshake.\n")); -@@ -410,7 +451,14 @@ ssl_connect_wget (int fd) - if (!SSL_set_fd (conn, FD_TO_SOCKET (fd))) - goto error; - SSL_set_connect_state (conn); -- if (SSL_connect (conn) <= 0 || conn->state != SSL_ST_OK) -+ -+ scwt_ctx.ssl = conn; -+ if (run_with_timeout(opt.read_timeout, ssl_connect_with_timeout_callback, -+ &scwt_ctx)) { -+ DEBUGP (("SSL handshake timed out.\n")); -+ goto timeout; -+ } -+ if (scwt_ctx.result <= 0 || conn->state != SSL_ST_OK) - goto error; - - ctx = xnew0 (struct openssl_transport_context); -@@ -426,6 +474,7 @@ ssl_connect_wget (int fd) - error: - DEBUGP (("SSL handshake failed.\n")); - print_errors (); -+ timeout: - if (conn) - SSL_free (conn); - return false; diff --git a/sources b/sources index cdf213c..5c94c4e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -12115c3750a4d92f9c6ac62bac372e85 wget-1.13.4.tar.bz2 +316f6f59292c9098ad81fd54f658c579 wget-1.14.tar.xz diff --git a/wget-1.14-sslreadtimeout.patch b/wget-1.14-sslreadtimeout.patch new file mode 100644 index 0000000..03c29fc --- /dev/null +++ b/wget-1.14-sslreadtimeout.patch @@ -0,0 +1,105 @@ +diff -up wget-1.14/src/openssl.c.ssltimeout wget-1.14/src/openssl.c +--- wget-1.14/src/openssl.c.ssltimeout 2012-08-09 14:30:14.987964706 +0200 ++++ wget-1.14/src/openssl.c 2012-08-09 14:44:05.467660741 +0200 +@@ -256,19 +256,42 @@ struct openssl_transport_context { + char *last_error; /* last error printed with openssl_errstr */ + }; + +-static int +-openssl_read (int fd, char *buf, int bufsize, void *arg) +-{ +- int ret; +- struct openssl_transport_context *ctx = arg; ++struct openssl_read_args { ++ int fd; ++ struct openssl_transport_context *ctx; ++ char *buf; ++ int bufsize; ++ int retval; ++}; ++ ++static void openssl_read_callback(void *arg) { ++ struct openssl_read_args *args = (struct openssl_read_args *) arg; ++ struct openssl_transport_context *ctx = args->ctx; + SSL *conn = ctx->conn; ++ char *buf = args->buf; ++ int bufsize = args->bufsize; ++ int ret; ++ + do + ret = SSL_read (conn, buf, bufsize); +- while (ret == -1 +- && SSL_get_error (conn, ret) == SSL_ERROR_SYSCALL ++ while (ret == -1 && SSL_get_error (conn, ret) == SSL_ERROR_SYSCALL + && errno == EINTR); ++ args->retval = ret; ++} + +- return ret; ++static int ++openssl_read (int fd, char *buf, int bufsize, void *arg) ++{ ++ struct openssl_read_args args; ++ args.fd = fd; ++ args.buf = buf; ++ args.bufsize = bufsize; ++ args.ctx = (struct openssl_transport_context*) arg; ++ ++ if (run_with_timeout(opt.read_timeout, openssl_read_callback, &args)) { ++ return -1; ++ } ++ return args.retval; + } + + static int +@@ -386,6 +409,18 @@ static struct transport_implementation o + openssl_peek, openssl_errstr, openssl_close + }; + ++struct scwt_context { ++ SSL *ssl; ++ int result; ++}; ++ ++static void ++ssl_connect_with_timeout_callback(void *arg) ++{ ++ struct scwt_context *ctx = (struct scwt_context *)arg; ++ ctx->result = SSL_connect(ctx->ssl); ++} ++ + /* Perform the SSL handshake on file descriptor FD, which is assumed + to be connected to an SSL server. The SSL handle provided by + OpenSSL is registered with the file descriptor FD using +@@ -398,6 +433,7 @@ bool + ssl_connect_wget (int fd, const char *hostname) + { + SSL *conn; ++ struct scwt_context scwt_ctx; + struct openssl_transport_context *ctx; + + DEBUGP (("Initiating SSL handshake.\n")); +@@ -425,7 +461,14 @@ ssl_connect_wget (int fd, const char *ho + if (!SSL_set_fd (conn, FD_TO_SOCKET (fd))) + goto error; + SSL_set_connect_state (conn); +- if (SSL_connect (conn) <= 0 || conn->state != SSL_ST_OK) ++ ++ scwt_ctx.ssl = conn; ++ if (run_with_timeout(opt.read_timeout, ssl_connect_with_timeout_callback, ++ &scwt_ctx)) { ++ DEBUGP (("SSL handshake timed out.\n")); ++ goto timeout; ++ } ++ if (scwt_ctx.result <= 0 || conn->state != SSL_ST_OK) + goto error; + + ctx = xnew0 (struct openssl_transport_context); +@@ -441,6 +484,7 @@ ssl_connect_wget (int fd, const char *ho + error: + DEBUGP (("SSL handshake failed.\n")); + print_errors (); ++ timeout: + if (conn) + SSL_free (conn); + return false; diff --git a/wget-rh-modified.patch b/wget-rh-modified.patch index 23a80fd..b9d528f 100644 --- a/wget-rh-modified.patch +++ b/wget-rh-modified.patch @@ -3,9 +3,9 @@ @@ -561,7 +561,7 @@ PACKAGE_NAME='wget' PACKAGE_TARNAME='wget' - PACKAGE_VERSION='1.13.4' --PACKAGE_STRING='wget 1.13.4' -+PACKAGE_STRING='wget 1.13.4 (Red Hat modified)' + PACKAGE_VERSION='1.14' +-PACKAGE_STRING='wget 1.14' ++PACKAGE_STRING='wget 1.14 (Red Hat modified)' PACKAGE_BUGREPORT='bug-wget@gnu.org' PACKAGE_URL='' diff --git a/wget.spec b/wget.spec index f2ca555..6fd5adc 100644 --- a/wget.spec +++ b/wget.spec @@ -1,17 +1,15 @@ Summary: A utility for retrieving files using the HTTP or FTP protocols Name: wget -Version: 1.13.4 -Release: 5%{?dist} +Version: 1.14 +Release: 1%{?dist} License: GPLv3+ Group: Applications/Internet Url: http://www.gnu.org/software/wget/ -Source: ftp://ftp.gnu.org/gnu/wget/wget-%{version}.tar.bz2 +Source: ftp://ftp.gnu.org/gnu/wget/wget-%{version}.tar.xz Patch1: wget-rh-modified.patch Patch2: wget-1.12-path.patch -Patch3: openssl-1.13.4-sslreadtimeout.patch +Patch3: wget-1.14-sslreadtimeout.patch -# http://bzr.savannah.gnu.org/lh/wget/trunk/revision/2317 -#Patch3: wget-1.12-certificate-subjectAltName.patch Provides: webclient Provides: bundled(gnulib) Requires(post): /sbin/install-info @@ -69,6 +67,9 @@ rm -rf $RPM_BUILD_ROOT %{_infodir}/* %changelog +* Thu Aug 09 2012 Karsten Hopp 1.14-1 +- Update to wget-1.14 + * Sun Jul 22 2012 Fedora Release Engineering - 1.13.4-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild