mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
digest: only if we have tls lib to do hashing
This commit is contained in:
parent
1239a2b121
commit
378ad62adf
2 changed files with 6 additions and 2 deletions
|
@ -51,6 +51,8 @@ enum lws_genhmac_types {
|
|||
|
||||
#define LWS_GENHASH_LARGEST 64
|
||||
|
||||
#if defined(LWS_WITH_TLS) && defined(LWS_WITH_GENCRYPTO)
|
||||
|
||||
struct lws_genhash_ctx {
|
||||
uint8_t type;
|
||||
#if defined(LWS_WITH_MBEDTLS)
|
||||
|
@ -186,4 +188,6 @@ lws_genhmac_update(struct lws_genhmac_ctx *ctx, const void *in, size_t len);
|
|||
*/
|
||||
LWS_VISIBLE LWS_EXTERN int
|
||||
lws_genhmac_destroy(struct lws_genhmac_ctx *ctx, void *result);
|
||||
|
||||
#endif
|
||||
///@}
|
||||
|
|
|
@ -580,7 +580,7 @@ lws_http_client_http_response(struct lws *wsi)
|
|||
#endif
|
||||
|
||||
|
||||
#if defined(LWS_WITH_HTTP_DIGEST_AUTH)
|
||||
#if defined(LWS_WITH_HTTP_DIGEST_AUTH) && defined(LWS_WITH_TLS)
|
||||
|
||||
static const char *digest_toks[] = {
|
||||
"Digest", // 1 << 0
|
||||
|
@ -1047,7 +1047,7 @@ lws_client_interpret_server_handshake(struct lws *wsi)
|
|||
#endif
|
||||
n = atoi(p);
|
||||
|
||||
#if defined(LWS_WITH_HTTP_DIGEST_AUTH)
|
||||
#if defined(LWS_WITH_HTTP_DIGEST_AUTH) && defined(LWS_WITH_TLS)
|
||||
if (n == 401 && lws_hdr_simple_ptr(wsi, WSI_TOKEN_HTTP_WWW_AUTHENTICATE)) {
|
||||
if (!(wsi->stash && wsi->stash->cis[CIS_USERNAME] &&
|
||||
wsi->stash->cis[CIS_PASSWORD])) {
|
||||
|
|
Loading…
Add table
Reference in a new issue