From owner-svn-ports-head@FreeBSD.ORG Sat Jun 13 17:34:35 2015 Return-Path: Delivered-To: svn-ports-head@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A299FEE4; Sat, 13 Jun 2015 17:34:35 +0000 (UTC) (envelope-from osa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83CAD39C; Sat, 13 Jun 2015 17:34:35 +0000 (UTC) (envelope-from osa@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5DHYZX4079002; Sat, 13 Jun 2015 17:34:35 GMT (envelope-from osa@FreeBSD.org) Received: (from osa@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5DHYYLW078998; Sat, 13 Jun 2015 17:34:34 GMT (envelope-from osa@FreeBSD.org) Message-Id: <201506131734.t5DHYYLW078998@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: osa set sender to osa@FreeBSD.org using -f From: "Sergey A. Osokin" Date: Sat, 13 Jun 2015 17:34:34 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r389474 - in head/www: nginx nginx-devel nginx-devel/files nginx/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2015 17:34:35 -0000 Author: osa Date: Sat Jun 13 17:34:33 2015 New Revision: 389474 URL: https://svnweb.freebsd.org/changeset/ports/389474 Log: Fix digest authentication fail on URLs with a querystring for third-party http_auth_digest module. PR: 199758 Added: head/www/nginx-devel/files/extra-patch-ngx_http_auth_digest_module.c (contents, props changed) head/www/nginx/files/extra-patch-ngx_http_auth_digest_module.c (contents, props changed) Modified: head/www/nginx-devel/Makefile head/www/nginx/Makefile Modified: head/www/nginx-devel/Makefile ============================================================================== --- head/www/nginx-devel/Makefile Sat Jun 13 17:27:11 2015 (r389473) +++ head/www/nginx-devel/Makefile Sat Jun 13 17:34:33 2015 (r389474) @@ -293,6 +293,7 @@ GH_ACCOUNT+= samizdatco:auth_digest GH_PROJECT+= nginx-http-auth-digest:auth_digest GH_TAGNAME+= ${GIT_AUTH_DIGEST_VERSION}:auth_digest CONFIGURE_ARGS+=--add-module=${WRKSRC_auth_digest} +EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-ngx_http_auth_digest_module.c .endif .if ${PORT_OPTIONS:MHTTP_AUTH_LDAP} Added: head/www/nginx-devel/files/extra-patch-ngx_http_auth_digest_module.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/nginx-devel/files/extra-patch-ngx_http_auth_digest_module.c Sat Jun 13 17:34:33 2015 (r389474) @@ -0,0 +1,30 @@ +--- ../nginx-http-auth-digest-bd1c86a/ngx_http_auth_digest_module.c.orig 2011-12-29 04:00:32.000000000 +0400 ++++ ../nginx-http-auth-digest-bd1c86a/ngx_http_auth_digest_module.c 2015-06-13 20:18:59.856347000 +0300 +@@ -403,11 +403,11 @@ + if (http_method.data==NULL) return NGX_HTTP_INTERNAL_SERVER_ERROR; + p = ngx_cpymem(http_method.data, r->method_name.data, r->method_end - r->method_name.data+1); + +- ha2_key.len = http_method.len + r->uri.len + 1; ++ ha2_key.len = http_method.len + r->unparsed_uri.len + 1; + ha2_key.data = ngx_pcalloc(r->pool, ha2_key.len); + if (ha2_key.data==NULL) return NGX_HTTP_INTERNAL_SERVER_ERROR; + p = ngx_cpymem(ha2_key.data, http_method.data, http_method.len-1); *p++ = ':'; +- p = ngx_cpymem(p, r->uri.data, r->uri.len); ++ p = ngx_cpymem(p, r->unparsed_uri.data, r->unparsed_uri.len); + + HA2.len = 33; + HA2.data = ngx_pcalloc(r->pool, HA2.len); +@@ -487,11 +487,11 @@ + // recalculate the digest with a modified HA2 value (for rspauth) and emit the + // Authentication-Info header + ngx_memset(ha2_key.data, 0, ha2_key.len); +- p = ngx_sprintf(ha2_key.data, ":%s", r->uri.data); ++ p = ngx_sprintf(ha2_key.data, ":%s", r->unparsed_uri.data); + + ngx_memset(HA2.data, 0, HA2.len); + ngx_md5_init(&md5); +- ngx_md5_update(&md5, ha2_key.data, r->uri.len); ++ ngx_md5_update(&md5, ha2_key.data, r->unparsed_uri.len); + ngx_md5_final(hash, &md5); + ngx_hex_dump(HA2.data, hash, 16); + Modified: head/www/nginx/Makefile ============================================================================== --- head/www/nginx/Makefile Sat Jun 13 17:27:11 2015 (r389473) +++ head/www/nginx/Makefile Sat Jun 13 17:34:33 2015 (r389474) @@ -290,6 +290,7 @@ GH_ACCOUNT+= samizdatco:auth_digest GH_PROJECT+= nginx-http-auth-digest:auth_digest GH_TAGNAME+= ${GIT_AUTH_DIGEST_VERSION}:auth_digest CONFIGURE_ARGS+=--add-module=${WRKSRC_auth_digest} +EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-ngx_http_auth_digest_module.c .endif .if ${PORT_OPTIONS:MHTTP_AUTH_LDAP} Added: head/www/nginx/files/extra-patch-ngx_http_auth_digest_module.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/nginx/files/extra-patch-ngx_http_auth_digest_module.c Sat Jun 13 17:34:33 2015 (r389474) @@ -0,0 +1,30 @@ +--- ../nginx-http-auth-digest-bd1c86a/ngx_http_auth_digest_module.c.orig 2011-12-29 04:00:32.000000000 +0400 ++++ ../nginx-http-auth-digest-bd1c86a/ngx_http_auth_digest_module.c 2015-06-13 20:18:59.856347000 +0300 +@@ -403,11 +403,11 @@ + if (http_method.data==NULL) return NGX_HTTP_INTERNAL_SERVER_ERROR; + p = ngx_cpymem(http_method.data, r->method_name.data, r->method_end - r->method_name.data+1); + +- ha2_key.len = http_method.len + r->uri.len + 1; ++ ha2_key.len = http_method.len + r->unparsed_uri.len + 1; + ha2_key.data = ngx_pcalloc(r->pool, ha2_key.len); + if (ha2_key.data==NULL) return NGX_HTTP_INTERNAL_SERVER_ERROR; + p = ngx_cpymem(ha2_key.data, http_method.data, http_method.len-1); *p++ = ':'; +- p = ngx_cpymem(p, r->uri.data, r->uri.len); ++ p = ngx_cpymem(p, r->unparsed_uri.data, r->unparsed_uri.len); + + HA2.len = 33; + HA2.data = ngx_pcalloc(r->pool, HA2.len); +@@ -487,11 +487,11 @@ + // recalculate the digest with a modified HA2 value (for rspauth) and emit the + // Authentication-Info header + ngx_memset(ha2_key.data, 0, ha2_key.len); +- p = ngx_sprintf(ha2_key.data, ":%s", r->uri.data); ++ p = ngx_sprintf(ha2_key.data, ":%s", r->unparsed_uri.data); + + ngx_memset(HA2.data, 0, HA2.len); + ngx_md5_init(&md5); +- ngx_md5_update(&md5, ha2_key.data, r->uri.len); ++ ngx_md5_update(&md5, ha2_key.data, r->unparsed_uri.len); + ngx_md5_final(hash, &md5); + ngx_hex_dump(HA2.data, hash, 16); +