فهرست منبع

more dead code elimination

Christian Grothoff 17 سال پیش
والد
کامیت
b83c672f3e

+ 1 - 1
doc/Doxyfile

@@ -5,7 +5,7 @@
 #---------------------------------------------------------------------------
 DOXYFILE_ENCODING      = UTF-8
 PROJECT_NAME           = "GNU libmicrohttpd"
-PROJECT_NUMBER         = 0.3.0
+PROJECT_NUMBER         = 0.4.0
 OUTPUT_DIRECTORY       = doc/doxygen/
 CREATE_SUBDIRS         = YES
 OUTPUT_LANGUAGE        = English

+ 0 - 1
src/daemon/daemon.c

@@ -34,7 +34,6 @@
 #include "connection_https.h"
 #include "gnutls_int.h"
 #include "gnutls_global.h"
-#include "auth_anon.h"
 #endif
 
 /**

+ 0 - 35
src/daemon/https/lgl/asnprintf.c

@@ -1,35 +0,0 @@
-/* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006 Free Software Foundation, Inc.
-
-   This program 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, 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 Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser 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.  */
-
-#include "MHD_config.h"
-
-/* Specification.  */
-#include "vasnprintf.h"
-
-#include <stdarg.h>
-
-char *
-asnprintf (char *resultbuf, size_t * lengthp, const char *format, ...)
-{
-  va_list args;
-  char *result;
-
-  va_start (args, format);
-  result = vasnprintf (resultbuf, lengthp, format, args);
-  va_end (args);
-  return result;
-}

+ 0 - 107
src/daemon/https/lgl/des.c

@@ -79,13 +79,6 @@
  *     unsigned char recoverd[8];
  *     MHD_gl_3des_ctx context;
  *
- *     // If you would like to use two 64bit keys, fill 'key1' and'key2'
- *     // then setup the encryption context:
- *     MHD_gl_3des_set2keys(&context, key1, key2);
- *
- *     // To use three 64bit keys with Triple-DES use:
- *     MHD_gl_3des_set3keys(&context, key1, key2, key3);
- *
  *     // Encrypting plaintext with Triple-DES
  *     MHD_gl_3des_ecb_encrypt(&context, plaintext, ciphertext);
  *
@@ -319,35 +312,6 @@ static const unsigned char weak_keys[64][8] = {
   {0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe}      /*w */
 };
 
-bool
-MHD_gl_des_is_weak_key (const char *key)
-{
-  char work[8];
-  int i, left, right, middle, cmp_result;
-
-  /* clear parity bits */
-  for (i = 0; i < 8; ++i)
-    work[i] = ((unsigned char) key[i]) & 0xfe;
-
-  /* binary search in the weak key table */
-  left = 0;
-  right = 63;
-  while (left <= right)
-    {
-      middle = (left + right) / 2;
-
-      if (!(cmp_result = memcmp (work, weak_keys[middle], 8)))
-        return -1;
-
-      if (cmp_result > 0)
-        left = middle + 1;
-      else
-        right = middle - 1;
-    }
-
-  return 0;
-}
-
 /*
  * Macro to swap bits across two words.
  */
@@ -531,17 +495,6 @@ MHD_gl_des_setkey (MHD_gl_des_ctx * ctx, const char *key)
     }
 }
 
-bool
-MHD_gl_des_makekey (MHD_gl_des_ctx * ctx, const char *key, size_t keylen)
-{
-  if (keylen != 8)
-    return false;
-
-  MHD_gl_des_setkey (ctx, key);
-
-  return !MHD_gl_des_is_weak_key (key);
-}
-
 void
 MHD_gl_des_ecb_crypt (MHD_gl_des_ctx * ctx, const char *_from, char *_to,
                       int mode)
@@ -565,54 +518,6 @@ READ_64BIT_DATA (from, left, right)
     DES_ROUND (right, left, work, keys) DES_ROUND (left, right, work, keys)
     FINAL_PERMUTATION (right, work, left) WRITE_64BIT_DATA (to, right, left)}
 
