[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 06/06: Removed Public Domain base64 decoding files
From: |
gnunet |
Subject: |
[libmicrohttpd] 06/06: Removed Public Domain base64 decoding files |
Date: |
Thu, 09 Jun 2022 15:56:21 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit eecdde2511e14c34173c9ac39cb5d8e600182f92
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Thu Jun 9 16:52:44 2022 +0300
Removed Public Domain base64 decoding files
---
src/microhttpd/Makefile.am | 3 +-
src/microhttpd/base64.c | 85 ----------------------------------------------
src/microhttpd/base64.h | 26 --------------
3 files changed, 1 insertion(+), 113 deletions(-)
diff --git a/src/microhttpd/Makefile.am b/src/microhttpd/Makefile.am
index f491f13b..11e4537c 100644
--- a/src/microhttpd/Makefile.am
+++ b/src/microhttpd/Makefile.am
@@ -175,8 +175,7 @@ endif
if ENABLE_BAUTH
libmicrohttpd_la_SOURCES += \
- basicauth.c basicauth.h \
- base64.c base64.h
+ basicauth.c basicauth.h
endif
if ENABLE_HTTPS
diff --git a/src/microhttpd/base64.c b/src/microhttpd/base64.c
deleted file mode 100644
index 3d2dd3f1..00000000
--- a/src/microhttpd/base64.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * This code implements the BASE64 algorithm.
- * This code is in the public domain; do with it what you wish.
- *
- * @file base64.c
- * @brief This code implements the BASE64 algorithm
- * @author Matthieu Speder
- * @author Karlson2k (Evgeny Grin): fixes and improvements
- */
-#include "mhd_options.h"
-#include <stdio.h>
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif /* HAVE_STDLIB_H */
-#include <string.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_STDDEF_H
-#include <stddef.h>
-#endif /* HAVE_STDDEF_H */
-#include "base64.h"
-
-static const char base64_digits[] =
-{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 62, 0, 0, 0, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- 0, 0, 0, -1, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
- 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, 0, 26,
- 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-
-
-char *
-BASE64Decode (const char *src,
- size_t in_len,
- size_t *out_len)
-{
- unsigned char *dest;
- char *result;
-
- if (in_len % 4)
- {
- /* Wrong base64 string length */
- return NULL;
- }
- dest = (unsigned char *) malloc (in_len / 4 * 3 + 1);
- result = (char *) dest;
- if (NULL == result)
- return NULL; /* out of memory */
- for (; 0 < in_len && 0 != *src; in_len -= 4)
- {
- char a = base64_digits[(unsigned char) *(src++)];
- char b = base64_digits[(unsigned char) *(src++)];
- char c = base64_digits[(unsigned char) *(src++)];
- char d = base64_digits[(unsigned char) *(src++)];
- if (((char) -1 == a) || (0 == a) || (0 == b) || (0 == c) || (0 == d))
- {
- free (result);
- return NULL;
- }
- *(dest++) = (unsigned char) (((unsigned char) a) << 2)
- | (unsigned char) ((((unsigned char) b) & 0x30) >> 4);
- if (c == (char) -1)
- break;
- *(dest++) = (unsigned char) ((((unsigned char) b) & 0x0f) << 4)
- | (unsigned char) ((((unsigned char) c) & 0x3c) >> 2);
- if (d == (char) -1)
- break;
- *(dest++) = (unsigned char) ((((unsigned char) c) & 0x03) << 6)
- | ((unsigned char) d);
- }
- *dest = 0;
- if (NULL != out_len)
- *out_len = (size_t) (dest - (unsigned char *) result);
- return result;
-}
-
-
-/* end of base64.c */
diff --git a/src/microhttpd/base64.h b/src/microhttpd/base64.h
deleted file mode 100644
index e5f11319..00000000
--- a/src/microhttpd/base64.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * This code implements the BASE64 algorithm.
- * This code is in the public domain; do with it what you wish.
- *
- * @file base64.c
- * @brief This code implements the BASE64 algorithm
- * @author Matthieu Speder
- */
-#ifndef BASE64_H
-#define BASE64_H
-
-#include "mhd_options.h"
-#ifdef HAVE_STDDEF_H
-#include <stddef.h>
-#elif defined(HAVE_STDLIB_H)
-#include <stdlib.h>
-#else
-#include <stdio.h>
-#endif
-
-char *
-BASE64Decode (const char *src,
- size_t in_len,
- size_t *out_len);
-
-#endif /* !BASE64_H */
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (3eb2fb6d -> eecdde25), gnunet, 2022/06/09
- [libmicrohttpd] 02/06: MHD_bin_to_hex(): fixed wrong return value (unused currently by MHD)., gnunet, 2022/06/09
- [libmicrohttpd] 01/06: mhd_str.h: fixed typo in doxy, gnunet, 2022/06/09
- [libmicrohttpd] 04/06: test_str_base64: added test for base64 decoding, gnunet, 2022/06/09
- [libmicrohttpd] 05/06: Basic Auth: switched to the internal Base64 decoding implementation, gnunet, 2022/06/09
- [libmicrohttpd] 03/06: Implemented base64 decoding with thorough checks for the input data validity, gnunet, 2022/06/09
- [libmicrohttpd] 06/06: Removed Public Domain base64 decoding files,
gnunet <=