342
|
1
|
|
2 /*
|
|
3 * Copyright (C) Igor Sysoev
|
|
4 */
|
|
5
|
|
6
|
|
7 #ifndef _NGX_MD5_H_INCLUDED_
|
|
8 #define _NGX_MD5_H_INCLUDED_
|
|
9
|
|
10
|
|
11 #include <ngx_config.h>
|
|
12 #include <ngx_core.h>
|
|
13
|
|
14
|
622
|
15 #if (NGX_HAVE_MD5)
|
|
16
|
342
|
17 #if (NGX_HAVE_OPENSSL_MD5_H)
|
|
18 #include <openssl/md5.h>
|
|
19 #else
|
|
20 #include <md5.h>
|
|
21 #endif
|
|
22
|
|
23
|
|
24 typedef MD5_CTX ngx_md5_t;
|
|
25
|
|
26
|
|
27 #if (NGX_OPENSSL_MD5)
|
|
28
|
344
|
29 #define ngx_md5_init MD5_Init
|
|
30 #define ngx_md5_update MD5_Update
|
|
31 #define ngx_md5_final MD5_Final
|
342
|
32
|
|
33 #else
|
|
34
|
344
|
35 #define ngx_md5_init MD5Init
|
|
36 #define ngx_md5_update MD5Update
|
|
37 #define ngx_md5_final MD5Final
|
342
|
38
|
|
39 #endif
|
|
40
|
|
41
|
622
|
42 #else /* !NGX_HAVE_MD5 */
|
|
43
|
|
44
|
|
45 typedef struct {
|
|
46 uint64_t bytes;
|
|
47 uint32_t a, b, c, d;
|
|
48 u_char buffer[64];
|
|
49 } ngx_md5_t;
|
|
50
|
|
51
|
|
52 void ngx_md5_init(ngx_md5_t *ctx);
|
628
|
53 void ngx_md5_update(ngx_md5_t *ctx, const void *data, size_t size);
|
622
|
54 void ngx_md5_final(u_char result[16], ngx_md5_t *ctx);
|
|
55
|
|
56
|
|
57 #endif
|
|
58
|
342
|
59 #endif /* _NGX_MD5_H_INCLUDED_ */
|