-void
-MHD_gl_3des_set2keys (MHD_gl_3des_ctx * ctx, const char *key1,
-                      const char *key2)
-{
-  int i;
-
-  des_key_schedule (key1, ctx->encrypt_subkeys);
-  des_key_schedule (key2, &(ctx->decrypt_subkeys[32]));
-
-  for (i = 0; i < 32; i += 2)
-    {
-      ctx->decrypt_subkeys[i] = ctx->encrypt_subkeys[30 - i];
-      ctx->decrypt_subkeys[i + 1] = ctx->encrypt_subkeys[31 - i];
-
-      ctx->encrypt_subkeys[i + 32] = ctx->decrypt_subkeys[62 - i];
-      ctx->encrypt_subkeys[i + 33] = ctx->decrypt_subkeys[63 - i];
-
-      ctx->encrypt_subkeys[i + 64] = ctx->encrypt_subkeys[i];
-      ctx->encrypt_subkeys[i + 65] = ctx->encrypt_subkeys[i + 1];
-
-      ctx->decrypt_subkeys[i + 64] = ctx->decrypt_subkeys[i];
-      ctx->decrypt_subkeys[i + 65] = ctx->decrypt_subkeys[i + 1];
-    }
-}
-
-void
-MHD_gl_3des_set3keys (MHD_gl_3des_ctx * ctx, const char *key1,
-                      const char *key2, const char *key3)
-{
-  int i;
-
-  des_key_schedule (key1, ctx->encrypt_subkeys);
-  des_key_schedule (key2, &(ctx->decrypt_subkeys[32]));
-  des_key_schedule (key3, &(ctx->encrypt_subkeys[64]));
-
-  for (i = 0; i < 32; i += 2)
-    {
-      ctx->decrypt_subkeys[i] = ctx->encrypt_subkeys[94 - i];
-      ctx->decrypt_subkeys[i + 1] = ctx->encrypt_subkeys[95 - i];
-
-      ctx->encrypt_subkeys[i + 32] = ctx->decrypt_subkeys[62 - i];
-      ctx->encrypt_subkeys[i + 33] = ctx->decrypt_subkeys[63 - i];
-
-      ctx->decrypt_subkeys[i + 64] = ctx->encrypt_subkeys[30 - i];
-      ctx->decrypt_subkeys[i + 65] = ctx->encrypt_subkeys[31 - i];
-    }
-}
-
 void
 MHD_gl_3des_ecb_crypt (MHD_gl_3des_ctx * ctx, const char *_from, char *_to,
                        int mode)
@@ -652,15 +557,3 @@ READ_64BIT_DATA (from, left, right)
     DES_ROUND (right, left, work, keys) DES_ROUND (left, right, work, keys)
     FINAL_PERMUTATION (right, work, left) WRITE_64BIT_DATA (to, right, left)}
 
-bool
-MHD_gl_3des_makekey (MHD_gl_3des_ctx * ctx, const char *key, size_t keylen)
-{
-  if (keylen != 24)
-    return false;
-
-  MHD_gl_3des_set3keys (ctx, key, key + 8, key + 16);
-
-  return !(MHD_gl_des_is_weak_key (key)
-           || MHD_gl_des_is_weak_key (key + 8)
-           || MHD_gl_des_is_weak_key (key + 16));
-}

+ 0 - 17
src/daemon/https/lgl/gc-gnulib.c

@@ -150,24 +150,7 @@ MHD_gc_pseudo_random (char *data, size_t datalen)
   return randomize (1, data, datalen);
 }
 
-Gc_rc
-MHD_gc_random (char *data, size_t datalen)
-{
-  return randomize (2, data, datalen);
-}
-
 #endif
-
-/* Memory allocation. */
-void
-MHD_gc_set_allocators (MHD_gc_malloc_t func_malloc,
-                       MHD_gc_malloc_t secure_malloc,
-                       MHD_gc_secure_check_t secure_check,
-                       MHD_gc_realloc_t func_realloc, MHD_gc_free_t func_free)
-{
-  return;
-}
-
 /* Ciphers. */
 
 typedef struct _MHD_gc_cipher_ctx

+ 0 - 17
src/daemon/https/lgl/gc-libgcrypt.c

@@ -77,27 +77,10 @@ MHD_gc_pseudo_random (char *data, size_t datalen)
   return GC_OK;
 }
 
-Gc_rc
-MHD_gc_random (char *data, size_t datalen)
-{
-  gcry_randomize ((unsigned char *) data, datalen, GCRY_VERY_STRONG_RANDOM);
-  return GC_OK;
-}
-
 #endif
 
 /* Memory allocation. */
 
-void
-MHD_gc_set_allocators (MHD_gc_malloc_t func_malloc,
-                       MHD_gc_malloc_t secure_malloc,
-                       MHD_gc_secure_check_t secure_check,
-                       MHD_gc_realloc_t func_realloc, MHD_gc_free_t func_free)
-{
-  gcry_set_allocation_handler (func_malloc, secure_malloc, secure_check,
-                               func_realloc, func_free);
-}
-
 /* Ciphers. */
 
 Gc_rc

+ 0 - 7
src/daemon/https/lgl/gc.h

@@ -104,16 +104,9 @@ typedef void *(*MHD_gc_malloc_t) (size_t n);
 typedef int (*MHD_gc_secure_check_t) (const void *);
 typedef void *(*MHD_gc_realloc_t) (void *p, size_t n);
 typedef void (*MHD_gc_free_t) (void *);
