Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nginx-accesskey
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵剑雄
nginx-accesskey
Commits
2940513c
Commit
2940513c
authored
Apr 27, 2017
by
Martchus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make compatible with nginx 1.12.0
parent
fb6735ff
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
29 deletions
+13
-29
ngx_http_accesskey_module.c
ngx_http_accesskey_module.c
+13
-29
No files found.
ngx_http_accesskey_module.c
View file @
2940513c
...
...
@@ -7,24 +7,8 @@
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
#if (NGX_HAVE_OPENSSL_MD5_H)
#include <openssl/md5.h>
#else
#include <md5.h>
#endif
#if (NGX_OPENSSL_MD5)
#define MD5Init MD5_Init
#define MD5Update MD5_Update
#define MD5Final MD5_Final
#endif
#if (NGX_HAVE_OPENSSL_SHA1_H)
#include <openssl/sha.h>
#else
#include <sha.h>
#endif
#include <ngx_md5.h>
#include <ngx_sha1.h>
#define NGX_ACCESSKEY_MD5 1
#define NGX_ACCESSKEY_SHA1 2
...
...
@@ -185,19 +169,19 @@ ngx_http_accesskey_handler(ngx_http_request_t *r)
u_char
hashb
[
64
],
hasht
[
128
];
MD5_CTX
md5
;
SHA_CTX
sha
;
ngx_md5_t
md5
;
ngx_sha1_t
sha
;
switch
(
alcf
->
hashmethod
)
{
case
NGX_ACCESSKEY_MD5
:
MD5I
nit
(
&
md5
);
MD5U
pdate
(
&
md5
,
val
.
data
,
val
.
len
);
MD5F
inal
(
hashb
,
&
md5
);
ngx_md5_i
nit
(
&
md5
);
ngx_md5_u
pdate
(
&
md5
,
val
.
data
,
val
.
len
);
ngx_md5_f
inal
(
hashb
,
&
md5
);
break
;
case
NGX_ACCESSKEY_SHA1
:
SHA1_I
nit
(
&
sha
);
SHA1_U
pdate
(
&
sha
,
val
.
data
,
val
.
len
);
SHA1_F
inal
(
hashb
,
&
sha
);
ngx_sha1_i
nit
(
&
sha
);
ngx_sha1_u
pdate
(
&
sha
,
val
.
data
,
val
.
len
);
ngx_sha1_f
inal
(
hashb
,
&
sha
);
break
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment