Mercurial > hg > nginx-vendor-current
diff src/core/ngx_md5.c @ 630:ad6fee8052d7 NGINX_1_0_5
nginx 1.0.5
*) Change: now default SSL ciphers are "HIGH:!aNULL:!MD5".
Thanks to Rob Stradling.
*) Feature: the "referer_hash_max_size" and "referer_hash_bucket_size"
directives.
Thanks to Witold Filipczyk.
*) Feature: $uid_reset variable.
*) Bugfix: a segmentation fault might occur in a worker process, if a
caching was used.
Thanks to Lanshun Zhou.
*) Bugfix: worker processes may got caught in an endless loop during
reconfiguration, if a caching was used; the bug had appeared in
0.8.48.
Thanks to Maxim Dounin.
*) Bugfix: "stalled cache updating" alert.
Thanks to Maxim Dounin.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Tue, 19 Jul 2011 00:00:00 +0400 |
parents | 83b58b182b76 |
children | f200748c0ac8 |
line wrap: on
line diff
--- a/src/core/ngx_md5.c +++ b/src/core/ngx_md5.c @@ -36,7 +36,7 @@ ngx_md5_update(ngx_md5_t *ctx, const voi { size_t used, free; - used = ctx->bytes & 0x3f; + used = (size_t) (ctx->bytes & 0x3f); ctx->bytes += size; if (used) { @@ -66,7 +66,7 @@ ngx_md5_final(u_char result[16], ngx_md5 { size_t used, free; - used = ctx->bytes & 0x3f; + used = (size_t) (ctx->bytes & 0x3f); ctx->buffer[used++] = 0x80; @@ -82,33 +82,33 @@ ngx_md5_final(u_char result[16], ngx_md5 ngx_memzero(&ctx->buffer[used], free - 8); ctx->bytes <<= 3; - ctx->buffer[56] = ctx->bytes; - ctx->buffer[57] = ctx->bytes >> 8; - ctx->buffer[58] = ctx->bytes >> 16; - ctx->buffer[59] = ctx->bytes >> 24; - ctx->buffer[60] = ctx->bytes >> 32; - ctx->buffer[61] = ctx->bytes >> 40; - ctx->buffer[62] = ctx->bytes >> 48; - ctx->buffer[63] = ctx->bytes >> 56; + ctx->buffer[56] = (u_char) ctx->bytes; + ctx->buffer[57] = (u_char) (ctx->bytes >> 8); + ctx->buffer[58] = (u_char) (ctx->bytes >> 16); + ctx->buffer[59] = (u_char) (ctx->bytes >> 24); + ctx->buffer[60] = (u_char) (ctx->bytes >> 32); + ctx->buffer[61] = (u_char) (ctx->bytes >> 40); + ctx->buffer[62] = (u_char) (ctx->bytes >> 48); + ctx->buffer[63] = (u_char) (ctx->bytes >> 56); (void) ngx_md5_body(ctx, ctx->buffer, 64); - result[0] = ctx->a; - result[1] = ctx->a >> 8; - result[2] = ctx->a >> 16; - result[3] = ctx->a >> 24; - result[4] = ctx->b; - result[5] = ctx->b >> 8; - result[6] = ctx->b >> 16; - result[7] = ctx->b >> 24; - result[8] = ctx->c; - result[9] = ctx->c >> 8; - result[10] = ctx->c >> 16; - result[11] = ctx->c >> 24; - result[12] = ctx->d; - result[13] = ctx->d >> 8; - result[14] = ctx->d >> 16; - result[15] = ctx->d >> 24; + result[0] = (u_char) ctx->a; + result[1] = (u_char) (ctx->a >> 8); + result[2] = (u_char) (ctx->a >> 16); + result[3] = (u_char) (ctx->a >> 24); + result[4] = (u_char) ctx->b; + result[5] = (u_char) (ctx->b >> 8); + result[6] = (u_char) (ctx->b >> 16); + result[7] = (u_char) (ctx->b >> 24); + result[8] = (u_char) ctx->c; + result[9] = (u_char) (ctx->c >> 8); + result[10] = (u_char) (ctx->c >> 16); + result[11] = (u_char) (ctx->c >> 24); + result[12] = (u_char) ctx->d; + result[13] = (u_char) (ctx->d >> 8); + result[14] = (u_char) (ctx->d >> 16); + result[15] = (u_char) (ctx->d >> 24); ngx_memzero(ctx, sizeof(*ctx)); }