-void MHD_gc_set_allocators (MHD_gc_malloc_t func_malloc,
-                            MHD_gc_malloc_t secure_malloc,
-                            MHD_gc_secure_check_t secure_check,
-                            MHD_gc_realloc_t func_realloc,
-                            MHD_gc_free_t func_free);
-
 /* Randomness. */
 Gc_rc MHD_gc_nonce (char *data, size_t datalen);
 Gc_rc MHD_gc_pseudo_random (char *data, size_t datalen);
-Gc_rc MHD_gc_random (char *data, size_t datalen);
 
 /* Ciphers. */
 Gc_rc MHD_gc_cipher_open (Gc_cipher cipher,

+ 1 - 2
src/daemon/https/minitasn1/Makefile.am

@@ -10,7 +10,6 @@ libasn1_la_SOURCES = \
 libtasn1.h \
 mem.h \
 gstr.h \
-errors.h \
 int.h \
-parser_aux.h structure.h element.h decoding.c gstr.c errors.c	\
+parser_aux.h structure.h element.h decoding.c gstr.c \
 parser_aux.c structure.c element.c coding.c

+ 0 - 1
src/daemon/https/minitasn1/coding.c

@@ -28,7 +28,6 @@
 /*****************************************************/
 
 #include <int.h>
-#include <errors.h>
 #include "parser_aux.h"
 #include <gstr.h>
 #include "element.h"

+ 0 - 1
src/daemon/https/minitasn1/decoding.c

@@ -27,7 +27,6 @@
 /*****************************************************/
 
 #include <int.h>
-#include <errors.h>
 #include "parser_aux.h"
 #include <gstr.h>
 #include "structure.h"

+ 0 - 11
src/daemon/https/minitasn1/element.c

@@ -28,7 +28,6 @@
 
 
 #include <int.h>
-#include <errors.h>
 #include "parser_aux.h"
 #include <gstr.h>
 #include "structure.h"
@@ -115,16 +114,6 @@ MHD__asn1_convert_integer (const char *value, unsigned char *value_out,
   for (k2 = k; k2 < SIZEOF_UNSIGNED_LONG_INT; k2++)
     value_out[k2 - k] = val[k2];
 
-
-#ifdef LIBTASN1_DEBUG_INTEGER
-  MHD__libtasn1_log ("MHD__asn1_convert_integer: valueIn=%s, lenOut=%d",
-                     value, *len);
-  for (k = 0; k < SIZEOF_UNSIGNED_LONG_INT; k++)
-    MHD__libtasn1_log (", vOut[%d]=%d", k, value_out[k]);
-  MHD__libtasn1_log ("\n");
-#endif
-
-
   return ASN1_SUCCESS;
 }
 

+ 0 - 135
src/daemon/https/minitasn1/errors.c

@@ -1,135 +0,0 @@
-/*
- *      Copyright (C) 2006 Free Software Foundation, Inc.
- *      Copyright (C) 2002, 2005 Fabio Fiorina
- *
- * This file is part of LIBTASN1.
- *
- * The LIBTASN1 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
- */
-
-#include <int.h>
-#include "errors.h"
-#ifdef STDC_HEADERS
-# include <stdarg.h>
-#endif
-
-
-#define LIBTASN1_ERROR_ENTRY(name) \
-	{ #name, name }
-
-struct MHD__libtasn1_error_entry
-{
-  const char *name;
-  int number;
-};
-typedef struct MHD__libtasn1_error_entry MHD__libtasn1_error_entry;
-
-static const MHD__libtasn1_error_entry error_algorithms[] = {
-  LIBTASN1_ERROR_ENTRY (ASN1_SUCCESS),
-  LIBTASN1_ERROR_ENTRY (ASN1_FILE_NOT_FOUND),
-  LIBTASN1_ERROR_ENTRY (ASN1_ELEMENT_NOT_FOUND),
-  LIBTASN1_ERROR_ENTRY (ASN1_IDENTIFIER_NOT_FOUND),
-  LIBTASN1_ERROR_ENTRY (ASN1_DER_ERROR),
-  LIBTASN1_ERROR_ENTRY (ASN1_VALUE_NOT_FOUND),
-  LIBTASN1_ERROR_ENTRY (ASN1_GENERIC_ERROR),
-  LIBTASN1_ERROR_ENTRY (ASN1_VALUE_NOT_VALID),
-  LIBTASN1_ERROR_ENTRY (ASN1_TAG_ERROR),
-  LIBTASN1_ERROR_ENTRY (ASN1_TAG_IMPLICIT),
-  LIBTASN1_ERROR_ENTRY (ASN1_ERROR_TYPE_ANY),
-  LIBTASN1_ERROR_ENTRY (ASN1_SYNTAX_ERROR),
-  LIBTASN1_ERROR_ENTRY (ASN1_MEM_ERROR),
-  LIBTASN1_ERROR_ENTRY (ASN1_MEM_ALLOC_ERROR),
-  LIBTASN1_ERROR_ENTRY (ASN1_DER_OVERFLOW),
-  LIBTASN1_ERROR_ENTRY (ASN1_NAME_TOO_LONG),
-  LIBTASN1_ERROR_ENTRY (ASN1_ARRAY_ERROR),
-  LIBTASN1_ERROR_ENTRY (ASN1_ELEMENT_NOT_EMPTY),
-  {0}
-};
-
-#define LIBTASN1_ERROR_LOOP(b) \
-        const MHD__libtasn1_error_entry *p; \
-                for(p = error_algorithms; p->name != NULL; p++) { b ; }
-
-#define LIBTASN1_ERROR_ALG_LOOP(a) \
-                        LIBTASN1_ERROR_LOOP( if(p->number == error) { a; break; } )
-
-
-
-/**
-  * MHD__libtasn1_perror - prints a string to stderr with a description of an error
-  * @error: is an error returned by a libtasn1 function.
-  *
-  * This function is like perror(). The only difference is that it
-  * accepts an error returned by a libtasn1 function.
-  **/
-void
-MHD__libtasn1_perror (MHD__asn1_retCode error)
-{
-  const char *ret = NULL;
-
-  /* avoid prefix */
-  LIBTASN1_ERROR_ALG_LOOP (ret = p->name + sizeof ("ASN1_") - 1);
-
-  fprintf (stderr, "LIBTASN1 ERROR: %s\n", ret);
-
-}
-
-
-/**
-  * MHD__libtasn1_strerror - Returns a string with a description of an error
-  * @error: is an error returned by a libtasn1 function.
-  *
-  * This function is similar to strerror(). The only difference is
-  * that it accepts an error (number) returned by a libtasn1 function.
-  *
-  * Returns: Pointer to static zero-terminated string describing error
-  *   code.
-  **/
-const char *
-MHD__libtasn1_strerror (MHD__asn1_retCode error)
-{
-  const char *ret = NULL;
-
-  /* avoid prefix */
-  LIBTASN1_ERROR_ALG_LOOP (ret = p->name + sizeof ("ASN1_") - 1);
-
-  return ret;
-}
-
-/* this function will output a message.
- */
-#ifdef LIBTASN1_DEBUG
-void
-MHD__libtasn1_log (const char *fmt, ...)
-{
-  va_list args;
-  char str[MAX_LOG_SIZE];
-
-  va_start (args, fmt);
-  vsprintf (str, fmt, args);    /* Flawfinder: ignore */
-  va_end (args);
-
-  fprintf (stderr, str);
-
-  return;
-}
-#else /* not DEBUG */
-void
-MHD__libtasn1_log (const char *fmt, ...)
-{
-  return;
-}
-#endif /* DEBUG */

+ 0 - 30
src/daemon/https/minitasn1/errors.h

@@ -1,30 +0,0 @@
-/*
- *      Copyright (C) 2004, 2006 Free Software Foundation, Inc.
- *      Copyright (C) 2002 Fabio Fiorina
- *
- * This file is part of LIBTASN1.
- *
- * The LIBTASN1 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
- */
-
-#ifndef ERRORS_H
-#define ERRORS_H
-
-#include "int.h"
-
-void MHD__libtasn1_log (const char *fmt, ...);
-
-#endif /* ERRORS_H */

+ 0 - 4
src/daemon/https/minitasn1/libtasn1.h

@@ -186,10 +186,6 @@ extern "C"
   const char *MHD__asn1_find_structure_from_oid (ASN1_TYPE definitions,
                                                  const char *oidValue);
 
-  const char *MHD__libtasn1_strerror (MHD__asn1_retCode error);
-
-  void MHD__libtasn1_perror (MHD__asn1_retCode error);
-
   /* DER utility functions. */
 
   int MHD__asn1_get_tag_der (const unsigned char *der, int der_len,

+ 0 - 1
src/daemon/https/minitasn1/parser_aux.c

@@ -21,7 +21,6 @@
  */
 
 #include <int.h>
-#include <errors.h>
 #include "parser_aux.h"
 #include "gstr.h"
 #include "structure.h"

+ 0 - 1
src/daemon/https/minitasn1/structure.c

@@ -29,7 +29,6 @@
 
 
 #include <int.h>
-#include <errors.h>
 #include <structure.h>
 #include "parser_aux.h"
 #include <gstr.h>