mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-27 04:09:31 +03:00
Created basicauth.h header
This commit is contained in:
@@ -171,7 +171,7 @@ endif
|
||||
|
||||
if ENABLE_BAUTH
|
||||
libmicrohttpd_la_SOURCES += \
|
||||
basicauth.c \
|
||||
basicauth.c basicauth.h \
|
||||
base64.c base64.h
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
This file is part of libmicrohttpd
|
||||
Copyright (C) 2010, 2011, 2012 Daniel Pittman and Christian Grothoff
|
||||
Copyright (C) 2014-2022 Evgeny Grin (Karlson2k)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
@@ -21,18 +22,15 @@
|
||||
* @brief Implements HTTP basic authentication methods
|
||||
* @author Amr Ali
|
||||
* @author Matthieu Speder
|
||||
* @author Karlson2k (Evgeny Grin)
|
||||
*/
|
||||
#include "basicauth.h"
|
||||
#include "platform.h"
|
||||
#include "mhd_limits.h"
|
||||
#include "internal.h"
|
||||
#include "base64.h"
|
||||
#include "mhd_compat.h"
|
||||
|
||||
/**
|
||||
* Beginning string for any valid Basic authentication header.
|
||||
*/
|
||||
#define _BASIC_BASE "Basic "
|
||||
|
||||
|
||||
/**
|
||||
* Get the username and password from the basic authorization header sent by the client
|
||||
@@ -60,10 +58,10 @@ MHD_basic_auth_get_username_password (struct MHD_Connection *connection,
|
||||
&header,
|
||||
NULL)) ||
|
||||
(0 != strncmp (header,
|
||||
_BASIC_BASE,
|
||||
MHD_STATICSTR_LEN_ (_BASIC_BASE))) )
|
||||
_MHD_AUTH_BASIC_BASE,
|
||||
MHD_STATICSTR_LEN_ (_MHD_AUTH_BASIC_BASE))) )
|
||||
return NULL;
|
||||
header += MHD_STATICSTR_LEN_ (_BASIC_BASE);
|
||||
header += MHD_STATICSTR_LEN_ (_MHD_AUTH_BASIC_BASE);
|
||||
if (NULL == (decode = BASE64Decode (header)))
|
||||
{
|
||||
#ifdef HAVE_MESSAGES
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
This file is part of libmicrohttpd
|
||||
Copyright (C) 2010, 2011, 2012 Daniel Pittman and Christian Grothoff
|
||||
Copyright (C) 2014-2022 Evgeny Grin (Karlson2k)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
/**
|
||||
* @file basicauth.c
|
||||
* @brief Implements HTTP basic authentication methods
|
||||
* @author Amr Ali
|
||||
* @author Matthieu Speder
|
||||
* @author Karlson2k (Evgeny Grin)
|
||||
*/
|
||||
|
||||
#ifndef MHD_BASICAUTH_H
|
||||
#define MHD_BASICAUTH_H 1
|
||||
|
||||
/**
|
||||
* Beginning string for any valid Basic authentication header.
|
||||
*/
|
||||
#define _MHD_AUTH_BASIC_BASE "Basic "
|
||||
|
||||
#endif /* ! MHD_BASICAUTH_H */
|
||||
|
||||
/* end of basicauth.h */
|
||||
@@ -32,6 +32,7 @@
|
||||
<ClInclude Include="$(MhdSrc)include\mhd_options.h" />
|
||||
<ClInclude Include="$(MhdSrc)include\platform.h" />
|
||||
<ClInclude Include="$(MhdSrc)microhttpd\base64.h" />
|
||||
<ClInclude Include="$(MhdSrc)microhttpd\basicauth.h" />
|
||||
<ClInclude Include="$(MhdSrc)microhttpd\connection.h" />
|
||||
<ClInclude Include="$(MhdSrc)microhttpd\internal.h" />
|
||||
<ClInclude Include="$(MhdSrc)microhttpd\md5.h" />
|
||||
|
||||
@@ -43,6 +43,9 @@
|
||||
<ClInclude Include="$(MhdSrc)microhttpd\base64.h">
|
||||
<Filter>Internal Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(MhdSrc)microhttpd\basicauth.h">
|
||||
<Filter>Internal Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(MhdSrc)microhttpd\connection.h">
|
||||
<Filter>Internal Headers</Filter>
|
||||
</ClInclude>
|
||||
|
||||
Reference in New Issue
Block a user