HTTP authentication. More...
#include "core/net.h"
#include "http/http_server.h"
#include "http/http_server_auth.h"
#include "http/http_server_misc.h"
#include "str.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL HTTP_TRACE_LEVEL |
Functions | |
bool_t | httpCheckPassword (HttpConnection *connection, const char_t *password, HttpAuthMode mode) |
Password verification. More... | |
void | httpParseAuthorizationField (HttpConnection *connection, char_t *value) |
Parse Authorization header field. More... | |
size_t | httpAddAuthenticateField (HttpConnection *connection, char_t *output) |
Format WWW-Authenticate header field. More... | |
error_t | httpGenerateNonce (HttpServerContext *context, char_t *output, size_t *length) |
Nonce generation. More... | |
error_t | httpVerifyNonce (HttpServerContext *context, const char_t *nonce, const char_t *nc) |
Nonce verification. More... | |
Detailed Description
HTTP authentication.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.4.4
Definition in file http_server_auth.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL HTTP_TRACE_LEVEL |
Definition at line 32 of file http_server_auth.c.
Function Documentation
◆ httpAddAuthenticateField()
size_t httpAddAuthenticateField | ( | HttpConnection * | connection, |
char_t * | output | ||
) |
Format WWW-Authenticate header field.
- Parameters
-
[in] connection Structure representing an HTTP connection [out] output Buffer where to format the header field
- Returns
- Total length of the header field
Definition at line 399 of file http_server_auth.c.
◆ httpCheckPassword()
bool_t httpCheckPassword | ( | HttpConnection * | connection, |
const char_t * | password, | ||
HttpAuthMode | mode | ||
) |
Password verification.
- Parameters
-
[in] connection Structure representing an HTTP connection [in] password NULL-terminated string containing the password to be checked [in] mode HTTP authentication scheme to be used. Acceptable values are HTTP_AUTH_MODE_BASIC or HTTP_AUTH_MODE_DIGEST
- Returns
- TRUE if the password is valid, else FALSE
Definition at line 55 of file http_server_auth.c.
◆ httpGenerateNonce()
error_t httpGenerateNonce | ( | HttpServerContext * | context, |
char_t * | output, | ||
size_t * | length | ||
) |
Nonce generation.
- Parameters
-
[in] context Pointer to the HTTP server context [in] output NULL-terminated string containing the nonce [in] length NULL-terminated string containing the nonce count
- Returns
- Error code
Definition at line 494 of file http_server_auth.c.
◆ httpParseAuthorizationField()
void httpParseAuthorizationField | ( | HttpConnection * | connection, |
char_t * | value | ||
) |
Parse Authorization header field.
- Parameters
-
[in] connection Structure representing an HTTP connection [in] value Authorization field value
Definition at line 197 of file http_server_auth.c.
◆ httpVerifyNonce()
error_t httpVerifyNonce | ( | HttpServerContext * | context, |
const char_t * | nonce, | ||
const char_t * | nc | ||
) |
Nonce verification.
- Parameters
-
[in] context Pointer to the HTTP server context [in] nonce NULL-terminated string containing the nonce [in] nc NULL-terminated string containing the nonce count
- Returns
- Error code
Definition at line 586 of file http_server_auth.c.