diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2018-10-06 13:21:03 -0400 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2018-10-07 20:10:14 -0400 |
commit | e9f223d35e523f4f7aa7173c1c51bee1769f7178 (patch) | |
tree | 8347c150b9345a49e21f322e057c8ef9af633603 /src/mod_authn_file.c | |
parent | d825966739c869eac7f5e5613fed986adf673467 (diff) | |
download | lighttpd-git-e9f223d35e523f4f7aa7173c1c51bee1769f7178.tar.gz |
[mod_auth] use SHA1_Init,Update,Final
wolfSSL does not provide the SHA1() convenience function,
so use stepwise funcs SHA1_Init(), SHA1_Update(), SHA1_Final()
Diffstat (limited to 'src/mod_authn_file.c')
-rw-r--r-- | src/mod_authn_file.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mod_authn_file.c b/src/mod_authn_file.c index 1a5dc1f9..4c9afa6e 100644 --- a/src/mod_authn_file.c +++ b/src/mod_authn_file.c @@ -595,8 +595,11 @@ static void apr_md5_encode(const char *pw, const char *salt, char *result, size_ static void apr_sha_encode(const char *pw, char *result, size_t nbytes) { unsigned char digest[20]; size_t base64_written; + SHA_CTX sha1; - SHA1((const unsigned char*) pw, strlen(pw), digest); + SHA1_Init(&sha1); + SHA1_Update(&sha1, (const unsigned char *) pw, strlen(pw)); + SHA1_Final(digest, &sha1); memset(result, 0, nbytes); |