diff options
Diffstat (limited to 'src/core/ngx_sha1.h')
-rw-r--r-- | src/core/ngx_sha1.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/core/ngx_sha1.h b/src/core/ngx_sha1.h index 81c909e2f..7fe4c9887 100644 --- a/src/core/ngx_sha1.h +++ b/src/core/ngx_sha1.h @@ -13,6 +13,8 @@ #include <ngx_core.h> +#if (NGX_HAVE_SHA1) + #if (NGX_HAVE_OPENSSL_SHA1_H) #include <openssl/sha.h> #else @@ -28,4 +30,21 @@ typedef SHA_CTX ngx_sha1_t; #define ngx_sha1_final SHA1_Final +#else /* !NGX_HAVE_SHA1 */ + + +typedef struct { + uint64_t bytes; + uint32_t a, b, c, d, e, f; + u_char buffer[64]; +} ngx_sha1_t; + + +void ngx_sha1_init(ngx_sha1_t *ctx); +void ngx_sha1_update(ngx_sha1_t *ctx, const void *data, size_t size); +void ngx_sha1_final(u_char result[20], ngx_sha1_t *ctx); + + +#endif + #endif /* _NGX_SHA1_H_INCLUDED_ */ |