[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 01/06: Created basicauth.h header
From: |
gnunet |
Subject: |
[libmicrohttpd] 01/06: Created basicauth.h header |
Date: |
Sat, 28 May 2022 18:56:33 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 223013b2e70dfcf4f2fe529224fec10ee5272aa2
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Wed May 18 12:07:26 2022 +0300
Created basicauth.h header
---
src/microhttpd/Makefile.am | 2 +-
src/microhttpd/basicauth.c | 14 +++++-------
src/microhttpd/basicauth.h | 38 ++++++++++++++++++++++++++++++++
w32/common/libmicrohttpd-files.vcxproj | 1 +
w32/common/libmicrohttpd-filters.vcxproj | 3 +++
5 files changed, 49 insertions(+), 9 deletions(-)
diff --git a/src/microhttpd/Makefile.am b/src/microhttpd/Makefile.am
index 8db55a9a..791c2a1b 100644
--- a/src/microhttpd/Makefile.am
+++ b/src/microhttpd/Makefile.am
@@ -171,7 +171,7 @@ endif
if ENABLE_BAUTH
libmicrohttpd_la_SOURCES += \
- basicauth.c \
+ basicauth.c basicauth.h \
base64.c base64.h
endif
diff --git a/src/microhttpd/basicauth.c b/src/microhttpd/basicauth.c
index b739652e..9ef26dca 100644
--- a/src/microhttpd/basicauth.c
+++ b/src/microhttpd/basicauth.c
@@ -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
diff --git a/src/microhttpd/basicauth.h b/src/microhttpd/basicauth.h
new file mode 100644
index 00000000..c3ba4a4b
--- /dev/null
+++ b/src/microhttpd/basicauth.h
@@ -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 */
diff --git a/w32/common/libmicrohttpd-files.vcxproj
b/w32/common/libmicrohttpd-files.vcxproj
index e4b6eb14..1a662755 100644
--- a/w32/common/libmicrohttpd-files.vcxproj
+++ b/w32/common/libmicrohttpd-files.vcxproj
@@ -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" />
diff --git a/w32/common/libmicrohttpd-filters.vcxproj
b/w32/common/libmicrohttpd-filters.vcxproj
index fd19a0b0..f91d860d 100644
--- a/w32/common/libmicrohttpd-filters.vcxproj
+++ b/w32/common/libmicrohttpd-filters.vcxproj
@@ -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>
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (b1fff186 -> 435cd008), gnunet, 2022/05/28
- [libmicrohttpd] 04/06: connection_alloc_memory_(): made function non-static, gnunet, 2022/05/28
- [libmicrohttpd] 02/06: Created digestauth.h header, gnunet, 2022/05/28
- [libmicrohttpd] 03/06: MHD_str_unquote(): added new internal function, gnunet, 2022/05/28
- [libmicrohttpd] 01/06: Created basicauth.h header,
gnunet <=
- [libmicrohttpd] 05/06: digestauth: reworked support for multiple digest algorithms, gnunet, 2022/05/28
- [libmicrohttpd] 06/06: test_basicauth: added new test, gnunet, 2022/05/28