Skip to content

Commit a36b88c

Browse files
nginxkolbyjack
authored andcommitted
Changes with nginx 1.3.13 19 Feb 2013
*) Change: a compiler with name "cc" is now used by default. *) Feature: support for proxying of WebSocket connections. Thanks to Apcera and CloudBees for sponsoring this work. *) Feature: the "auth_basic_user_file" directive supports "{SHA}" password encryption method. Thanks to Louis Opter.
1 parent bf31788 commit a36b88c

16 files changed

+395
-10
lines changed

CHANGES

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11

2+
Changes with nginx 1.3.13 19 Feb 2013
3+
4+
*) Change: a compiler with name "cc" is now used by default.
5+
6+
*) Feature: support for proxying of WebSocket connections.
7+
Thanks to Apcera and CloudBees for sponsoring this work.
8+
9+
*) Feature: the "auth_basic_user_file" directive supports "{SHA}"
10+
password encryption method.
11+
Thanks to Louis Opter.
12+
13+
214
Changes with nginx 1.3.12 05 Feb 2013
315

416
*) Feature: variables support in the "proxy_bind", "fastcgi_bind",

CHANGES.ru

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11

2+
Изменения в nginx 1.3.13 19.02.2013
3+
4+
*) Изменение: теперь для сборки по умолчанию используется компилятор с
5+
именем "cc".
6+
7+
*) Добавление: поддержка проксирования WebSocket-соединений.
8+
Спасибо Apcera и CloudBees за спонсирование разработки.
9+
10+
*) Добавление: директива auth_basic_user_file поддерживает шифрование
11+
паролей методом "{SHA}".
12+
Спасибо Louis Opter.
13+
14+
215
Изменения в nginx 1.3.12 05.02.2013
316

417
*) Добавление: директивы proxy_bind, fastcgi_bind, memcached_bind,

auto/lib/perl/make

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
cat << END >> $NGX_MAKEFILE
77

88
$NGX_OBJS/src/http/modules/perl/blib/arch/auto/nginx/nginx.so: \
9+
\$(CORE_DEPS) \$(HTTP_DEPS) \
910
src/http/modules/perl/nginx.pm \
1011
src/http/modules/perl/nginx.xs \
1112
src/http/modules/perl/ngx_http_perl_module.h \
1213
$NGX_OBJS/src/http/modules/perl/Makefile
13-
cp -p src/http/modules/perl/nginx.* $NGX_OBJS/src/http/modules/perl/
14+
cp src/http/modules/perl/nginx.* $NGX_OBJS/src/http/modules/perl/
1415

1516
cd $NGX_OBJS/src/http/modules/perl && \$(MAKE)
1617

auto/options

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ NGX_LOCK_PATH=
1515
NGX_USER=
1616
NGX_GROUP=
1717

18-
CC=${CC:-gcc}
18+
CC=${CC:-cc}
1919
CPP=
2020
NGX_OBJS=objs
2121

src/core/nginx.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#define _NGINX_H_INCLUDED_
1010

1111

12-
#define nginx_version 1003012
13-
#define NGINX_VERSION "1.3.12"
12+
#define nginx_version 1003013
13+
#define NGINX_VERSION "1.3.13"
1414
#define NGINX_VER "nginx/" NGINX_VERSION
1515

1616
#define NGINX_VAR "NGINX"

src/core/ngx_crypt.c

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ static ngx_int_t ngx_crypt_plain(ngx_pool_t *pool, u_char *key, u_char *salt,
2424

2525
static ngx_int_t ngx_crypt_ssha(ngx_pool_t *pool, u_char *key, u_char *salt,
2626
u_char **encrypted);
27+
static ngx_int_t ngx_crypt_sha(ngx_pool_t *pool, u_char *key, u_char *salt,
28+
u_char **encrypted);
2729

2830
#endif
2931

@@ -43,6 +45,9 @@ ngx_crypt(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted)
4345
#if (NGX_HAVE_SHA1)
4446
} else if (ngx_strncmp(salt, "{SSHA}", sizeof("{SSHA}") - 1) == 0) {
4547
return ngx_crypt_ssha(pool, key, salt, encrypted);
48+
49+
} else if (ngx_strncmp(salt, "{SHA}", sizeof("{SHA}") - 1) == 0) {
50+
return ngx_crypt_sha(pool, key, salt, encrypted);
4651
#endif
4752
}
4853

