Mercurial > hg > nginx-quic
annotate src/core/ngx_md5.h @ 4192:61e4af19df9f
Autoindex: escape '?' in file names.
For files with '?' in their names autoindex generated links with '?' not
escaped. This resulted in effectively truncated links as '?' indicates
query string start.
This is an updated version of the patch originally posted at [1]. It
introduces generic NGX_ESCAPE_URI_COMPONENT which escapes everything but
unreserved characters as per RFC 3986. This approach also renders unneeded
special colon processing (as colon is percent-encoded now), it's dropped
accordingly.
[1] http://nginx.org/pipermail/nginx-devel/2010-February/000112.html
Reported by Konstantin Leonov.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 11 Oct 2011 17:56:51 +0000 |
parents | 38e6f45c5e3d |
children | d620f497c50f |
rev | line source |
---|---|
1572 | 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 | |
3895
b659514a3948
an internal MD5 implemenation
Igor Sysoev <igor@sysoev.ru>
parents:
1598
diff
changeset
|
15 #if (NGX_HAVE_MD5) |
b659514a3948
an internal MD5 implemenation
Igor Sysoev <igor@sysoev.ru>
parents:
1598
diff
changeset
|
16 |
1572 | 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 | |
1598 | 29 #define ngx_md5_init MD5_Init |
30 #define ngx_md5_update MD5_Update | |
31 #define ngx_md5_final MD5_Final | |
1572 | 32 |
33 #else | |
34 | |
1598 | 35 #define ngx_md5_init MD5Init |
36 #define ngx_md5_update MD5Update | |
37 #define ngx_md5_final MD5Final | |
1572 | 38 |
39 #endif | |
40 | |
41 | |
3895
b659514a3948
an internal MD5 implemenation
Igor Sysoev <igor@sysoev.ru>
parents:
1598
diff
changeset
|
42 #else /* !NGX_HAVE_MD5 */ |
b659514a3948
an internal MD5 implemenation
Igor Sysoev <igor@sysoev.ru>
parents:
1598
diff
changeset
|
43 |
b659514a3948
an internal MD5 implemenation
Igor Sysoev <igor@sysoev.ru>
parents:
1598
diff
changeset
|
44 |
b659514a3948
an internal MD5 implemenation
Igor Sysoev <igor@sysoev.ru>
parents:
1598
diff
changeset
|
45 typedef struct { |
b659514a3948
an internal MD5 implemenation
Igor Sysoev <igor@sysoev.ru>
parents:
1598
diff
changeset
|
46 uint64_t bytes; |
b659514a3948
an internal MD5 implemenation
Igor Sysoev <igor@sysoev.ru>
parents:
1598
diff
changeset
|
47 uint32_t a, b, c, d; |
b659514a3948
an internal MD5 implemenation
Igor Sysoev <igor@sysoev.ru>
parents:
1598
diff
changeset
|
48 u_char buffer[64]; |
b659514a3948
an internal MD5 implemenation
Igor Sysoev <igor@sysoev.ru>
parents:
1598
diff
changeset
|
49 } ngx_md5_t; |
b659514a3948
an internal MD5 implemenation
Igor Sysoev <igor@sysoev.ru>
parents:
1598
diff
changeset
|
50 |
b659514a3948
an internal MD5 implemenation
Igor Sysoev <igor@sysoev.ru>
parents:
1598
diff
changeset
|
51 |
b659514a3948
an internal MD5 implemenation
Igor Sysoev <igor@sysoev.ru>
parents:
1598
diff
changeset
|
52 void ngx_md5_init(ngx_md5_t *ctx); |
3927
38e6f45c5e3d
make built-in ngx_md5_update() interface consistent with other implemenations
Igor Sysoev <igor@sysoev.ru>
parents:
3895
diff
changeset
|
53 void ngx_md5_update(ngx_md5_t *ctx, const void *data, size_t size); |
3895
b659514a3948
an internal MD5 implemenation
Igor Sysoev <igor@sysoev.ru>
parents:
1598
diff
changeset
|
54 void ngx_md5_final(u_char result[16], ngx_md5_t *ctx); |
b659514a3948
an internal MD5 implemenation
Igor Sysoev <igor@sysoev.ru>
parents:
1598
diff
changeset
|
55 |
b659514a3948
an internal MD5 implemenation
Igor Sysoev <igor@sysoev.ru>
parents:
1598
diff
changeset
|
56 |
b659514a3948
an internal MD5 implemenation
Igor Sysoev <igor@sysoev.ru>
parents:
1598
diff
changeset
|
57 #endif |
b659514a3948
an internal MD5 implemenation
Igor Sysoev <igor@sysoev.ru>
parents:
1598
diff
changeset
|
58 |
1572 | 59 #endif /* _NGX_MD5_H_INCLUDED_ */ |