Mercurial > hg > nginx-vendor-current
comparison src/core/ngx_crypt.c @ 628:83b58b182b76 NGINX_1_0_4
nginx 1.0.4
*) Change: now regular expressions case sensitivity in the "map"
directive is given by prefixes "~" or "~*".
*) Feature: now shared zones and caches use POSIX semaphores on Linux.
Thanks to Denis F. Latypoff.
*) Bugfix: "stalled" cache updating" alert.
*) Bugfix: nginx could not be built --without-http_auth_basic_module;
the bug had appeared in 1.0.3.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Wed, 01 Jun 2011 00:00:00 +0400 |
parents | a7a5fa2e395b |
children | 5cb5db9975ba |
comparison
equal
deleted
inserted
replaced
627:a63a292c61af | 628:83b58b182b76 |
---|---|
9 #include <ngx_md5.h> | 9 #include <ngx_md5.h> |
10 #if (NGX_HAVE_SHA1) | 10 #if (NGX_HAVE_SHA1) |
11 #include <ngx_sha1.h> | 11 #include <ngx_sha1.h> |
12 #endif | 12 #endif |
13 | 13 |
14 | |
15 #if (NGX_CRYPT) | |
14 | 16 |
15 static ngx_int_t ngx_crypt_apr1(ngx_pool_t *pool, u_char *key, u_char *salt, | 17 static ngx_int_t ngx_crypt_apr1(ngx_pool_t *pool, u_char *key, u_char *salt, |
16 u_char **encrypted); | 18 u_char **encrypted); |
17 static ngx_int_t ngx_crypt_plain(ngx_pool_t *pool, u_char *key, u_char *salt, | 19 static ngx_int_t ngx_crypt_plain(ngx_pool_t *pool, u_char *key, u_char *salt, |
18 u_char **encrypted); | 20 u_char **encrypted); |
71 | 73 |
72 /* hash key and salt */ | 74 /* hash key and salt */ |
73 | 75 |
74 ngx_md5_init(&md5); | 76 ngx_md5_init(&md5); |
75 ngx_md5_update(&md5, key, keylen); | 77 ngx_md5_update(&md5, key, keylen); |
76 ngx_md5_update(&md5, "$apr1$", sizeof("$apr1$") - 1); | 78 ngx_md5_update(&md5, (u_char *) "$apr1$", sizeof("$apr1$") - 1); |
77 ngx_md5_update(&md5, salt, saltlen); | 79 ngx_md5_update(&md5, salt, saltlen); |
78 | 80 |
79 ngx_md5_init(&ctx1); | 81 ngx_md5_init(&ctx1); |
80 ngx_md5_update(&ctx1, key, keylen); | 82 ngx_md5_update(&ctx1, key, keylen); |
81 ngx_md5_update(&ctx1, salt, saltlen); | 83 ngx_md5_update(&ctx1, salt, saltlen); |
230 | 232 |
231 return NGX_OK; | 233 return NGX_OK; |
232 } | 234 } |
233 | 235 |
234 #endif /* NGX_HAVE_SHA1 */ | 236 #endif /* NGX_HAVE_SHA1 */ |
237 | |
238 #endif /* NGX_CRYPT */ |