diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2020-05-14 02:03:14 -0400 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2020-07-08 22:51:31 -0400 |
commit | bf4054f8ecb7ce88118a4e3631a617dba0600da0 (patch) | |
tree | f4b3833a06711dae5e39e9422f4db019a3c1e40d /src/mod_authn_file.c | |
parent | 68d626fa9fe44dd08026727442210f3ba0a71e9f (diff) | |
download | lighttpd-git-bf4054f8ecb7ce88118a4e3631a617dba0600da0.tar.gz |
[mod_gnutls] GnuTLS option for TLS (fixes #109)
(experimental)
mod_gnutls supports most ssl.* config options supported by mod_openssl
x-ref:
"GnuTLS support for the mod_ssl"
https://redmine.lighttpd.net/issues/109
Diffstat (limited to 'src/mod_authn_file.c')
-rw-r--r-- | src/mod_authn_file.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mod_authn_file.c b/src/mod_authn_file.c index 7d8de7b2..bbad3b12 100644 --- a/src/mod_authn_file.c +++ b/src/mod_authn_file.c @@ -95,6 +95,24 @@ SHA256_Update(SHA256_CTX *ctx, const void *data, size_t length) #include <openssl/md4.h> #include <openssl/sha.h> +#elif defined(USE_GNUTLS_CRYPTO) + +#include <gnutls/crypto.h> +#define NO_MD4 +typedef gnutls_hash_hd_t SHA256_CTX; +#define SHA256_Init(ctx) \ + do { \ + if (gnutls_hash_init((ctx), GNUTLS_DIG_SHA256) < 0) \ + SEGFAULT(); \ + } while (0) +#define SHA256_Final(digest, ctx) \ + gnutls_hash_deinit(*(ctx),(digest)) +static void +SHA256_Update(SHA256_CTX *ctx, const void *data, size_t length) +{ + gnutls_hash(*ctx, data, length); +} + #endif #endif /* USE_LIB_CRYPTO */ |