@@ -241,6 +246,38 @@ ngx_crypt_ssha(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted)
241246
return NGX_OK;
242247
}
243248

249+
250+
static ngx_int_t
251+
ngx_crypt_sha(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted)
252+
{
253+
size_t len;
254+
ngx_str_t encoded, decoded;
255+
ngx_sha1_t sha1;
256+
u_char digest[20];
257+
258+
/* "{SHA}" base64(SHA1(key)) */
259+
260+
decoded.len = sizeof(digest);
261+
decoded.data = digest;
262+
263+
ngx_sha1_init(&sha1);
264+
ngx_sha1_update(&sha1, key, ngx_strlen(key));
265+
ngx_sha1_final(digest, &sha1);
266+
267+
len = sizeof("{SHA}") - 1 + ngx_base64_encoded_length(decoded.len) + 1;
268+
269+
*encrypted = ngx_pnalloc(pool, len);
270+
if (*encrypted == NULL) {
271+
return NGX_ERROR;
272+
}
273+
274+
encoded.data = ngx_cpymem(*encrypted, "{SHA}", sizeof("{SHA}") - 1);
275+
ngx_encode_base64(&encoded, &decoded);
276+
encoded.data[encoded.len] = '\0';
277+
278+
return NGX_OK;
279+
}
280+
244281
#endif /* NGX_HAVE_SHA1 */
245282

246283
#endif /* NGX_CRYPT */

src/http/modules/ngx_http_autoindex_module.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,11 @@ ngx_http_autoindex_handler(ngx_http_request_t *r)
489489
}
490490

491491
b->last = ngx_cpymem(b->last, "</a>", sizeof("</a>") - 1);
492-
ngx_memset(b->last, ' ', NGX_HTTP_AUTOINDEX_NAME_LEN - len);
493-
b->last += NGX_HTTP_AUTOINDEX_NAME_LEN - len;
492+
493+
if (NGX_HTTP_AUTOINDEX_NAME_LEN - len > 0) {
494+
ngx_memset(b->last, ' ', NGX_HTTP_AUTOINDEX_NAME_LEN - len);
495+
b->last += NGX_HTTP_AUTOINDEX_NAME_LEN - len;
496+
}
494497
}
495498

496499
*b->last++ = ' ';

src/http/modules/ngx_http_chunked_filter_module.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ ngx_http_chunked_header_filter(ngx_http_request_t *r)
6262

6363
if (r->headers_out.status == NGX_HTTP_NOT_MODIFIED
6464
|| r->headers_out.status == NGX_HTTP_NO_CONTENT
65+
|| r->headers_out.status < NGX_HTTP_OK
6566
|| r != r->main
6667
|| (r->method & NGX_HTTP_HEAD))
6768
{

src/http/modules/ngx_http_proxy_module.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,6 +1474,14 @@ ngx_http_proxy_process_header(ngx_http_request_t *r)
14741474
u->keepalive = !u->headers_in.connection_close;
14751475
}
14761476

1477+
if (u->headers_in.status_n == NGX_HTTP_SWITCHING_PROTOCOLS) {
1478+
u->keepalive = 0;
1479+
1480+
if (r->headers_in.upgrade) {
1481+
u->upgrade = 1;
1482+
}
1483+
}
1484+
14771485
return NGX_OK;
14781486
}
14791487

src/http/modules/perl/nginx.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ our @EXPORT = qw(
5050
HTTP_INSUFFICIENT_STORAGE
5151
);
5252

53-
our $VERSION = '1.3.12';
53+
our $VERSION = '1.3.13';
5454

5555
require XSLoader;
5656
XSLoader::load('nginx', $VERSION);

0 commit comments

Comments
 (0)