[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r7766 - libmicrohttpd/src/daemon/https/x509
From: |
gnunet |
Subject: |
[GNUnet-SVN] r7766 - libmicrohttpd/src/daemon/https/x509 |
Date: |
Sun, 12 Oct 2008 16:12:05 -0600 (MDT) |
Author: grothoff
Date: 2008-10-12 16:12:05 -0600 (Sun, 12 Oct 2008)
New Revision: 7766
Modified:
libmicrohttpd/src/daemon/https/x509/pkcs12_encr.c
libmicrohttpd/src/daemon/https/x509/x509.c
libmicrohttpd/src/daemon/https/x509/x509_verify.c
Log:
more dead code and warning elimination
Modified: libmicrohttpd/src/daemon/https/x509/pkcs12_encr.c
===================================================================
--- libmicrohttpd/src/daemon/https/x509/pkcs12_encr.c 2008-10-12 22:05:17 UTC
(rev 7765)
+++ libmicrohttpd/src/daemon/https/x509/pkcs12_encr.c 2008-10-12 22:12:05 UTC
(rev 7766)
@@ -35,7 +35,7 @@
static int
MHD_pkcs12_check_pass (const char *pass, size_t plen)
{
- const unsigned char *p = pass;
+ const char *p = pass;
unsigned int i;
for (i = 0; i < plen; i++)
@@ -115,13 +115,13 @@
for (i = 0; i < 64; i++)
{
unsigned char lid = id & 0xFF;
- MHD_gc_hash_write (md, 1, &lid);
+ MHD_gc_hash_write (md, 1, (const char*) &lid);
}
- MHD_gc_hash_write (md, pw ? 128 : 64, buf_i);
+ MHD_gc_hash_write (md, pw ? 128 : 64, (const char*) buf_i);
memcpy (hash, MHD_gc_hash_read (md), 20);
MHD_gc_hash_close (md);
for (i = 1; i < iter; i++)
- MHD_gc_hash_buffer (GC_SHA1, hash, 20, hash);
+ MHD_gc_hash_buffer (GC_SHA1, hash, 20, (char*) hash);
for (i = 0; i < 20 && cur_keylen < req_keylen; i++)
keybuf[cur_keylen++] = hash[i];
if (cur_keylen == req_keylen)
Modified: libmicrohttpd/src/daemon/https/x509/x509.c
===================================================================
--- libmicrohttpd/src/daemon/https/x509/x509.c 2008-10-12 22:05:17 UTC (rev
7765)
+++ libmicrohttpd/src/daemon/https/x509/x509.c 2008-10-12 22:12:05 UTC (rev
7766)
@@ -256,7 +256,7 @@
return result;
}
- result = MHD_gtls_x509_oid2sign_algorithm (sa.data);
+ result = MHD_gtls_x509_oid2sign_algorithm ((const char*) sa.data);
MHD__gnutls_free_datum (&sa);
@@ -533,7 +533,7 @@
return MHD_gtls_asn2err (result);
}
- type = MHD__gnutls_x509_san_find_type (choice_type);
+ type = MHD__gnutls_x509_san_find_type ((char*) choice_type);
if (type == (MHD_gnutls_x509_subject_alt_name_t) - 1)
{
MHD_gnutls_assert ();
@@ -636,7 +636,7 @@
size_t orig_name_size = *name_size;
MHD_gtls_str_cat (nptr, sizeof (nptr), ".");
- MHD_gtls_str_cat (nptr, sizeof (nptr), choice_type);
+ MHD_gtls_str_cat (nptr, sizeof (nptr), (const char*) choice_type);
len = *name_size;
result = MHD__asn1_read_value (src, nptr, name, &len);
@@ -942,73 +942,7 @@
}
-/**
- * MHD_gnutls_x509_crt_get_extension_by_oid - This function returns the
specified extension
- * @cert: should contain a MHD_gnutls_x509_crt_t structure
- * @oid: holds an Object Identified in null terminated string
- * @indx: In case multiple same OIDs exist in the extensions, this specifies
which to send. Use zero to get the first one.
- * @buf: a pointer to a structure to hold the name (may be null)
- * @sizeof_buf: initially holds the size of @buf
- * @critical: will be non zero if the extension is marked as critical
- *
- * This function will return the extension specified by the OID in the
certificate.
- * The extensions will be returned as binary data DER encoded, in the provided
- * buffer.
- *
- * A negative value may be returned in case of parsing error.
- * If the certificate does not contain the specified extension
- * GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE will be returned.
- *
- **/
static int
-MHD_gnutls_x509_crt_get_extension_by_oid (MHD_gnutls_x509_crt_t cert,
- const char *oid,
- int indx,
- void *buf,
- size_t * sizeof_buf,
- unsigned int *critical)
-{
- int result;
- MHD_gnutls_datum_t output;
-
- if (cert == NULL)
- {
- MHD_gnutls_assert ();
- return GNUTLS_E_INVALID_REQUEST;
- }
-
- if ((result = MHD__gnutls_x509_crt_get_extension (cert, oid, indx, &output,
- critical)) < 0)
- {
- MHD_gnutls_assert ();
- return result;
- }
-
- if (output.size == 0 || output.data == NULL)
- {
- MHD_gnutls_assert ();
- return GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE;
- }
-
- if (output.size > (unsigned int) *sizeof_buf)
- {
- *sizeof_buf = output.size;
- MHD__gnutls_free_datum (&output);
- return GNUTLS_E_SHORT_MEMORY_BUFFER;
- }
-
- *sizeof_buf = output.size;
-
- if (buf)
- memcpy (buf, output.data, output.size);
-
- MHD__gnutls_free_datum (&output);
-
- return 0;
-
-}
-
-static int
MHD__gnutls_x509_crt_get_raw_dn2 (MHD_gnutls_x509_crt_t cert,
const char *whom, MHD_gnutls_datum_t * start)
{
Modified: libmicrohttpd/src/daemon/https/x509/x509_verify.c
===================================================================
--- libmicrohttpd/src/daemon/https/x509/x509_verify.c 2008-10-12 22:05:17 UTC
(rev 7765)
+++ libmicrohttpd/src/daemon/https/x509/x509_verify.c 2008-10-12 22:12:05 UTC
(rev 7766)
@@ -601,36 +601,6 @@
return 0;
}
-/* Hashes input data and verifies a DSA signature.
- */
-static int
-dsa_verify_sig (const MHD_gnutls_datum_t * text,
- const MHD_gnutls_datum_t * signature,
- mpi_t * params, int params_len)
-{
- int ret;
- opaque _digest[MAX_HASH_SIZE];
- MHD_gnutls_datum_t digest;
- GNUTLS_HASH_HANDLE hd;
-
- hd = MHD_gtls_hash_init (MHD_GNUTLS_MAC_SHA1);
- if (hd == NULL)
- {
- MHD_gnutls_assert ();
- return GNUTLS_E_HASH_FAILED;
- }
-
- MHD_gnutls_hash (hd, text->data, text->size);
- MHD_gnutls_hash_deinit (hd, _digest);
-
- digest.data = _digest;
- digest.size = 20;
-
- ret = MHD_gtls_dsa_verify (&digest, signature, params, params_len);
-
- return ret;
-}
-
/* Verifies the signature data, and returns 0 if not verified,
* or 1 otherwise.
*/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r7766 - libmicrohttpd/src/daemon/https/x509,
gnunet <=