summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-08-29 11:43:34 +0200
committerSimon Josefsson <simon@josefsson.org>2008-08-29 11:43:34 +0200
commit0be45899fd21ec0aa837dbaf1d1f05193d35dbcc (patch)
tree3b3ad22cfb524c4d87de00d969acd96830268f6d
parent043df1b3dfb836d6684d579d993485c2f3e080c0 (diff)
downloadgnutls-0be45899fd21ec0aa837dbaf1d1f05193d35dbcc.tar.gz
Fix warnings.
-rw-r--r--doc/examples/ex-client-tlsia.c4
-rw-r--r--doc/examples/ex-serv-anon.c4
-rw-r--r--doc/examples/ex-serv-export.c4
-rw-r--r--doc/examples/ex-serv-pgp.c4
-rw-r--r--doc/examples/ex-serv-psk.c2
-rw-r--r--doc/examples/ex-serv-srp.c4
-rw-r--r--doc/examples/ex-serv1.c4
-rw-r--r--lib/gnutls_anon_cred.c8
-rw-r--r--lib/gnutls_buffers.c3
-rw-r--r--lib/opencdk/keydb.c2
-rw-r--r--libextra/openssl_compat.c2
-rw-r--r--libextra/openssl_compat.h4
-rw-r--r--src/certtool-cfg.c2
-rw-r--r--src/certtool.c28
-rw-r--r--src/cli.c2
-rw-r--r--src/common.c8
-rw-r--r--src/crypt.c6
-rw-r--r--src/prime.c3
-rw-r--r--src/printlist.c2
-rw-r--r--src/serv.c7
-rw-r--r--src/tests.c4
-rw-r--r--src/tls_test.c2
22 files changed, 53 insertions, 56 deletions
diff --git a/doc/examples/ex-client-tlsia.c b/doc/examples/ex-client-tlsia.c
index dd81ca0d23..a34f88958b 100644
--- a/doc/examples/ex-client-tlsia.c
+++ b/doc/examples/ex-client-tlsia.c
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation
+/* Copyright 2007, 2008 Free Software Foundation
*
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
@@ -29,7 +29,7 @@
extern int tcp_connect (void);
extern void tcp_close (int sd);
-int
+static int
client_avp (gnutls_session_t session, void *ptr,
const char *last, size_t lastlen, char **new, size_t * newlen)
{
diff --git a/doc/examples/ex-serv-anon.c b/doc/examples/ex-serv-anon.c
index 5cb25c57df..b6c0aa3f55 100644
--- a/doc/examples/ex-serv-anon.c
+++ b/doc/examples/ex-serv-anon.c
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation
+/* Copyright 2007, 2008 Free Software Foundation
*
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
@@ -33,7 +33,7 @@
/* These are global */
gnutls_anon_server_credentials_t anoncred;
-gnutls_session_t
+static gnutls_session_t
initialize_tls_session (void)
{
gnutls_session_t session;
diff --git a/doc/examples/ex-serv-export.c b/doc/examples/ex-serv-export.c
index 2028283595..0f7383f760 100644
--- a/doc/examples/ex-serv-export.c
+++ b/doc/examples/ex-serv-export.c
@@ -47,7 +47,7 @@ static int wrap_db_delete (void *dbf, gnutls_datum_t key);
#define TLS_SESSION_CACHE 50
-gnutls_session_t
+static gnutls_session_t
initialize_tls_session (void)
{
gnutls_session_t session;
@@ -92,7 +92,7 @@ static char srp_dh_group2048[] =
"YWAnkATleuavh05zA85TKZzMBBx7wwjYKlaY86jQw4JxrjX46dv7tpS1yAPYn3rk\n"
"Nd4jbVJfVHWbZeNy/NaO8g+nER+eSv9zAgEC\n" "-----END DH PARAMETERS-----\n";
-int
+static int
generate_dh_params (void)
{
gnutls_datum_t dparams = { srp_dh_group2048, sizeof (srp_dh_group2048) };
diff --git a/doc/examples/ex-serv-pgp.c b/doc/examples/ex-serv-pgp.c
index 6e04732e88..beb1582965 100644
--- a/doc/examples/ex-serv-pgp.c
+++ b/doc/examples/ex-serv-pgp.c
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation
+/* Copyright 2007, 2008 Free Software Foundation
*
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
@@ -54,7 +54,7 @@ generate_dh_params (void)
return 0;
}
-gnutls_session_t
+static gnutls_session_t
initialize_tls_session (void)
{
gnutls_session_t session;
diff --git a/doc/examples/ex-serv-psk.c b/doc/examples/ex-serv-psk.c
index 72cfa77b2e..0a1b83c86f 100644
--- a/doc/examples/ex-serv-psk.c
+++ b/doc/examples/ex-serv-psk.c
@@ -42,7 +42,7 @@ gnutls_certificate_credentials_t x509_cred;
gnutls_psk_server_credentials_t psk_cred;
gnutls_priority_t priority_cache;
-gnutls_session_t
+static gnutls_session_t
initialize_tls_session (void)
{
gnutls_session_t session;
diff --git a/doc/examples/ex-serv-srp.c b/doc/examples/ex-serv-srp.c
index 47bec12e7c..38bf219b44 100644
--- a/doc/examples/ex-serv-srp.c
+++ b/doc/examples/ex-serv-srp.c
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation
+/* Copyright 2007, 2008 Free Software Foundation
*
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
@@ -40,7 +40,7 @@
gnutls_srp_server_credentials_t srp_cred;
gnutls_certificate_credentials_t cert_cred;
-gnutls_session_t
+static gnutls_session_t
initialize_tls_session (void)
{
gnutls_session_t session;
diff --git a/doc/examples/ex-serv1.c b/doc/examples/ex-serv1.c
index a9e3124711..c947c6a296 100644
--- a/doc/examples/ex-serv1.c
+++ b/doc/examples/ex-serv1.c
@@ -1,4 +1,4 @@
-/* Copyright 2007 Free Software Foundation
+/* Copyright 2007, 2008 Free Software Foundation
*
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
@@ -40,7 +40,7 @@
gnutls_certificate_credentials_t x509_cred;
gnutls_priority_t priority_cache;
-gnutls_session_t
+static gnutls_session_t
initialize_tls_session (void)
{
gnutls_session_t session;
diff --git a/lib/gnutls_anon_cred.c b/lib/gnutls_anon_cred.c
index f778d6ca04..537037a1c0 100644
--- a/lib/gnutls_anon_cred.c
+++ b/lib/gnutls_anon_cred.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001, 2004, 2005, 2007 Free Software Foundation
+ * Copyright (C) 2001, 2004, 2005, 2007, 2008 Free Software Foundation
*
* Author: Nikos Mavrogiannopoulos
*
@@ -33,8 +33,6 @@
#include "gnutls_num.h"
#include "gnutls_mpi.h"
-static const int anon_dummy;
-
/**
* gnutls_anon_free_server_credentials - Used to free an allocated gnutls_anon_server_credentials_t structure
* @sc: is an #gnutls_anon_server_credentials_t structure.
@@ -81,6 +79,8 @@ gnutls_anon_free_client_credentials (gnutls_anon_client_credentials_t sc)
{
}
+static const gnutls_anon_client_credentials_t anon_dummy;
+
/**
* gnutls_anon_allocate_client_credentials - Used to allocate a credentials structure
* @sc: is a pointer to an #gnutls_anon_client_credentials_t structure.
@@ -97,7 +97,7 @@ gnutls_anon_allocate_client_credentials (gnutls_anon_client_credentials_t *
/* anon_dummy is only there for *sc not to be null.
* it is not used at all;
*/
- *sc = (void *) &anon_dummy;
+ *sc = anon_dummy;
return 0;
}
diff --git a/lib/gnutls_buffers.c b/lib/gnutls_buffers.c
index f0b8e61e4c..06fbaf1753 100644
--- a/lib/gnutls_buffers.c
+++ b/lib/gnutls_buffers.c
@@ -861,7 +861,8 @@ _gnutls_io_write_buffered (gnutls_session_t session,
{
if (sum < n - left)
{
- sprintf (tmp, "%.2x ", ((unsigned char *) ptr)[sum++]);
+ sprintf (tmp, "%.2x ",
+ ((const unsigned char *) ptr)[sum++]);
_gnutls_str_cat (line, sizeof (line), tmp);
}
else
diff --git a/lib/opencdk/keydb.c b/lib/opencdk/keydb.c
index 66f8b1be39..423a415072 100644
--- a/lib/opencdk/keydb.c
+++ b/lib/opencdk/keydb.c
@@ -1680,7 +1680,7 @@ keydb_parse_allsigs (cdk_kbnode_t knode, cdk_keydb_hd_t hd, int check)
return 0;
}
-void
+static void
add_key_usage (cdk_kbnode_t knode, u32 keyid[2], unsigned int usage)
{
cdk_kbnode_t p, ctx;
diff --git a/libextra/openssl_compat.c b/libextra/openssl_compat.c
index dc4215922e..cd32cc58d4 100644
--- a/libextra/openssl_compat.c
+++ b/libextra/openssl_compat.c
@@ -852,7 +852,7 @@ gnutls_x509_pkcs7_extract_certificate (const gnutls_datum_t *
* Returns a negative value on failure.
*
-*/
-int
+static int
gnutls_x509_pkcs7_extract_certificate_count (const gnutls_datum_t *
pkcs7_struct)
{
diff --git a/libextra/openssl_compat.h b/libextra/openssl_compat.h
index a7559365a8..599d843203 100644
--- a/libextra/openssl_compat.h
+++ b/libextra/openssl_compat.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation
+ * Copyright (C) 2002, 2003, 2004, 2005, 2008 Free Software Foundation
*
* Author: Nikos Mavrogiannopoulos
*
@@ -68,8 +68,6 @@ int gnutls_x509_verify_certificate (const gnutls_datum_t * cert_list,
#define gnutls_x509_fingerprint gnutls_fingerprint
#define gnutls_x509_certificate_format gnutls_x509_crt_fmt_t
-int gnutls_x509_extract_key_pk_algorithm (const gnutls_datum_t * key);
-
#define gnutls_certificate_set_rsa_params gnutls_certificate_set_rsa_export_params
#endif
diff --git a/src/certtool-cfg.c b/src/certtool-cfg.c
index 609c7888fc..83e6ff60df 100644
--- a/src/certtool-cfg.c
+++ b/src/certtool-cfg.c
@@ -217,7 +217,7 @@ read_crq_set (gnutls_x509_crq_t crq, const char *input_str, const char *oid)
/* The input_str should contain %d or %u to print the default.
*/
-int
+static int
read_int_with_default (const char *input_str, int def)
{
char *in;
diff --git a/src/certtool.c b/src/certtool.c
index cd9732ed5b..0a17ffb6f3 100644
--- a/src/certtool.c
+++ b/src/certtool.c
@@ -104,7 +104,7 @@ main (int argc, char **argv)
return 0;
}
-const char *
+static const char *
raw_to_string (const unsigned char *raw, size_t raw_size)
{
static char buf[1024];
@@ -125,7 +125,7 @@ raw_to_string (const unsigned char *raw, size_t raw_size)
return buf;
}
-void
+static void
print_dsa_pkey (gnutls_datum * x, gnutls_datum * y, gnutls_datum * p,
gnutls_datum * q, gnutls_datum * g)
{
@@ -141,7 +141,7 @@ print_dsa_pkey (gnutls_datum * x, gnutls_datum * y, gnutls_datum * p,
print_hex_datum (g);
}
-void
+static void
print_rsa_pkey (gnutls_datum * m, gnutls_datum * e, gnutls_datum * d,
gnutls_datum * p, gnutls_datum * q, gnutls_datum * u)
{
@@ -237,7 +237,7 @@ print_private_key (gnutls_x509_privkey_t key)
fwrite (buffer, 1, size, outfile);
}
-void
+static void
generate_private_key (void)
{
gnutls_x509_privkey_t key;
@@ -250,7 +250,7 @@ generate_private_key (void)
}
-gnutls_x509_crt_t
+static gnutls_x509_crt_t
generate_certificate (gnutls_x509_privkey_t * ret_key,
gnutls_x509_crt_t ca_crt, int proxy)
{
@@ -575,7 +575,7 @@ generate_certificate (gnutls_x509_privkey_t * ret_key,
}
-gnutls_x509_crl_t
+static gnutls_x509_crl_t
generate_crl (void)
{
gnutls_x509_crl_t crl;
@@ -661,7 +661,7 @@ generate_self_signed (void)
gnutls_x509_privkey_deinit (key);
}
-void
+static void
generate_signed_certificate (void)
{
gnutls_x509_crt_t crt;
@@ -703,7 +703,7 @@ generate_signed_certificate (void)
gnutls_x509_privkey_deinit (key);
}
-void
+static void
generate_proxy_certificate (void)
{
gnutls_x509_crt_t crt, eecrt;
@@ -737,7 +737,7 @@ generate_proxy_certificate (void)
gnutls_x509_privkey_deinit (key);
}
-void
+static void
generate_signed_crl (void)
{
gnutls_x509_crl_t crl;
@@ -762,7 +762,7 @@ generate_signed_crl (void)
gnutls_x509_crl_deinit (crl);
}
-void
+static void
update_signed_certificate (void)
{
gnutls_x509_crt_t crt;
@@ -805,7 +805,7 @@ update_signed_certificate (void)
gnutls_x509_crt_deinit (crt);
}
-FILE *
+static FILE *
safe_open_rw (const char *file)
{
mode_t oldmask;
@@ -1786,7 +1786,7 @@ static void print_verification_res (gnutls_x509_crt_t crt,
#define CERT_SEP "-----BEGIN CERT"
#define CRL_SEP "-----BEGIN X509 CRL"
-int
+static int
_verify_x509_mem (const void *cert, int cert_size)
{
int siz, i;
@@ -2370,7 +2370,7 @@ generate_pkcs12 (void)
}
-const char *
+static const char *
BAGTYPE (gnutls_pkcs12_bag_type_t x)
{
switch (x)
@@ -2392,7 +2392,7 @@ BAGTYPE (gnutls_pkcs12_bag_type_t x)
}
}
-void
+static void
print_bag_data (gnutls_pkcs12_bag_t bag)
{
int result;
diff --git a/src/cli.c b/src/cli.c
index e2cf4068df..3130386590 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -548,7 +548,7 @@ handle_error (socket_st * hd, int err)
int starttls_alarmed = 0;
-void
+static void
starttls_alarm (int signum)
{
starttls_alarmed = 1;
diff --git a/src/common.c b/src/common.c
index ae7569ed61..59e8360aad 100644
--- a/src/common.c
+++ b/src/common.c
@@ -81,7 +81,7 @@ my_ctime (const time_t * tv)
}
-void
+static void
print_x509_info (gnutls_session_t session, const char *hostname, int insecure)
{
gnutls_x509_crt_t crt;
@@ -281,7 +281,7 @@ print_x509_info (gnutls_session_t session, const char *hostname, int insecure)
#ifdef ENABLE_OPENPGP
-void
+static void
print_openpgp_info (gnutls_session_t session, const char *hostname,
int insecure)
{
@@ -401,7 +401,7 @@ print_openpgp_info (gnutls_session_t session, const char *hostname,
#endif
-void
+static void
print_cert_vrfy (gnutls_session_t session)
{
int rc;
@@ -443,7 +443,7 @@ print_cert_vrfy (gnutls_session_t session)
}
}
-void
+static void
print_dh_info (gnutls_session_t session, const char *str)
{
printf ("- %sDiffie-Hellman parameters\n", str);
diff --git a/src/crypt.c b/src/crypt.c
index 884f330d7e..93944dbca6 100644
--- a/src/crypt.c
+++ b/src/crypt.c
@@ -108,7 +108,7 @@ print_num (const char *msg, const gnutls_datum_t * num)
}
-int
+static int
generate_create_conf (char *tpasswd_conf)
{
FILE *fd;
@@ -320,7 +320,7 @@ find_strchr (char *username, char *file)
/* Parses the tpasswd files, in order to verify the given
* username/password pair.
*/
-int
+static int
verify_passwd (char *conffile, char *tpasswd, char *username,
const char *passwd)
{
@@ -494,7 +494,7 @@ main (int argc, char **argv)
}
-char *
+static char *
_srp_crypt (const char *username, const char *passwd, int salt_size,
const gnutls_datum_t * g, const gnutls_datum_t * n)
{
diff --git a/src/prime.c b/src/prime.c
index f38d0aaf1a..213f31287e 100644
--- a/src/prime.c
+++ b/src/prime.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004,2005,2007 Free Software Foundation
+ * Copyright (C) 2004,2005,2007,2008 Free Software Foundation
* Copyright (C) 2001,2002,2003 Nikos Mavrogiannopoulos
*
* This file is part of GNUTLS.
@@ -174,7 +174,6 @@ generate_prime (int bits, int how)
if (!cparams)
{ /* generate a PKCS#3 structure */
- int ret;
size_t len = buffer_size;
ret = gnutls_dh_params_export_pkcs3 (dh_params, GNUTLS_X509_FMT_PEM,
diff --git a/src/printlist.c b/src/printlist.c
index 4655d3b746..b29c4af807 100644
--- a/src/printlist.c
+++ b/src/printlist.c
@@ -29,7 +29,7 @@
#include <time.h>
#include <common.h>
-int main()
+int main(void)
{
{
size_t i;
diff --git a/src/serv.c b/src/serv.c
index e765a07a05..f1db6f428a 100644
--- a/src/serv.c
+++ b/src/serv.c
@@ -364,7 +364,7 @@ oprfi_callback (gnutls_session_t session,
}
#endif
-gnutls_session_t
+static gnutls_session_t
initialize_session (void)
{
gnutls_session_t session;
@@ -447,7 +447,7 @@ static const char DEFAULT_DATA[] =
/* Creates html with the current session information.
*/
#define tmp2 &http_buffer[strlen(http_buffer)]
-char *
+static char *
peer_print_info (gnutls_session_t session, int *ret_length,
const char *header)
{
@@ -480,7 +480,6 @@ peer_print_info (gnutls_session_t session, int *ret_length,
{
const gnutls_datum_t *cert_list;
unsigned int cert_list_size = 0;
- size_t i;
cert_list = gnutls_certificate_get_peers (session, &cert_list_size);
@@ -746,7 +745,7 @@ unimplemented:
*response_length = ((*response) ? strlen (*response) : 0);
}
-void
+static void
terminate (int sig)
{
fprintf (stderr, "Exiting via signal %d\n", sig);
diff --git a/src/tests.c b/src/tests.c
index 0c56328d40..bec67ecc04 100644
--- a/src/tests.c
+++ b/src/tests.c
@@ -53,7 +53,7 @@ static size_t session_data_size = 0, session_id_size = 0;
static int sfree = 0;
static int handshake_output = 0;
-int
+static int
do_handshake (gnutls_session_t session)
{
int ret, alert;
@@ -479,7 +479,7 @@ test_ssl3 (gnutls_session_t session)
}
static int alrm = 0;
-void
+static void
got_alarm (int k)
{
alrm = 1;
diff --git a/src/tls_test.c b/src/tls_test.c
index 7354d19b8d..876a3fd76d 100644
--- a/src/tls_test.c
+++ b/src/tls_test.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000,2001,2002,2003,2006,2007 Nikos Mavrogiannopoulos
+ * Copyright (C) 2000,2001,2002,2003,2006,2007,2008 Nikos Mavrogiannopoulos
* Copyright (C) 2004,2005, 2008 Free Software Foundation
*
* This file is part of GNUTLS.