Mercurial > hg > nginx
diff src/core/ngx_crypt.c @ 6586:1064ea81ed3a
An internal SHA1 implementation.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 09 Jun 2016 16:55:38 +0300 |
parents | 2cd019520210 |
children |
line wrap: on
line diff
--- a/src/core/ngx_crypt.c Wed Jun 08 08:27:41 2016 +0300 +++ b/src/core/ngx_crypt.c Thu Jun 09 16:55:38 2016 +0300 @@ -8,9 +8,7 @@ #include <ngx_core.h> #include <ngx_crypt.h> #include <ngx_md5.h> -#if (NGX_HAVE_SHA1) #include <ngx_sha1.h> -#endif #if (NGX_CRYPT) @@ -19,16 +17,11 @@ u_char **encrypted); static ngx_int_t ngx_crypt_plain(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted); - -#if (NGX_HAVE_SHA1) - static ngx_int_t ngx_crypt_ssha(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted); static ngx_int_t ngx_crypt_sha(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted); -#endif - static u_char *ngx_crypt_to64(u_char *p, uint32_t v, size_t n); @@ -42,13 +35,11 @@ } else if (ngx_strncmp(salt, "{PLAIN}", sizeof("{PLAIN}") - 1) == 0) { return ngx_crypt_plain(pool, key, salt, encrypted); -#if (NGX_HAVE_SHA1) } else if (ngx_strncmp(salt, "{SSHA}", sizeof("{SSHA}") - 1) == 0) { return ngx_crypt_ssha(pool, key, salt, encrypted); } else if (ngx_strncmp(salt, "{SHA}", sizeof("{SHA}") - 1) == 0) { return ngx_crypt_sha(pool, key, salt, encrypted); -#endif } /* fallback to libc crypt() */ @@ -193,8 +184,6 @@ } -#if (NGX_HAVE_SHA1) - static ngx_int_t ngx_crypt_ssha(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted) { @@ -278,6 +267,4 @@ return NGX_OK; } -#endif /* NGX_HAVE_SHA1 */ - #endif /* NGX_CRYPT */