]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Use *_t types consistently.
authorSimon Josefsson <simon@josefsson.org>
Mon, 13 Aug 2007 10:45:47 +0000 (12:45 +0200)
committerSimon Josefsson <simon@josefsson.org>
Mon, 13 Aug 2007 10:45:47 +0000 (12:45 +0200)
30 files changed:
doc/examples/ex-cert-select.c
includes/gnutls/gnutls.h.in
includes/gnutls/gnutlsxx.h
includes/gnutls/openpgp.h
includes/gnutls/pkcs12.h
lib/auth_dh_common.c
lib/auth_dhe_psk.c
lib/auth_psk.c
lib/auth_psk.h
lib/auth_psk_passwd.c
lib/auth_psk_passwd.h
lib/gnutls_psk.c
lib/gnutls_session.c
lib/gnutls_session_pack.c
lib/gnutls_x509.c
lib/gnutlsxx.cpp
lib/x509/output.c
src/certtool-cfg.c
src/certtool-cfg.h
src/certtool.c
src/cli.c
src/common.c
src/common.h
src/crypt.c
src/prime.c
src/psk.c
src/serv.c
src/tests.c
src/tests.h
src/tls_test.c

index ac31fd70fca16e457a32cec92249b6527c8e1c5a..038adc13c0e5003a48aa4b72f8a3c95039209dd5 100644 (file)
@@ -39,11 +39,11 @@ gnutls_x509_privkey_t key;
 /* Helper functions to load a certificate and key
  * files into memory.
  */
-static gnutls_datum 
+static gnutls_datum_t
 load_file (const char *file)
 {
   FILE *f;
-  gnutls_datum loaded_file = { NULL, 0 };
+  gnutls_datum_t loaded_file = { NULL, 0 };
   long filelen;
   void *ptr;
 
@@ -62,7 +62,7 @@ load_file (const char *file)
   return loaded_file;
 }
 
-static void unload_file(gnutls_datum data)
+static void unload_file(gnutls_datum_t data)
 {
   free(data.data);
 }
index 801c82cafe32068306f4dc3bee8c42d1c1115f6c..e448a03ebd27269ff4c23f12a121570c98d52ad4 100644 (file)
@@ -539,7 +539,7 @@ extern "C"
   int gnutls_session_get_data (gnutls_session_t session, void *session_data,
                               size_t * session_data_size);
   int gnutls_session_get_data2 (gnutls_session_t session,
-                               gnutls_datum * data);
+                               gnutls_datum_t * data);
 
 /* returns the session ID */
 #define GNUTLS_MAX_SESSION_ID 32
@@ -924,7 +924,7 @@ extern "C"
                                              * sc);
   int gnutls_psk_set_client_credentials (gnutls_psk_client_credentials_t res,
                                         const char *username,
-                                        const gnutls_datum * key,
+                                        const gnutls_datum_t * key,
                                         gnutls_psk_key_flags format);
 
   void gnutls_psk_free_server_credentials (gnutls_psk_server_credentials_t
@@ -946,7 +946,7 @@ extern "C"
 
   typedef int gnutls_psk_client_credentials_function (gnutls_session_t,
                                                      char **username,
-                                                     gnutls_datum * key);
+                                                     gnutls_datum_t * key);
   void
     gnutls_psk_set_client_credentials_function
     (gnutls_psk_client_credentials_t cred,
index 555900a4d8a843e8fe8c643dac148055d37ab93e..be1fe5a0e3188d0c5f910edeef3bb0847dda09c6 100644 (file)
@@ -172,10 +172,10 @@ class session
         unsigned int get_dh_prime_bits() const;
         void get_dh_group( gnutls_datum_t & gen, gnutls_datum_t & prime) const;
         void get_dh_pubkey( gnutls_datum_t & raw_key) const;
-        void get_rsa_export_pubkey( gnutls_datum& exponent, gnutls_datum& modulus) const;
+        void get_rsa_export_pubkey( gnutls_datum_t& exponent, gnutls_datum_t& modulus) const;
         unsigned int get_rsa_export_modulus_bits() const;
         
-        void get_our_certificate(gnutls_datum & cert) const;
+        void get_our_certificate(gnutls_datum_t & cert) const;
         bool get_peers_certificate(std::vector<gnutls_datum_t> &out_certs) const;
         bool get_peers_certificate(const gnutls_datum_t** certs, unsigned int *certs_size) const;
 
@@ -190,9 +190,9 @@ class DB
 {
     public:
         virtual ~DB()=0;
-        virtual bool store( const gnutls_datum& key, const gnutls_datum& data)=0;
-        virtual bool retrieve( const gnutls_datum& key, gnutls_datum& data)=0;
-        virtual bool remove( const gnutls_datum& key)=0;
+        virtual bool store( const gnutls_datum_t& key, const gnutls_datum_t& data)=0;
+        virtual bool retrieve( const gnutls_datum_t& key, gnutls_datum_t& data)=0;
+        virtual bool remove( const gnutls_datum_t& key)=0;
 };
 
 class server_session: public session
index be7a2b5297c407c267002df2686135f75edfafaa..229e58176e783b9bfa92c517163095c879b3a493 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation
  *
  * Author: Nikos Mavroyanopoulos
  *
@@ -43,14 +43,16 @@ extern "C"
   typedef enum gnutls_openpgp_key_fmt
   { GNUTLS_OPENPGP_FMT_RAW,
     GNUTLS_OPENPGP_FMT_BASE64
-  } gnutls_openpgp_key_fmt;
+  } gnutls_openpgp_key_fmt_t;
 
-  int gnutls_openpgp_key_init (gnutls_openpgp_key * key);      /* initializes the memory for gnutls_openpgp_key_t struct */
-  void gnutls_openpgp_key_deinit (gnutls_openpgp_key_t key);   /* frees all memory */
+  /* initializes the memory for gnutls_openpgp_key_t struct */
+  int gnutls_openpgp_key_init (gnutls_openpgp_key_t * key);
+  /* frees all memory */
+  void gnutls_openpgp_key_deinit (gnutls_openpgp_key_t key);
 
   int gnutls_openpgp_key_import (gnutls_openpgp_key_t key,
                                 const gnutls_datum_t * data,
-                                gnutls_openpgp_key_fmt format);
+                                gnutls_openpgp_key_fmt_t format);
   int gnutls_openpgp_key_export (gnutls_openpgp_key_t key,
                                 gnutls_openpgp_key_fmt_t format,
                                 void *output_data,
@@ -94,20 +96,20 @@ extern "C"
                                           unsigned int *bits);
   int gnutls_openpgp_privkey_import (gnutls_openpgp_privkey_t key,
                                     const gnutls_datum_t * data,
-                                    gnutls_openpgp_key_fmt format,
+                                    gnutls_openpgp_key_fmt_t format,
                                     const char *pass, unsigned int flags);
 
 /* Keyring stuff.
  */
   struct gnutls_openpgp_keyring_int;   /* object to hold (parsed) openpgp keyrings */
-  typedef struct gnutls_openpgp_keyring_int *gnutls_openpgp_keyring;
+  typedef struct gnutls_openpgp_keyring_int *gnutls_openpgp_keyring_t;
 
-  int gnutls_openpgp_keyring_init (gnutls_openpgp_keyring * keyring);
+  int gnutls_openpgp_keyring_init (gnutls_openpgp_keyring_t * keyring);
   void gnutls_openpgp_keyring_deinit (gnutls_openpgp_keyring_t keyring);
 
   int gnutls_openpgp_keyring_import (gnutls_openpgp_keyring_t keyring,
                                     const gnutls_datum_t * data,
-                                    gnutls_openpgp_key_fmt format);
+                                    gnutls_openpgp_key_fmt_t format);
 
   int gnutls_openpgp_keyring_check_id (gnutls_openpgp_keyring_t ring,
                                       const unsigned char keyid[8],
@@ -116,9 +118,9 @@ extern "C"
 /* Trustdb functions.
  */
   struct gnutls_openpgp_trustdb_int;   /* object to hold (parsed) openpgp trustdbs */
-  typedef struct gnutls_openpgp_trustdb_int *gnutls_openpgp_trustdb;
+  typedef struct gnutls_openpgp_trustdb_int *gnutls_openpgp_trustdb_t;
 
-  int gnutls_openpgp_trustdb_init (gnutls_openpgp_trustdb * trustdb);
+  int gnutls_openpgp_trustdb_init (gnutls_openpgp_trustdb_t * trustdb);
   void gnutls_openpgp_trustdb_deinit (gnutls_openpgp_trustdb_t trustdb);
 
   int gnutls_openpgp_trustdb_import (gnutls_openpgp_trustdb_t trustdb,
index c46da6f3bc09518d950eb526198a7f708ffa4ea0..ba330a4ddbc4afd30f57b4a9ef8a443ff0ef7dcf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003, 2004, 2005 Free Software Foundation
+ * Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation
  *
  * Author: Nikos Mavroyanopoulos
  *
@@ -44,9 +44,11 @@ extern "C"
   void gnutls_pkcs12_deinit (gnutls_pkcs12_t pkcs12);
   int gnutls_pkcs12_import (gnutls_pkcs12_t pkcs12,
                            const gnutls_datum_t * data,
-                           gnutls_x509_crt_fmt format, unsigned int flags);
+                           gnutls_x509_crt_fmt_t format,
+                           unsigned int flags);
   int gnutls_pkcs12_export (gnutls_pkcs12_t pkcs12,
-                           gnutls_x509_crt_fmt format, void *output_data,
+                           gnutls_x509_crt_fmt_t format,
+                           void *output_data,
                            size_t * output_data_size);
 
   int gnutls_pkcs12_get_bag (gnutls_pkcs12_t pkcs12,
index 7310cb8eab0c9003010220d28f7c46eb2a718d2d..d636aeba76e729931355f37c24cfff7319cad194 100644 (file)
@@ -96,7 +96,7 @@ _gnutls_proc_dh_common_client_kx (gnutls_session_t session,
     }
   else                         /* In DHE_PSK the key is set differently */
     {
-      gnutls_datum tmp_dh_key;
+      gnutls_datum_t tmp_dh_key;
       ret = _gnutls_mpi_dprint (&tmp_dh_key, session->key->KEY);
       if (ret < 0)
        {
@@ -179,7 +179,7 @@ _gnutls_gen_dh_common_client_kx (gnutls_session_t session, opaque ** data)
     }
   else                         /* In DHE_PSK the key is set differently */
     {
-      gnutls_datum tmp_dh_key;
+      gnutls_datum_t tmp_dh_key;
       ret = _gnutls_mpi_dprint (&tmp_dh_key, session->key->KEY);
       if (ret < 0)
        {
index 2586604ecae6d3422fdde42435cfc2a16dceddbd..3345e5342104446d9285c163cb207fbef9c19283 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005 Free Software Foundation
+ * Copyright (C) 2005, 2007 Free Software Foundation
  *
  * Author: Nikos Mavroyanopoulos
  *
@@ -176,7 +176,7 @@ proc_psk_client_kx (gnutls_session_t session, opaque * data,
   const mpi_t *mpis;
   gnutls_psk_server_credentials_t cred;
   psk_auth_info_t info;
-  gnutls_datum username;
+  gnutls_datum_t username;
   ssize_t data_size = _data_size;
 
   cred = (gnutls_psk_server_credentials_t)
index 60c83873f5f724a373af245db135eeda8709fdc6..f1ef0c1164dcc18a34d70a571909c25706248ada 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005 Free Software Foundation
+ * Copyright (C) 2005, 2007 Free Software Foundation
  *
  * Author: Nikos Mavroyanopoulos
  *
@@ -61,10 +61,10 @@ const mod_auth_st psk_auth_struct = {
  */
 int
 _gnutls_set_psk_session_key (gnutls_session_t session,
-                            gnutls_datum * dh_secret)
+                            gnutls_datum_t * dh_secret)
 {
-  gnutls_datum pwd_psk = { NULL, 0 };
-  gnutls_datum *ppsk;
+  gnutls_datum_t pwd_psk = { NULL, 0 };
+  gnutls_datum_t *ppsk;
   size_t dh_secret_size;
   int ret;
 
@@ -198,7 +198,7 @@ _gnutls_proc_psk_client_kx (gnutls_session_t session, opaque * data,
 {
   ssize_t data_size = _data_size;
   int ret;
-  gnutls_datum username;
+  gnutls_datum_t username;
   gnutls_psk_server_credentials_t cred;
   psk_auth_info_t info;
 
index 6e086c397426f84e3535a9f3e7f93692a732de61..6d2174319f3c8cc255e892f7aa3b01d7f3d7324c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005 Free Software Foundation
+ * Copyright (C) 2005, 2007 Free Software Foundation
  *
  * Author: Nikos Mavroyanopoulos
  *
@@ -30,8 +30,8 @@
 
 typedef struct gnutls_psk_client_credentials_st
 {
-  gnutls_datum username;
-  gnutls_datum key;
+  gnutls_datum_t username;
+  gnutls_datum_t key;
   gnutls_psk_client_credentials_function *get_function;
 } psk_client_credentials_st;
 
@@ -64,7 +64,7 @@ typedef struct psk_auth_info_st
 typedef struct psk_auth_info_st psk_auth_info_st;
 
 int
-_gnutls_set_psk_session_key (gnutls_session_t session, gnutls_datum * psk2);
+_gnutls_set_psk_session_key (gnutls_session_t session, gnutls_datum_t * psk2);
 #else
 # define _gnutls_set_psk_session_key(x,y) GNUTLS_E_INTERNAL_ERROR
 #endif /* ENABLE_PSK */
index 6bb523113e21c0797c5f1e6736c4dacdf628261b..a82ade6a23034207879a2a2ad16e2b691b40b26c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005 Free Software Foundation
+ * Copyright (C) 2005, 2007 Free Software Foundation
  *
  * Author: Nikos Mavroyanopoulos
  *
@@ -44,7 +44,7 @@
  * string(username):hex(passwd)
  */
 static int
-pwd_put_values (gnutls_datum * psk, char *str)
+pwd_put_values (gnutls_datum_t * psk, char *str)
 {
   char *p;
   int len, ret;
@@ -93,7 +93,7 @@ pwd_put_values (gnutls_datum * psk, char *str)
  * Returns 0 on success.
  */
 static int
-_randomize_psk (gnutls_datum * psk)
+_randomize_psk (gnutls_datum_t * psk)
 {
   psk->data = gnutls_malloc (16);
   if (psk->data == NULL)
@@ -117,7 +117,7 @@ _randomize_psk (gnutls_datum * psk)
  */
 int
 _gnutls_psk_pwd_find_entry (gnutls_session_t session, char *username,
-                           gnutls_datum * psk)
+                           gnutls_datum_t * psk)
 {
   gnutls_psk_server_credentials_t cred;
   FILE *fd;
index fe1726dbabf2c3f3431af6e34020f53ed095372b..6eca95b25ad63e969186df60fe17cee1bd251577 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005 Free Software Foundation
+ * Copyright (C) 2005, 2007 Free Software Foundation
  *
  * Author: Nikos Mavroyanopoulos
  *
@@ -26,6 +26,6 @@
 
 /* this is locally allocated. It should be freed using the provided function */
 int _gnutls_psk_pwd_find_entry (gnutls_session_t, char *username,
-                               gnutls_datum * key);
+                               gnutls_datum_t * key);
 
 #endif /* ENABLE_SRP */
index 9fa091cae3e3ff4ccb15b0444eb62c5d6c75d44a..a6be1a5e0538c622415898278ffa7786b0ecc18b 100644 (file)
@@ -93,7 +93,7 @@ gnutls_psk_allocate_client_credentials (gnutls_psk_client_credentials_t * sc)
 int
 gnutls_psk_set_client_credentials (gnutls_psk_client_credentials_t res,
                                   const char *username,
-                                  const gnutls_datum * key,
+                                  const gnutls_datum_t * key,
                                   gnutls_psk_key_flags flags)
 {
   int ret;
@@ -260,7 +260,7 @@ gnutls_psk_set_server_credentials_function (gnutls_psk_server_credentials_t
   * password for client PSK authentication.
   * The callback's function form is:
   * int (*callback)(gnutls_session_t, char** username,
-  *  gnutls_datum* key);
+  *  gnutls_datum_t* key);
   *
   * The @username and @key must be allocated using gnutls_malloc().
   * @username should be ASCII strings or UTF-8 strings 
index 1d500e28ec3605e6a51cbc9e7b4b0020aa7b20f1..0da2c04abe3f522d7566583fb496345b5386ccb9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2000, 2003, 2004, 2005 Free Software Foundation
+ * Copyright (C) 2000, 2003, 2004, 2005, 2007 Free Software Foundation
  *
  * Author: Nikos Mavroyanopoulos
  *
@@ -83,7 +83,7 @@ gnutls_session_get_data (gnutls_session_t session,
   * Resuming sessions is really useful and speedups connections after a succesful one.
   **/
 int
-gnutls_session_get_data2 (gnutls_session_t session, gnutls_datum * data)
+gnutls_session_get_data2 (gnutls_session_t session, gnutls_datum_t * data)
 {
 
   int ret;
index 6bbe5162b064f49620ff8fad703cd5676694adc3..0dbdc13d160333306af70418a80abb3b8b68c0eb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2000, 2004, 2005 Free Software Foundation
+ * Copyright (C) 2000, 2004, 2005, 2007 Free Software Foundation
  *
  * Author: Nikos Mavroyanopoulos
  *
@@ -50,24 +50,24 @@ static int unpack_certificate_auth_info (gnutls_session_t,
                                         packed_session);
 
 static int unpack_srp_auth_info (gnutls_session_t session,
-                                const gnutls_datum * packed_session);
+                                const gnutls_datum_t * packed_session);
 static int pack_srp_auth_info (gnutls_session_t session,
-                              gnutls_datum * packed_session);
+                              gnutls_datum_t * packed_session);
 
 static int unpack_psk_auth_info (gnutls_session_t session,
-                                const gnutls_datum * packed_session);
+                                const gnutls_datum_t * packed_session);
 static int pack_psk_auth_info (gnutls_session_t session,
-                              gnutls_datum * packed_session);
+                              gnutls_datum_t * packed_session);
 
 static int unpack_anon_auth_info (gnutls_session_t session,
-                                 const gnutls_datum * packed_session);
+                                 const gnutls_datum_t * packed_session);
 static int pack_anon_auth_info (gnutls_session_t session,
-                               gnutls_datum * packed_session);
+                               gnutls_datum_t * packed_session);
 
 static int unpack_security_parameters (gnutls_session_t session,
-                                      const gnutls_datum * packed_session);
+                                      const gnutls_datum_t * packed_session);
 static int pack_security_parameters (gnutls_session_t session,
-                                    gnutls_datum * packed_session);
+                                    gnutls_datum_t * packed_session);
 
 
 /* Since auth_info structures contain malloced data, this function
@@ -505,7 +505,7 @@ error:
  *      x bytes the SRP username
  */
 static int
-pack_srp_auth_info (gnutls_session_t session, gnutls_datum * packed_session)
+pack_srp_auth_info (gnutls_session_t session, gnutls_datum_t * packed_session)
 {
   srp_server_auth_info_t info = _gnutls_get_auth_info (session);
   int pack_size;
@@ -547,7 +547,7 @@ pack_srp_auth_info (gnutls_session_t session, gnutls_datum * packed_session)
 
 static int
 unpack_srp_auth_info (gnutls_session_t session,
-                     const gnutls_datum * packed_session)
+                     const gnutls_datum_t * packed_session)
 {
   size_t username_size;
   int ret;
@@ -613,7 +613,7 @@ unpack_srp_auth_info (gnutls_session_t session,
  *      x bytes the public key
  */
 static int
-pack_anon_auth_info (gnutls_session_t session, gnutls_datum * packed_session)
+pack_anon_auth_info (gnutls_session_t session, gnutls_datum_t * packed_session)
 {
   anon_auth_info_t info = _gnutls_get_auth_info (session);
   int pos = 0;
@@ -668,7 +668,7 @@ pack_anon_auth_info (gnutls_session_t session, gnutls_datum * packed_session)
 
 static int
 unpack_anon_auth_info (gnutls_session_t session,
-                      const gnutls_datum * packed_session)
+                      const gnutls_datum_t * packed_session)
 {
   size_t pack_size;
   int pos = 0, size, ret;
@@ -776,7 +776,7 @@ error:
  *      x bytes the public key
  */
 static int
-pack_psk_auth_info (gnutls_session_t session, gnutls_datum * packed_session)
+pack_psk_auth_info (gnutls_session_t session, gnutls_datum_t * packed_session)
 {
   psk_auth_info_t info;
   int pack_size, username_size = 0, pos;
@@ -847,7 +847,7 @@ pack_psk_auth_info (gnutls_session_t session, gnutls_datum * packed_session)
 
 static int
 unpack_psk_auth_info (gnutls_session_t session,
-                     const gnutls_datum * packed_session)
+                     const gnutls_datum_t * packed_session)
 {
   size_t username_size;
   size_t pack_size;
@@ -995,7 +995,7 @@ error:
  */
 static int
 pack_security_parameters (gnutls_session_t session,
-                         gnutls_datum * packed_session)
+                         gnutls_datum_t * packed_session)
 {
   int pos = 0;
   size_t len, init, i;
@@ -1099,7 +1099,7 @@ pack_security_parameters (gnutls_session_t session,
 
 static int
 unpack_security_parameters (gnutls_session_t session,
-                           const gnutls_datum * packed_session)
+                           const gnutls_datum_t * packed_session)
 {
   size_t pack_size, init, i;
   int pos = 0, len;
index 352f0028d05a3abf7e77bb2a804323291160247e..b07d4473b48e0afb789c05b3144f48d90abecd8a 100644 (file)
@@ -1702,10 +1702,10 @@ static int
 parse_pkcs12 (gnutls_certificate_credentials_t res,
              gnutls_pkcs12_t p12,
              const char *password,
-             gnutls_x509_privkey * key,
+             gnutls_x509_privkey_t * key,
              gnutls_x509_crt_t * cert, gnutls_x509_crl_t * crl)
 {
-  gnutls_pkcs12_bag bag = NULL;
+  gnutls_pkcs12_bag_t bag = NULL;
   int index = 0;
   int ret;
 
@@ -1758,7 +1758,7 @@ parse_pkcs12 (gnutls_certificate_credentials_t res,
       for (i = 0; i < elements_in_bag; i++)
        {
          int type;
-         gnutls_datum data;
+         gnutls_datum_t data;
 
          type = gnutls_pkcs12_bag_get_type (bag, i);
          if (type < 0)
@@ -1883,13 +1883,13 @@ done:
  * Return value: Returns 0 on success, or an error code.
  **/
 int
-  gnutls_certificate_set_x509_simple_pkcs12_file
-  (gnutls_certificate_credentials_t res, const char *pkcs12file,
  gnutls_x509_crt_fmt_t type, const char *password)
+gnutls_certificate_set_x509_simple_pkcs12_file
+(gnutls_certificate_credentials_t res, const char *pkcs12file,
+ gnutls_x509_crt_fmt_t type, const char *password)
 {
   gnutls_pkcs12_t p12;
   gnutls_datum_t p12blob;
-  gnutls_x509_privkey key = NULL;
+  gnutls_x509_privkey_t key = NULL;
   gnutls_x509_crt_t cert = NULL;
   gnutls_x509_crl_t crl = NULL;
   int ret;
index b350c050abcfc60b9473cbfb78915483322f9511..9680dbb45243e98076cc068021aed2f2b79baf33 100644 (file)
@@ -257,7 +257,7 @@ bool session::get_peers_certificate(const gnutls_datum_t** certs, unsigned int *
     return true;
 }
 
-void session::get_our_certificate(gnutls_datum& cert) const
+void session::get_our_certificate(gnutls_datum_t& cert) const
 {
 const gnutls_datum_t *d;
     
@@ -485,7 +485,7 @@ void session::get_dh_pubkey( gnutls_datum_t & raw_key) const
     RETWRAP(gnutls_dh_get_pubkey( this->s, &raw_key));
 }
 
-void session::get_rsa_export_pubkey( gnutls_datum& exponent, gnutls_datum& modulus) const
+void session::get_rsa_export_pubkey( gnutls_datum_t& exponent, gnutls_datum_t& modulus) const
 {
     RETWRAP( gnutls_rsa_export_get_pubkey( this->s, &exponent, &modulus));
 }
@@ -807,7 +807,7 @@ void psk_client_credentials::set_ptr(void* p)
 }
 
 void psk_client_credentials::set_credentials(const char* username,
-        const gnutls_datum& key, gnutls_psk_key_flags flags) 
+        const gnutls_datum_t& key, gnutls_psk_key_flags flags) 
 { 
     RETWRAP(gnutls_psk_set_client_credentials( this->cred, username, &key, flags));
 }
index f6dfff8fb2e52096080a45d4192018f723b9a5fb..4ea4d24c8efd5ff67ea4ad7132612e5a61d47efa 100644 (file)
@@ -613,7 +613,7 @@ print_cert (gnutls_string * str, gnutls_x509_crt_t cert, int notsigned)
          {
          case GNUTLS_PK_RSA:
            {
-             gnutls_datum m, e;
+             gnutls_datum_t m, e;
 
              err = gnutls_x509_crt_get_pk_rsa_raw (cert, &m, &e);
              if (err < 0)
@@ -634,7 +634,7 @@ print_cert (gnutls_string * str, gnutls_x509_crt_t cert, int notsigned)
 
          case GNUTLS_PK_DSA:
            {
-             gnutls_datum p, q, g, y;
+             gnutls_datum_t p, q, g, y;
 
              err = gnutls_x509_crt_get_pk_dsa_raw (cert, &p, &q, &g, &y);
              if (err < 0)
index 18090f2a05bf066720ac4143af8e20de1275430c..33c28730e00a9ae81af3397cd312328b310ff870 100644 (file)
@@ -175,7 +175,7 @@ template_parse (const char *template)
 }
 
 void
-read_crt_set (gnutls_x509_crt crt, const char *input_str, const char *oid)
+read_crt_set (gnutls_x509_crt_t crt, const char *input_str, const char *oid)
 {
   char input[128];
   int ret;
@@ -196,7 +196,7 @@ read_crt_set (gnutls_x509_crt crt, const char *input_str, const char *oid)
 }
 
 void
-read_crq_set (gnutls_x509_crq crq, const char *input_str, const char *oid)
+read_crq_set (gnutls_x509_crq_t crq, const char *input_str, const char *oid)
 {
   char input[128];
   int ret;
@@ -322,7 +322,7 @@ get_crl_dist_point_url (void)
 }
 
 void
-get_country_crt_set (gnutls_x509_crt crt)
+get_country_crt_set (gnutls_x509_crt_t crt)
 {
   int ret;
 
@@ -349,7 +349,7 @@ get_country_crt_set (gnutls_x509_crt crt)
 }
 
 void
-get_organization_crt_set (gnutls_x509_crt crt)
+get_organization_crt_set (gnutls_x509_crt_t crt)
 {
   int ret;
 
@@ -378,7 +378,7 @@ get_organization_crt_set (gnutls_x509_crt crt)
 }
 
 void
-get_unit_crt_set (gnutls_x509_crt crt)
+get_unit_crt_set (gnutls_x509_crt_t crt)
 {
   int ret;
 
@@ -406,7 +406,7 @@ get_unit_crt_set (gnutls_x509_crt crt)
 }
 
 void
-get_state_crt_set (gnutls_x509_crt crt)
+get_state_crt_set (gnutls_x509_crt_t crt)
 {
   int ret;
 
@@ -433,7 +433,7 @@ get_state_crt_set (gnutls_x509_crt crt)
 }
 
 void
-get_locality_crt_set (gnutls_x509_crt crt)
+get_locality_crt_set (gnutls_x509_crt_t crt)
 {
   int ret;
 
@@ -459,7 +459,7 @@ get_locality_crt_set (gnutls_x509_crt crt)
 }
 
 void
-get_cn_crt_set (gnutls_x509_crt crt)
+get_cn_crt_set (gnutls_x509_crt_t crt)
 {
   int ret;
 
@@ -484,7 +484,7 @@ get_cn_crt_set (gnutls_x509_crt crt)
 }
 
 void
-get_uid_crt_set (gnutls_x509_crt crt)
+get_uid_crt_set (gnutls_x509_crt_t crt)
 {
   int ret;
 
@@ -508,7 +508,7 @@ get_uid_crt_set (gnutls_x509_crt crt)
 }
 
 void
-get_oid_crt_set (gnutls_x509_crt crt)
+get_oid_crt_set (gnutls_x509_crt_t crt)
 {
   int ret, i;
 
@@ -540,7 +540,7 @@ get_oid_crt_set (gnutls_x509_crt crt)
 
 
 void
-get_pkcs9_email_crt_set (gnutls_x509_crt crt)
+get_pkcs9_email_crt_set (gnutls_x509_crt_t crt)
 {
   int ret;
 
@@ -897,7 +897,7 @@ get_proxy_policy (char **policy, size_t *policylen)
 /* CRQ stuff.
  */
 void
-get_country_crq_set (gnutls_x509_crq crq)
+get_country_crq_set (gnutls_x509_crq_t crq)
 {
   int ret;
 
@@ -924,7 +924,7 @@ get_country_crq_set (gnutls_x509_crq crq)
 }
 
 void
-get_organization_crq_set (gnutls_x509_crq crq)
+get_organization_crq_set (gnutls_x509_crq_t crq)
 {
   int ret;
 
@@ -953,7 +953,7 @@ get_organization_crq_set (gnutls_x509_crq crq)
 }
 
 void
-get_unit_crq_set (gnutls_x509_crq crq)
+get_unit_crq_set (gnutls_x509_crq_t crq)
 {
   int ret;
 
@@ -981,7 +981,7 @@ get_unit_crq_set (gnutls_x509_crq crq)
 }
 
 void
-get_state_crq_set (gnutls_x509_crq crq)
+get_state_crq_set (gnutls_x509_crq_t crq)
 {
   int ret;
 
@@ -1008,7 +1008,7 @@ get_state_crq_set (gnutls_x509_crq crq)
 }
 
 void
-get_locality_crq_set (gnutls_x509_crq crq)
+get_locality_crq_set (gnutls_x509_crq_t crq)
 {
   int ret;
 
@@ -1034,7 +1034,7 @@ get_locality_crq_set (gnutls_x509_crq crq)
 }
 
 void
-get_cn_crq_set (gnutls_x509_crq crq)
+get_cn_crq_set (gnutls_x509_crq_t crq)
 {
   int ret;
 
@@ -1059,7 +1059,7 @@ get_cn_crq_set (gnutls_x509_crq crq)
 }
 
 void
-get_uid_crq_set (gnutls_x509_crq crq)
+get_uid_crq_set (gnutls_x509_crq_t crq)
 {
   int ret;
 
@@ -1083,7 +1083,7 @@ get_uid_crq_set (gnutls_x509_crq crq)
 }
 
 void
-get_oid_crq_set (gnutls_x509_crq crq)
+get_oid_crq_set (gnutls_x509_crq_t crq)
 {
   int ret, i;
 
index 667c3819cdee406ab9fd9355a81b55d97a0f93d0..81c48e9fbf4cac7a8223b0bf553c71c2f7486145 100644 (file)
@@ -12,9 +12,9 @@ extern int time_stamping_key, crl_next_update;
 void cfg_init (void);
 int template_parse (const char *template);
 
-void read_crt_set (gnutls_x509_crt crt, const char *input_str,
+void read_crt_set (gnutls_x509_crt_t crt, const char *input_str,
                   const char *oid);
-void read_crq_set (gnutls_x509_crq crq, const char *input_str,
+void read_crq_set (gnutls_x509_crq_t crq, const char *input_str,
                   const char *oid);
 int read_int (const char *input_str);
 const char *read_str (const char *input_str);
@@ -23,15 +23,15 @@ int read_yesno (const char *input_str);
 const char *get_pass (void);
 const char *get_challenge_pass (void);
 const char *get_crl_dist_point_url (void);
-void get_country_crt_set (gnutls_x509_crt crt);
-void get_organization_crt_set (gnutls_x509_crt crt);
-void get_unit_crt_set (gnutls_x509_crt crt);
-void get_state_crt_set (gnutls_x509_crt crt);
-void get_locality_crt_set (gnutls_x509_crt crt);
-void get_cn_crt_set (gnutls_x509_crt crt);
-void get_uid_crt_set (gnutls_x509_crt crt);
-void get_pkcs9_email_crt_set (gnutls_x509_crt crt);
-void get_oid_crt_set (gnutls_x509_crt crt);
+void get_country_crt_set (gnutls_x509_crt_t crt);
+void get_organization_crt_set (gnutls_x509_crt_t crt);
+void get_unit_crt_set (gnutls_x509_crt_t crt);
+void get_state_crt_set (gnutls_x509_crt_t crt);
+void get_locality_crt_set (gnutls_x509_crt_t crt);
+void get_cn_crt_set (gnutls_x509_crt_t crt);
+void get_uid_crt_set (gnutls_x509_crt_t crt);
+void get_pkcs9_email_crt_set (gnutls_x509_crt_t crt);
+void get_oid_crt_set (gnutls_x509_crt_t crt);
 int get_serial (void);
 int get_days (void);
 int get_ca_status (void);
@@ -52,12 +52,12 @@ const char *get_dns_name (void);
 const char *get_ip_addr (void);
 
 
-void get_cn_crq_set (gnutls_x509_crq crq);
-void get_uid_crq_set (gnutls_x509_crq crq);
-void get_locality_crq_set (gnutls_x509_crq crq);
-void get_state_crq_set (gnutls_x509_crq crq);
-void get_unit_crq_set (gnutls_x509_crq crq);
-void get_organization_crq_set (gnutls_x509_crq crq);
-void get_country_crq_set (gnutls_x509_crq crq);
-void get_oid_crq_set (gnutls_x509_crq crq);
+void get_cn_crq_set (gnutls_x509_crq_t crq);
+void get_uid_crq_set (gnutls_x509_crq_t crq);
+void get_locality_crq_set (gnutls_x509_crq_t crq);
+void get_state_crq_set (gnutls_x509_crq_t crq);
+void get_unit_crq_set (gnutls_x509_crq_t crq);
+void get_organization_crq_set (gnutls_x509_crq_t crq);
+void get_country_crq_set (gnutls_x509_crq_t crq);
+void get_oid_crq_set (gnutls_x509_crq_t crq);
 const char *get_proxy_policy (char **policy, size_t *policylen);
index 24c2e5f9e278209c56880c1a904eb865ebea7568..5749600d6677248d70c3062b5908baea01323ed8 100644 (file)
@@ -41,7 +41,7 @@
 #include <progname.h>
 #include <version-etc.h>
 
-static void print_crl_info (gnutls_x509_crl crl, FILE *out);
+static void print_crl_info (gnutls_x509_crl_t crl, FILE *out);
 int generate_prime (int bits, int how);
 void pkcs7_info (void);
 void smime_to_pkcs7 (void);
@@ -49,20 +49,20 @@ void pkcs12_info (void);
 void generate_pkcs12 (void);
 void verify_chain (void);
 void verify_crl (void);
-gnutls_x509_privkey load_private_key (int mand);
-gnutls_x509_crq load_request (void);
-gnutls_x509_privkey load_ca_private_key (void);
-gnutls_x509_crt load_ca_cert (void);
-gnutls_x509_crt load_cert (int mand);
+gnutls_x509_privkey_t load_private_key (int mand);
+gnutls_x509_crq_t load_request (void);
+gnutls_x509_privkey_t load_ca_private_key (void);
+gnutls_x509_crt_t load_ca_cert (void);
+gnutls_x509_crt_t load_cert (int mand);
 void certificate_info (void);
 void crl_info (void);
 void privkey_info (void);
-static void print_certificate_info (gnutls_x509_crt crt, FILE *out,
+static void print_certificate_info (gnutls_x509_crt_t crt, FILE *out,
                                    unsigned int);
 static void gaa_parser (int argc, char **argv);
 void generate_self_signed (void);
 void generate_request (void);
-gnutls_x509_crt *load_cert_list (int mand, int *size);
+gnutls_x509_crt_t *load_cert_list (int mand, int *size);
 
 static gaainfo info;
 FILE *outfile;
@@ -115,10 +115,10 @@ raw_to_string (const unsigned char *raw, size_t raw_size)
   return buf;
 }
 
-static gnutls_x509_privkey
+static gnutls_x509_privkey_t
 generate_private_key_int (void)
 {
-  gnutls_x509_privkey key;
+  gnutls_x509_privkey_t key;
   int ret, key_type;
 
   if (info.dsa)
@@ -146,7 +146,7 @@ generate_private_key_int (void)
 }
 
 static void
-print_private_key (gnutls_x509_privkey key)
+print_private_key (gnutls_x509_privkey_t key)
 {
   int ret;
   size_t size;
@@ -190,7 +190,7 @@ print_private_key (gnutls_x509_privkey key)
 void
 generate_private_key (void)
 {
-  gnutls_x509_privkey key;
+  gnutls_x509_privkey_t key;
 
   key = generate_private_key_int ();
 
@@ -200,13 +200,13 @@ generate_private_key (void)
 }
 
 
-gnutls_x509_crt
-generate_certificate (gnutls_x509_privkey * ret_key,
-                     gnutls_x509_crt ca_crt,
+gnutls_x509_crt_t
+generate_certificate (gnutls_x509_privkey_t * ret_key,
+                     gnutls_x509_crt_t ca_crt,
                      int proxy)
 {
-  gnutls_x509_crt crt;
-  gnutls_x509_privkey key = NULL;
+  gnutls_x509_crt_t crt;
+  gnutls_x509_privkey_t key = NULL;
   size_t size;
   int ret;
   int serial, client;
@@ -215,7 +215,7 @@ generate_certificate (gnutls_x509_privkey * ret_key,
   int vers = 3;                        /* the default version in the certificate 
                                 */
   unsigned int usage = 0, server;
-  gnutls_x509_crq crq;         /* request */
+  gnutls_x509_crq_t crq;               /* request */
 
   ret = gnutls_x509_crt_init (&crt);
   if (ret < 0)
@@ -507,11 +507,11 @@ generate_certificate (gnutls_x509_privkey * ret_key,
 
 }
 
-gnutls_x509_crl
+gnutls_x509_crl_t
 generate_crl (void)
 {
-  gnutls_x509_crl crl;
-  gnutls_x509_crt *crts;
+  gnutls_x509_crl_t crl;
+  gnutls_x509_crt_t *crts;
   int size;
   int days, result, i;
   time_t now = time (NULL);
@@ -550,8 +550,8 @@ generate_crl (void)
 void
 generate_self_signed (void)
 {
-  gnutls_x509_crt crt;
-  gnutls_x509_privkey key;
+  gnutls_x509_crt_t crt;
+  gnutls_x509_privkey_t key;
   size_t size;
   int result;
   const char *uri;
@@ -596,12 +596,12 @@ generate_self_signed (void)
 void
 generate_signed_certificate (void)
 {
-  gnutls_x509_crt crt;
-  gnutls_x509_privkey key;
+  gnutls_x509_crt_t crt;
+  gnutls_x509_privkey_t key;
   size_t size;
   int result;
-  gnutls_x509_privkey ca_key;
-  gnutls_x509_crt ca_crt;
+  gnutls_x509_privkey_t ca_key;
+  gnutls_x509_crt_t ca_crt;
 
   fprintf (stderr, "Generating a signed certificate...\n");
 
@@ -638,8 +638,8 @@ generate_signed_certificate (void)
 void
 generate_proxy_certificate (void)
 {
-  gnutls_x509_crt crt, eecrt;
-  gnutls_x509_privkey key, eekey;
+  gnutls_x509_crt_t crt, eecrt;
+  gnutls_x509_privkey_t key, eekey;
   size_t size;
   int result;
 
@@ -672,10 +672,10 @@ generate_proxy_certificate (void)
 void
 generate_signed_crl (void)
 {
-  gnutls_x509_crl crl;
+  gnutls_x509_crl_t crl;
   int result;
-  gnutls_x509_privkey ca_key;
-  gnutls_x509_crt ca_crt;
+  gnutls_x509_privkey_t ca_key;
+  gnutls_x509_crt_t ca_crt;
 
   fprintf (stderr, "Generating a signed CRL...\n");
 
@@ -697,11 +697,11 @@ generate_signed_crl (void)
 void
 update_signed_certificate (void)
 {
-  gnutls_x509_crt crt;
+  gnutls_x509_crt_t crt;
   size_t size;
   int result;
-  gnutls_x509_privkey ca_key;
-  gnutls_x509_crt ca_crt;
+  gnutls_x509_privkey_t ca_key;
+  gnutls_x509_crt_t ca_crt;
   int days;
   time_t tim = time (NULL);
 
@@ -878,10 +878,10 @@ gaa_parser (int argc, char **argv)
 void
 certificate_info (void)
 {
-  gnutls_x509_crt crt[MAX_CRTS];
+  gnutls_x509_crt_t crt[MAX_CRTS];
   size_t size;
   int ret, i, count;
-  gnutls_datum pem;
+  gnutls_datum_t pem;
   unsigned int crt_num;
 
   pem.data = fread_file (infile, &size);
@@ -931,7 +931,7 @@ certificate_info (void)
        }
       else
        {
-         gnutls_datum xml;
+         gnutls_datum_t xml;
 
          ret = gnutls_x509_crt_to_xml (crt[i], &xml, GNUTLS_XML_SHOW_ALL);
          if (ret < 0)
@@ -945,7 +945,7 @@ certificate_info (void)
 }
 
 static void
-print_hex_datum (gnutls_datum * dat)
+print_hex_datum (gnutls_datum_t * dat)
 {
   unsigned int j;
 #define SPACE "\t"
@@ -961,7 +961,7 @@ print_hex_datum (gnutls_datum * dat)
 
 
 static void
-print_certificate_info (gnutls_x509_crt crt, FILE *out, unsigned int all)
+print_certificate_info (gnutls_x509_crt_t crt, FILE *out, unsigned int all)
 {
   gnutls_datum_t info;
   int ret;
@@ -984,7 +984,7 @@ print_certificate_info (gnutls_x509_crt crt, FILE *out, unsigned int all)
 }
 
 static void
-print_crl_info (gnutls_x509_crl crl, FILE *out)
+print_crl_info (gnutls_x509_crl_t crl, FILE *out)
 {
   gnutls_datum_t info;
   int ret;
@@ -1009,7 +1009,7 @@ print_crl_info (gnutls_x509_crl crl, FILE *out)
 void
 crl_info (void)
 {
-  gnutls_x509_crl crl;
+  gnutls_x509_crl_t crl;
   int ret;
   size_t size;
   gnutls_datum_t pem;
@@ -1036,10 +1036,10 @@ crl_info (void)
 void
 privkey_info (void)
 {
-  gnutls_x509_privkey key;
+  gnutls_x509_privkey_t key;
   size_t size;
   int ret;
-  gnutls_datum pem;
+  gnutls_datum_t pem;
   const char *cprint;
   const char *pass;
 
@@ -1083,7 +1083,7 @@ privkey_info (void)
    */
   if (ret == GNUTLS_PK_RSA)
     {
-      gnutls_datum m, e, d, p, q, u;
+      gnutls_datum_t m, e, d, p, q, u;
 
       ret = gnutls_x509_privkey_export_rsa_raw (key, &m, &e, &d, &p, &q, &u);
       if (ret < 0)
@@ -1108,7 +1108,7 @@ privkey_info (void)
     }
   else if (ret == GNUTLS_PK_DSA)
     {
-      gnutls_datum p, q, g, y, x;
+      gnutls_datum_t p, q, g, y, x;
 
       ret = gnutls_x509_privkey_export_dsa_raw (key, &p, &q, &g, &y, &x);
       if (ret < 0)
@@ -1160,12 +1160,12 @@ privkey_info (void)
 /* Load the private key.
  * @mand should be non zero if it is required to read a private key.
  */
-gnutls_x509_privkey
+gnutls_x509_privkey_t
 load_private_key (int mand)
 {
-  gnutls_x509_privkey key;
+  gnutls_x509_privkey_t key;
   int ret;
-  gnutls_datum dat;
+  gnutls_datum_t dat;
   size_t size;
 
   if (!info.privkey && !mand)
@@ -1203,12 +1203,12 @@ load_private_key (int mand)
 
 /* Load the Certificate Request.
  */
-gnutls_x509_crq
+gnutls_x509_crq_t
 load_request (void)
 {
-  gnutls_x509_crq crq;
+  gnutls_x509_crq_t crq;
   int ret;
-  gnutls_datum dat;
+  gnutls_datum_t dat;
   size_t size;
 
   if (!info.request)
@@ -1236,12 +1236,12 @@ load_request (void)
 
 /* Load the CA's private key.
  */
-gnutls_x509_privkey
+gnutls_x509_privkey_t
 load_ca_private_key (void)
 {
-  gnutls_x509_privkey key;
+  gnutls_x509_privkey_t key;
   int ret;
-  gnutls_datum dat;
+  gnutls_datum_t dat;
   size_t size;
 
   if (info.ca_privkey == NULL)
@@ -1276,12 +1276,12 @@ load_ca_private_key (void)
 
 /* Loads the CA's certificate
  */
-gnutls_x509_crt
+gnutls_x509_crt_t
 load_ca_cert (void)
 {
-  gnutls_x509_crt crt;
+  gnutls_x509_crt_t crt;
   int ret;
-  gnutls_datum dat;
+  gnutls_datum_t dat;
   size_t size;
 
   if (info.ca == NULL)
@@ -1311,10 +1311,10 @@ load_ca_cert (void)
  * If mand is non zero then a certificate is mandatory. Otherwise
  * null will be returned if the certificate loading fails.
  */
-gnutls_x509_crt
+gnutls_x509_crt_t
 load_cert (int mand)
 {
-  gnutls_x509_crt *crt;
+  gnutls_x509_crt_t *crt;
   int size;
 
   crt = load_cert_list (mand, &size);
@@ -1326,14 +1326,14 @@ load_cert (int mand)
 
 /* Loads a certificate list
  */
-gnutls_x509_crt *
+gnutls_x509_crt_t *
 load_cert_list (int mand, int *crt_size)
 {
   FILE *fd;
-  static gnutls_x509_crt crt[MAX_CERTS];
+  static gnutls_x509_crt_t crt[MAX_CERTS];
   char *ptr;
   int ret, i;
-  gnutls_datum dat;
+  gnutls_datum_t dat;
   size_t size;
   int ptr_size;
 
@@ -1400,8 +1400,8 @@ load_cert_list (int mand, int *crt_size)
 void
 generate_request (void)
 {
-  gnutls_x509_crq crq;
-  gnutls_x509_privkey key;
+  gnutls_x509_crq_t crq;
+  gnutls_x509_privkey_t key;
   int ret;
   const char *pass;
   size_t size;
@@ -1462,9 +1462,9 @@ generate_request (void)
 
 }
 
-static void print_verification_res (gnutls_x509_crt crt,
-                                   gnutls_x509_crt issuer,
-                                   gnutls_x509_crl * crl_list,
+static void print_verification_res (gnutls_x509_crt_t crt,
+                                   gnutls_x509_crt_t issuer,
+                                   gnutls_x509_crl_t * crl_list,
                                    int crl_list_size);
 
 #define CERT_SEP "-----BEGIN CERT"
@@ -1479,9 +1479,9 @@ _verify_x509_mem (const void *cert, int cert_size)
   char issuer_name[256];
   size_t name_size;
   size_t issuer_name_size;
-  gnutls_datum tmp;
-  gnutls_x509_crt *x509_cert_list = NULL;
-  gnutls_x509_crl *x509_crl_list = NULL;
+  gnutls_datum_t tmp;
+  gnutls_x509_crt_t *x509_cert_list = NULL;
+  gnutls_x509_crl_t *x509_crl_list = NULL;
   int x509_ncerts, x509_ncrls;
 
 
@@ -1499,8 +1499,8 @@ _verify_x509_mem (const void *cert, int cert_size)
     do
       {
        x509_crl_list =
-         (gnutls_x509_crl *) realloc (x509_crl_list,
-                                      i * sizeof (gnutls_x509_crl));
+         (gnutls_x509_crl_t *) realloc (x509_crl_list,
+                                      i * sizeof (gnutls_x509_crl_t));
        if (x509_crl_list == NULL)
          error (EXIT_FAILURE, 0, "memory error");
 
@@ -1540,8 +1540,8 @@ _verify_x509_mem (const void *cert, int cert_size)
   do
     {
       x509_cert_list =
-       (gnutls_x509_crt *) realloc (x509_cert_list,
-                                    i * sizeof (gnutls_x509_crt));
+       (gnutls_x509_crt_t *) realloc (x509_cert_list,
+                                    i * sizeof (gnutls_x509_crt_t));
       if (x509_cert_list == NULL)
        error (EXIT_FAILURE, 0, "memory error");
 
@@ -1672,9 +1672,9 @@ _verify_x509_mem (const void *cert, int cert_size)
 }
 
 static void
-print_verification_res (gnutls_x509_crt crt,
-                       gnutls_x509_crt issuer,
-                       gnutls_x509_crl * crl_list, int crl_list_size)
+print_verification_res (gnutls_x509_crt_t crt,
+                       gnutls_x509_crt_t issuer,
+                       gnutls_x509_crl_t * crl_list, int crl_list_size)
 {
   unsigned int output;
   int comma = 0;
@@ -1765,10 +1765,10 @@ verify_crl (void)
   unsigned int output;
   int comma = 0;
   int ret;
-  gnutls_datum pem;
-  gnutls_x509_crl crl;
+  gnutls_datum_t pem;
+  gnutls_x509_crl_t crl;
   time_t now = time (0);
-  gnutls_x509_crt issuer;
+  gnutls_x509_crt_t issuer;
 
   issuer = load_ca_cert ();
 
@@ -1855,16 +1855,16 @@ verify_crl (void)
 void
 generate_pkcs12 (void)
 {
-  gnutls_pkcs12 pkcs12;
-  gnutls_x509_crt *crts;
-  gnutls_x509_privkey key;
+  gnutls_pkcs12_t pkcs12;
+  gnutls_x509_crt_t *crts;
+  gnutls_x509_privkey_t key;
   int result;
   size_t size;
-  gnutls_datum data;
+  gnutls_datum_t data;
   const char *password;
   const char *name;
   unsigned int flags;
-  gnutls_datum key_id;
+  gnutls_datum_t key_id;
   unsigned char _key_id[20];
   int index;
   int ncrts;
@@ -1888,7 +1888,7 @@ generate_pkcs12 (void)
 
   for (i = 0; i < ncrts; i++)
     {
-      gnutls_pkcs12_bag bag;
+      gnutls_pkcs12_bag_t bag;
 
       result = gnutls_pkcs12_bag_init (&bag);
       if (result < 0)
@@ -1933,7 +1933,7 @@ generate_pkcs12 (void)
 
   if (key)
     {
-      gnutls_pkcs12_bag kbag;
+      gnutls_pkcs12_bag_t kbag;
 
       result = gnutls_pkcs12_bag_init (&kbag);
       if (result < 0)
@@ -1997,7 +1997,7 @@ generate_pkcs12 (void)
 }
 
 const char *
-BAGTYPE (gnutls_pkcs12_bag_type x)
+BAGTYPE (gnutls_pkcs12_bag_type_t x)
 {
   switch (x)
     {
@@ -2019,13 +2019,13 @@ BAGTYPE (gnutls_pkcs12_bag_type x)
 }
 
 void
-print_bag_data (gnutls_pkcs12_bag bag)
+print_bag_data (gnutls_pkcs12_bag_t bag)
 {
   int result;
   int count, i, type;
-  gnutls_datum cdata, id;
+  gnutls_datum_t cdata, id;
   const char *str, *name;
-  gnutls_datum out;
+  gnutls_datum_t out;
 
   count = gnutls_pkcs12_bag_get_count (bag);
   if (count < 0)
@@ -2094,11 +2094,11 @@ print_bag_data (gnutls_pkcs12_bag bag)
 void
 pkcs12_info (void)
 {
-  gnutls_pkcs12 pkcs12;
-  gnutls_pkcs12_bag bag;
+  gnutls_pkcs12_t pkcs12;
+  gnutls_pkcs12_bag_t bag;
   int result;
   size_t size;
-  gnutls_datum data;
+  gnutls_datum_t data;
   const char *password;
   int index;
 
@@ -2171,10 +2171,10 @@ pkcs12_info (void)
 void
 pkcs7_info (void)
 {
-  gnutls_pkcs7 pkcs7;
+  gnutls_pkcs7_t pkcs7;
   int result;
   size_t size;
-  gnutls_datum data, b64;
+  gnutls_datum_t data, b64;
   int index, count;
 
   result = gnutls_pkcs7_init (&pkcs7);
index 394255c9311d75404fb8a9bda492055054270a81..58649c37f7e835534585d554feb580d387cf5bd5 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -83,7 +83,7 @@ static int x509ctype;
 static int disable_extensions;
 
 char *psk_username = NULL;
-gnutls_datum psk_key = { NULL, 0 };
+gnutls_datum_t psk_key = { NULL, 0 };
 
 static gnutls_srp_client_credentials_t srp_cred;
 static gnutls_psk_client_credentials_t psk_cred;
@@ -118,7 +118,7 @@ static int authz_server_formats[PRI_MAX] = {
 typedef struct
 {
   int fd;
-  gnutls_session session;
+  gnutls_session_t session;
   int secure;
   char *hostname;
   char *ip;
@@ -145,11 +145,11 @@ static void init_global_tls_stuff (void);
 /* Helper functions to load a certificate and key
  * files into memory.
  */
-static gnutls_datum
+static gnutls_datum_t
 load_file (const char *file)
 {
   FILE *f;
-  gnutls_datum loaded_file = { NULL, 0 };
+  gnutls_datum_t loaded_file = { NULL, 0 };
   long filelen;
   void *ptr;
 
@@ -169,18 +169,18 @@ load_file (const char *file)
 }
 
 static void
-unload_file (gnutls_datum data)
+unload_file (gnutls_datum_t data)
 {
   free (data.data);
 }
 
 #define MAX_CRT 6
 static unsigned int x509_crt_size;
-static gnutls_x509_crt x509_crt[MAX_CRT];
-static gnutls_x509_privkey x509_key = NULL;
+static gnutls_x509_crt_t x509_crt[MAX_CRT];
+static gnutls_x509_privkey_t x509_key = NULL;
 
-static gnutls_openpgp_key pgp_crt = NULL;
-static gnutls_openpgp_privkey pgp_key = NULL;
+static gnutls_openpgp_key_t pgp_crt = NULL;
+static gnutls_openpgp_privkey_t pgp_key = NULL;
 
 /* Load the certificate and the private key.
  */
@@ -189,7 +189,7 @@ load_keys (void)
 {
   unsigned int crt_num;
   int ret;
-  gnutls_datum data;
+  gnutls_datum_t data;
 
   if (x509_certfile != NULL && x509_keyfile != NULL)
     {
@@ -307,9 +307,9 @@ load_keys (void)
  */
 
 static int
-cert_callback (gnutls_session session,
-              const gnutls_datum * req_ca_rdn, int nreqs,
-              const gnutls_pk_algorithm * sign_algos,
+cert_callback (gnutls_session_t session,
+              const gnutls_datum_t * req_ca_rdn, int nreqs,
+              const gnutls_pk_algorithm_t * sign_algos,
               int sign_algos_length, gnutls_retr_st * st)
 {
   char issuer_dn[256];
@@ -470,12 +470,12 @@ authz_recv_callback (gnutls_session_t session,
 
 #endif
 
-/* initializes a gnutls_session with some defaults.
+/* initializes a gnutls_session_t with some defaults.
  */
-static gnutls_session
+static gnutls_session_t
 init_tls_session (const char *hostname)
 {
-  gnutls_session session;
+  gnutls_session_t session;
 
   gnutls_init (&session, GNUTLS_CLIENT);
 
@@ -962,7 +962,7 @@ do_handshake (socket_st * socket)
 {
   int ret;
   gnutls_transport_set_ptr (socket->session,
-                           (gnutls_transport_ptr) socket->fd);
+                           (gnutls_transport_ptr_t) socket->fd);
   do
     {
       ret = gnutls_handshake (socket->session);
@@ -1000,7 +1000,7 @@ do_handshake (socket_st * socket)
 }
 
 static int
-srp_username_callback (gnutls_session session,
+srp_username_callback (gnutls_session_t session,
                       unsigned int times, char **username, char **password)
 {
   if (srp_username == NULL || srp_passwd == NULL)
index f7cfebfdad6c388b8cac41a9a63f00856086a028..70adb244b9102d8596a0f9d3d152a305af61e362 100644 (file)
@@ -84,10 +84,10 @@ my_ctime (const time_t * tv)
 
 
 void
-print_x509_info (gnutls_session session, const char *hostname)
+print_x509_info (gnutls_session_t session, const char *hostname)
 {
-  gnutls_x509_crt crt;
-  const gnutls_datum *cert_list;
+  gnutls_x509_crt_t crt;
+  const gnutls_datum_t *cert_list;
   size_t cert_list_size = 0;
   int ret;
   char digest[20];
@@ -168,7 +168,7 @@ print_x509_info (gnutls_session session, const char *hostname)
       if (xml)
        {
 #ifdef ENABLE_PKI
-         gnutls_datum xml_data;
+         gnutls_datum_t xml_data;
 
          ret = gnutls_x509_crt_to_xml (crt, &xml_data, 0);
          if (ret < 0)
@@ -238,7 +238,7 @@ print_x509_info (gnutls_session session, const char *hostname)
 #ifdef ENABLE_PKI
              if (algo == GNUTLS_PK_RSA)
                {
-                 gnutls_datum e, m;
+                 gnutls_datum_t e, m;
 
                  ret = gnutls_x509_crt_get_pk_rsa_raw (crt, &m, &e);
                  if (ret >= 0)
@@ -255,7 +255,7 @@ print_x509_info (gnutls_session session, const char *hostname)
                }
              else if (algo == GNUTLS_PK_DSA)
                {
-                 gnutls_datum p, q, g, y;
+                 gnutls_datum_t p, q, g, y;
 
                  ret = gnutls_x509_crt_get_pk_dsa_raw (crt, &p, &q, &g, &y);
                  if (ret >= 0)
@@ -303,7 +303,7 @@ print_x509_info (gnutls_session session, const char *hostname)
 #ifdef ENABLE_OPENPGP
 
 void
-print_openpgp_info (gnutls_session session, const char *hostname)
+print_openpgp_info (gnutls_session_t session, const char *hostname)
 {
 
   char digest[20];
@@ -313,8 +313,8 @@ print_openpgp_info (gnutls_session session, const char *hostname)
   const char *cstr;
   char name[256];
   size_t name_len = sizeof (name);
-  gnutls_openpgp_key crt;
-  const gnutls_datum *cert_list;
+  gnutls_openpgp_key_t crt;
+  const gnutls_datum_t *cert_list;
   int cert_list_size = 0;
   time_t expiret;
   time_t activet;
@@ -374,7 +374,7 @@ print_openpgp_info (gnutls_session session, const char *hostname)
 
       if (xml)
        {
-         gnutls_datum xml_data;
+         gnutls_datum_t xml_data;
 
          ret = gnutls_openpgp_key_to_xml (crt, &xml_data, 0);
          if (ret < 0)
@@ -437,7 +437,7 @@ print_openpgp_info (gnutls_session session, const char *hostname)
 #endif
 
 void
-print_cert_vrfy (gnutls_session session)
+print_cert_vrfy (gnutls_session_t session)
 {
   int rc;
   unsigned int status;
@@ -479,11 +479,11 @@ print_cert_vrfy (gnutls_session session)
 }
 
 int
-print_info (gnutls_session session, const char *hostname)
+print_info (gnutls_session_t session, const char *hostname)
 {
   const char *tmp;
-  gnutls_credentials_type cred;
-  gnutls_kx_algorithm kx;
+  gnutls_credentials_type_t cred;
+  gnutls_kx_algorithm_t kx;
 
 
   /* print the key exchange's algorithm name
@@ -570,7 +570,7 @@ print_info (gnutls_session session, const char *hostname)
 }
 
 void
-print_cert_info (gnutls_session session, const char *hostname)
+print_cert_info (gnutls_session_t session, const char *hostname)
 {
 
   if (gnutls_certificate_client_get_request_status( session) != 0)
index 966077146a380db9948405b815eb9b241ea6bfee..d22d995c13835f1fdfd9d1c7366777578da40f25 100644 (file)
@@ -23,8 +23,8 @@
 
 extern const char str_unknown[];
 
-int print_info (gnutls_session state, const char *hostname);
-void print_cert_info (gnutls_session state, const char *hostname);
+int print_info (gnutls_session_t state, const char *hostname);
+void print_cert_info (gnutls_session_t state, const char *hostname);
 void print_list (int verbose);
 
 void parse_comp (char **comp, int ncomp, int *comp_priority);
index 8f46fe116db0c1568d4c5fc6d8915aaf14ba78aa..e45b90ca9aa96e6710f473c0931535b57dac937c 100644 (file)
@@ -73,11 +73,11 @@ srptool_version (void)
 
 int crypt_int (const char *username, const char *passwd, int salt,
               char *tpasswd_conf, char *tpasswd, int uindex);
-static int read_conf_values (gnutls_datum * g, gnutls_datum * n, char *str);
+static int read_conf_values (gnutls_datum_t * g, gnutls_datum_t * n, char *str);
 static int _verify_passwd_int (const char *username, const char *passwd,
                               char *verifier, char *salt,
-                              const gnutls_datum * g,
-                              const gnutls_datum * n);
+                              const gnutls_datum_t * g,
+                              const gnutls_datum_t * n);
 
 void
 srptool_version (void)
@@ -91,7 +91,7 @@ srptool_version (void)
 
 
 static void
-print_num (const char *msg, const gnutls_datum * num)
+print_num (const char *msg, const gnutls_datum_t * num)
 {
   unsigned int i;
 
@@ -115,8 +115,8 @@ generate_create_conf (char *tpasswd_conf)
   FILE *fd;
   char line[5 * 1024];
   int index = 1;
-  gnutls_datum g, n;
-  gnutls_datum str_g, str_n;
+  gnutls_datum_t g, n;
+  gnutls_datum_t str_g, str_n;
 
   fd = fopen (tpasswd_conf, "w");
   if (fd == NULL)
@@ -183,10 +183,10 @@ generate_create_conf (char *tpasswd_conf)
 static int
 _verify_passwd_int (const char *username, const char *passwd,
                    char *verifier, char *salt,
-                   const gnutls_datum * g, const gnutls_datum * n)
+                   const gnutls_datum_t * g, const gnutls_datum_t * n)
 {
   char _salt[1024];
-  gnutls_datum tmp, raw_salt, new_verifier;
+  gnutls_datum_t tmp, raw_salt, new_verifier;
   size_t salt_size;
   char *pos;
 
@@ -327,7 +327,7 @@ verify_passwd (char *conffile, char *tpasswd, char *username,
   FILE *fd;
   char line[5 * 1024];
   unsigned int i;
-  gnutls_datum g, n;
+  gnutls_datum_t g, n;
   int iindex;
   char *p, *pos;
 
@@ -498,12 +498,12 @@ main (int argc, char **argv)
 
 char *
 _srp_crypt (const char *username, const char *passwd, int salt_size,
-           const gnutls_datum * g, const gnutls_datum * n)
+           const gnutls_datum_t * g, const gnutls_datum_t * n)
 {
   char salt[128];
   static char result[1024];
-  gnutls_datum dat_salt, txt_salt;
-  gnutls_datum verifier, txt_verifier;
+  gnutls_datum_t dat_salt, txt_salt;
+  gnutls_datum_t verifier, txt_verifier;
 
   if ((unsigned) salt_size > sizeof (salt))
     return NULL;
@@ -556,7 +556,7 @@ crypt_int (const char *username, const char *passwd, int salt_size,
 {
   FILE *fd;
   char *cr;
-  gnutls_datum g, n;
+  gnutls_datum_t g, n;
   char line[5 * 1024];
   char *p, *pp;
   int iindex;
@@ -686,12 +686,12 @@ crypt_int (const char *username, const char *passwd, int salt_size,
  * int(index):base64(n):base64(g)
  */
 static int
-read_conf_values (gnutls_datum * g, gnutls_datum * n, char *str)
+read_conf_values (gnutls_datum_t * g, gnutls_datum_t * n, char *str)
 {
   char *p;
   int len;
   int index, ret;
-  gnutls_datum dat;
+  gnutls_datum_t dat;
 
   index = atoi (str);
 
index 6945abed5449f4fd11b7a69500fdd1bd622aa450..cfd282abb3c81ccafa7f3a334da2bf212455a5b5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004,2005 Free Software Foundation
+ * Copyright (C) 2004,2005,2007 Free Software Foundation
  * Copyright (C) 2001,2002,2003 Nikos Mavroyanopoulos
  *
  * This file is part of GNUTLS.
@@ -47,8 +47,8 @@ generate_prime (int bits, int how)
 {
   unsigned int i;
   int ret;
-  gnutls_dh_params dh_params;
-  gnutls_datum p, g;
+  gnutls_dh_params_t dh_params;
+  gnutls_datum_t p, g;
 
   gnutls_dh_params_init (&dh_params);
 
index 6e0aff006f24faaf38d91f7663af058346f31bd6..640c07b70ca0e6d902070ed0551bddb0bc87a631 100644 (file)
--- a/src/psk.c
+++ b/src/psk.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005 Free Software Foundation
+ * Copyright (C) 2005, 2007 Free Software Foundation
  *
  * This file is part of GNUTLS.
  *
@@ -85,7 +85,7 @@ main (int argc, char **argv)
   struct passwd *pwd;
   unsigned char key[MAX_KEY_SIZE];
   char hex_key[MAX_KEY_SIZE * 2 + 1];
-  gnutls_datum dkey;
+  gnutls_datum_t dkey;
   size_t hex_key_size = sizeof (hex_key);
 
   if ((ret = gnutls_global_init ()) < 0)
index c21059751787a0c7a0346070b8db4a7a2a572810..9f195e00bc27dc9467b91ba98c0f4cad74450f75 100644 (file)
@@ -120,9 +120,9 @@ const int ssl_session_cache = 128;
 
 static void wrap_db_init (void);
 static void wrap_db_deinit (void);
-static int wrap_db_store (void *dbf, gnutls_datum key, gnutls_datum data);
-static gnutls_datum wrap_db_fetch (void *dbf, gnutls_datum key);
-static int wrap_db_delete (void *dbf, gnutls_datum key);
+static int wrap_db_store (void *dbf, gnutls_datum_t key, gnutls_datum_t data);
+static gnutls_datum_t wrap_db_fetch (void *dbf, gnutls_datum_t key);
+static int wrap_db_delete (void *dbf, gnutls_datum_t key);
 
 
 #define HTTP_STATE_REQUEST     1
@@ -133,7 +133,7 @@ LIST_TYPE_DECLARE (listener_item, char *http_request;
                   char *http_response; int request_length;
                   int response_length; int response_written;
                   int http_state;
-                  int fd; gnutls_session tls_session; int handshake_ok;);
+                  int fd; gnutls_session_t tls_session; int handshake_ok;);
 
 static const char *
 safe_strerror (int value)
@@ -166,8 +166,8 @@ listener_free (listener_item * j)
  * otherwise we should add them here.
  */
 
-gnutls_dh_params dh_params = NULL;
-gnutls_rsa_params rsa_params = NULL;
+gnutls_dh_params_t dh_params = NULL;
+gnutls_rsa_params_t rsa_params = NULL;
 
 static int
 generate_dh_primes (void)
@@ -204,7 +204,7 @@ read_dh_params (void)
 {
   char tmpdata[2048];
   int size;
-  gnutls_datum params;
+  gnutls_datum_t params;
   FILE *fd;
 
   if (gnutls_dh_params_init (&dh_params) < 0)
@@ -253,7 +253,7 @@ static char pkcs3[] =
 static int
 static_dh_params (void)
 {
-  gnutls_datum params = { pkcs3, sizeof (pkcs3) };
+  gnutls_datum_t params = { pkcs3, sizeof (pkcs3) };
   int ret;
 
   if (gnutls_dh_params_init (&dh_params) < 0)
@@ -276,7 +276,7 @@ static_dh_params (void)
 }
 
 static int
-get_params (gnutls_session session, gnutls_params_type type,
+get_params (gnutls_session_t session, gnutls_params_type_t type,
            gnutls_params_st * st)
 {
 
@@ -433,10 +433,10 @@ authz_recv_callback (gnutls_session_t session,
 }
 #endif
 
-gnutls_session
+gnutls_session_t
 initialize_session (void)
 {
-  gnutls_session session;
+  gnutls_session_t session;
 
   gnutls_init (&session, GNUTLS_SERVER);
 
@@ -502,13 +502,13 @@ static const char DEFAULT_DATA[] =
  */
 #define tmp2 &http_buffer[strlen(http_buffer)]
 char *
-peer_print_info (gnutls_session session, int *ret_length, const char *header)
+peer_print_info (gnutls_session_t session, int *ret_length, const char *header)
 {
   const char *tmp;
   unsigned char sesid[32];
   size_t i, sesid_size;
   char *http_buffer;
-  gnutls_kx_algorithm kx_alg;
+  gnutls_kx_algorithm_t kx_alg;
   size_t len = 5 * 1024 + strlen (header);
   char *crtinfo = NULL;
   size_t ncrtinfo = 0;
@@ -758,7 +758,7 @@ listen_socket (const char *name, int listen_port)
 }
 
 static void
-get_response (gnutls_session session, char *request,
+get_response (gnutls_session_t session, char *request,
              char **response, int *response_length)
 {
   char *p, *h;
@@ -806,7 +806,7 @@ terminate (int sig)
 
 
 static void
-check_alert (gnutls_session session, int ret)
+check_alert (gnutls_session_t session, int ret)
 {
   if (ret == GNUTLS_E_WARNING_ALERT_RECEIVED
       || ret == GNUTLS_E_FATAL_ALERT_RECEIVED)
@@ -1117,7 +1117,7 @@ main (int argc, char **argv)
 /* a new connection has arrived */
       if (FD_ISSET (h, &rd))
        {
-         gnutls_session tls_session;
+         gnutls_session_t tls_session;
 
          tls_session = initialize_session ();
 
@@ -1143,7 +1143,7 @@ main (int argc, char **argv)
 
              j->tls_session = tls_session;
              gnutls_transport_set_ptr (tls_session,
-                                       (gnutls_transport_ptr) accept_fd);
+                                       (gnutls_transport_ptr_t) accept_fd);
              j->handshake_ok = 0;
 
              if (verbose == 0)
@@ -1509,7 +1509,7 @@ wrap_db_deinit (void)
 }
 
 static int
-wrap_db_store (void *dbf, gnutls_datum key, gnutls_datum data)
+wrap_db_store (void *dbf, gnutls_datum_t key, gnutls_datum_t data)
 {
 
   if (cache_db == NULL)
@@ -1532,10 +1532,10 @@ wrap_db_store (void *dbf, gnutls_datum key, gnutls_datum data)
   return 0;
 }
 
-static gnutls_datum
-wrap_db_fetch (void *dbf, gnutls_datum key)
+static gnutls_datum_t
+wrap_db_fetch (void *dbf, gnutls_datum_t key)
 {
-  gnutls_datum res = { NULL, 0 };
+  gnutls_datum_t res = { NULL, 0 };
   int i;
 
   if (cache_db == NULL)
@@ -1563,7 +1563,7 @@ wrap_db_fetch (void *dbf, gnutls_datum key)
 }
 
 static int
-wrap_db_delete (void *dbf, gnutls_datum key)
+wrap_db_delete (void *dbf, gnutls_datum_t key)
 {
   int i;
 
index 9a6892378012471e3f647ff45898b8011aad69e3..9c36b20b9990caa41b2697abd24bd9b5f42c98a2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004, 2006 Free Software Foundation
+ * Copyright (C) 2004, 2006, 2007 Free Software Foundation
  * Copyright (C) 2000,2001,2002,2003 Nikos Mavroyanopoulos
  *
  * This file is part of GNUTLS.
@@ -37,9 +37,9 @@
 #include <common.h>
 #include <tests.h>
 
-extern gnutls_srp_client_credentials srp_cred;
-extern gnutls_anon_client_credentials anon_cred;
-extern gnutls_certificate_credentials xcred;
+extern gnutls_srp_client_credentials_t srp_cred;
+extern gnutls_anon_client_credentials_t anon_cred;
+extern gnutls_certificate_credentials_t xcred;
 
 extern int verbose;
 
@@ -55,7 +55,7 @@ static int sfree = 0;
 static int handshake_output = 0;
 
 int
-do_handshake (gnutls_session session)
+do_handshake (gnutls_session_t session)
 {
   int ret, alert;
 
@@ -126,7 +126,7 @@ static const int cert_type_priority[16] = { GNUTLS_CRT_X509, 0 };
 #define ADD_ALL_CERTTYPES(session) gnutls_certificate_type_set_priority(session, cert_type_priority)
 
 static void
-ADD_KX (gnutls_session session, int kx)
+ADD_KX (gnutls_session_t session, int kx)
 {
   static int _kx_priority[] = { 0, 0 };
   _kx_priority[0] = kx;
@@ -135,7 +135,7 @@ ADD_KX (gnutls_session session, int kx)
 }
 
 static void
-ADD_KX2 (gnutls_session session, int kx1, int kx2)
+ADD_KX2 (gnutls_session_t session, int kx1, int kx2)
 {
   static int _kx_priority[] = { 0, 0, 0 };
   _kx_priority[0] = kx1;
@@ -145,7 +145,7 @@ ADD_KX2 (gnutls_session session, int kx1, int kx2)
 }
 
 static void
-ADD_CIPHER (gnutls_session session, int cipher)
+ADD_CIPHER (gnutls_session_t session, int cipher)
 {
   static int _cipher_priority[] = { 0, 0 };
   _cipher_priority[0] = cipher;
@@ -154,7 +154,7 @@ ADD_CIPHER (gnutls_session session, int cipher)
 }
 
 static void
-ADD_CIPHER3 (gnutls_session session, int cipher1, int cipher2, int cipher3)
+ADD_CIPHER3 (gnutls_session_t session, int cipher1, int cipher2, int cipher3)
 {
   static int _cipher_priority[] = { 0, 0, 0, 0 };
   _cipher_priority[0] = cipher1;
@@ -165,7 +165,7 @@ ADD_CIPHER3 (gnutls_session session, int cipher1, int cipher2, int cipher3)
 }
 
 static void
-ADD_MAC (gnutls_session session, int mac)
+ADD_MAC (gnutls_session_t session, int mac)
 {
   static int _mac_priority[] = { 0, 0 };
   _mac_priority[0] = mac;
@@ -174,7 +174,7 @@ ADD_MAC (gnutls_session session, int mac)
 }
 
 static void
-ADD_COMP (gnutls_session session, int c)
+ADD_COMP (gnutls_session_t session, int c)
 {
   static int _comp_priority[] = { 0, 0 };
   _comp_priority[0] = c;
@@ -183,7 +183,7 @@ ADD_COMP (gnutls_session session, int c)
 }
 
 static void
-ADD_CERTTYPE (gnutls_session session, int ctype)
+ADD_CERTTYPE (gnutls_session_t session, int ctype)
 {
   static int _ct_priority[] = { 0, 0 };
   _ct_priority[0] = ctype;
@@ -192,7 +192,7 @@ ADD_CERTTYPE (gnutls_session session, int ctype)
 }
 
 static void
-ADD_PROTOCOL (gnutls_session session, int protocol)
+ADD_PROTOCOL (gnutls_session_t session, int protocol)
 {
   static int _proto_priority[] = { 0, 0 };
   _proto_priority[0] = protocol;
@@ -201,7 +201,7 @@ ADD_PROTOCOL (gnutls_session session, int protocol)
 }
 
 static void
-ADD_PROTOCOL3 (gnutls_session session, int p1, int p2, int p3)
+ADD_PROTOCOL3 (gnutls_session_t session, int p1, int p2, int p3)
 {
   static int _proto_priority[] = { 0, 0, 0, 0 };
   _proto_priority[0] = p1;
@@ -215,7 +215,7 @@ ADD_PROTOCOL3 (gnutls_session session, int p1, int p2, int p3)
 static int srp_detected;
 
 int
-_test_srp_username_callback (gnutls_session session, unsigned int times,
+_test_srp_username_callback (gnutls_session_t session, unsigned int times,
                             char **username, char **password)
 {
   if (times == 1)
@@ -227,7 +227,7 @@ _test_srp_username_callback (gnutls_session session, unsigned int times,
 }
 
 test_code_t
-test_srp (gnutls_session session)
+test_srp (gnutls_session_t session)
 {
   int ret;
 
@@ -257,7 +257,7 @@ test_srp (gnutls_session session)
 #endif
 
 test_code_t
-test_server (gnutls_session session)
+test_server (gnutls_session_t session)
 {
   int ret, i = 0;
   char buf[5 * 1024];
@@ -308,13 +308,13 @@ test_server (gnutls_session session)
 
 
 static int export_true = 0;
-static gnutls_datum exp = { NULL, 0 }, mod =
+static gnutls_datum_t exp = { NULL, 0 }, mod =
 
 {
 NULL, 0};
 
 test_code_t
-test_export (gnutls_session session)
+test_export (gnutls_session_t session)
 {
   int ret;
 
@@ -339,10 +339,10 @@ test_export (gnutls_session session)
 }
 
 test_code_t
-test_export_info (gnutls_session session)
+test_export_info (gnutls_session_t session)
 {
   int ret2, ret;
-  gnutls_datum exp2, mod2;
+  gnutls_datum_t exp2, mod2;
   const char *print;
 
   if (verbose == 0 || export_true == 0)
@@ -388,10 +388,10 @@ test_export_info (gnutls_session session)
 
 }
 
-static gnutls_datum pubkey = { NULL, 0 };
+static gnutls_datum_t pubkey = { NULL, 0 };
 
 test_code_t
-test_dhe (gnutls_session session)
+test_dhe (gnutls_session_t session)
 {
   int ret;
 
@@ -412,10 +412,10 @@ test_dhe (gnutls_session session)
 }
 
 test_code_t
-test_dhe_group (gnutls_session session)
+test_dhe_group (gnutls_session_t session)
 {
   int ret, ret2;
-  gnutls_datum gen, prime, pubkey2;
+  gnutls_datum_t gen, prime, pubkey2;
   const char *print;
 
   if (verbose == 0 || pubkey.data == NULL)
@@ -460,7 +460,7 @@ test_dhe_group (gnutls_session session)
 }
 
 test_code_t
-test_ssl3 (gnutls_session session)
+test_ssl3 (gnutls_session_t session)
 {
   int ret;
   ADD_ALL_CIPHERS (session);
@@ -486,7 +486,7 @@ got_alarm (int k)
 }
 
 test_code_t
-test_bye (gnutls_session session)
+test_bye (gnutls_session_t session)
 {
   int ret;
   char data[20];
@@ -545,7 +545,7 @@ test_bye (gnutls_session session)
 
 
 test_code_t
-test_aes (gnutls_session session)
+test_aes (gnutls_session_t session)
 {
   int ret;
   ADD_CIPHER (session, GNUTLS_CIPHER_AES_128_CBC);
@@ -561,7 +561,7 @@ test_aes (gnutls_session session)
 }
 
 test_code_t
-test_openpgp1 (gnutls_session session)
+test_openpgp1 (gnutls_session_t session)
 {
   int ret;
   ADD_ALL_CIPHERS (session);
@@ -583,7 +583,7 @@ test_openpgp1 (gnutls_session session)
 }
 
 test_code_t
-test_unknown_ciphersuites (gnutls_session session)
+test_unknown_ciphersuites (gnutls_session_t session)
 {
   int ret;
   ADD_CIPHER3 (session, GNUTLS_CIPHER_AES_128_CBC,
@@ -600,7 +600,7 @@ test_unknown_ciphersuites (gnutls_session session)
 }
 
 test_code_t
-test_md5 (gnutls_session session)
+test_md5 (gnutls_session_t session)
 {
   int ret;
   ADD_ALL_CIPHERS (session);
@@ -617,7 +617,7 @@ test_md5 (gnutls_session session)
 
 #ifdef HAVE_LIBZ
 test_code_t
-test_zlib (gnutls_session session)
+test_zlib (gnutls_session_t session)
 {
   int ret;
   ADD_ALL_CIPHERS (session);
@@ -634,7 +634,7 @@ test_zlib (gnutls_session session)
 #endif
 
 test_code_t
-test_lzo (gnutls_session session)
+test_lzo (gnutls_session_t session)
 {
   int ret;
   gnutls_handshake_set_private_extensions (session, 1);
@@ -653,7 +653,7 @@ test_lzo (gnutls_session session)
 }
 
 test_code_t
-test_sha (gnutls_session session)
+test_sha (gnutls_session_t session)
 {
   int ret;
   ADD_ALL_CIPHERS (session);
@@ -669,7 +669,7 @@ test_sha (gnutls_session session)
 }
 
 test_code_t
-test_3des (gnutls_session session)
+test_3des (gnutls_session_t session)
 {
   int ret;
   ADD_CIPHER (session, GNUTLS_CIPHER_3DES_CBC);
@@ -685,7 +685,7 @@ test_3des (gnutls_session session)
 }
 
 test_code_t
-test_arcfour (gnutls_session session)
+test_arcfour (gnutls_session_t session)
 {
   int ret;
   ADD_CIPHER (session, GNUTLS_CIPHER_ARCFOUR_128);
@@ -701,7 +701,7 @@ test_arcfour (gnutls_session session)
 }
 
 test_code_t
-test_arcfour_40 (gnutls_session session)
+test_arcfour_40 (gnutls_session_t session)
 {
   int ret;
   ADD_CIPHER (session, GNUTLS_CIPHER_ARCFOUR_40);
@@ -717,7 +717,7 @@ test_arcfour_40 (gnutls_session session)
 }
 
 test_code_t
-test_tls1 (gnutls_session session)
+test_tls1 (gnutls_session_t session)
 {
   int ret;
   ADD_ALL_CIPHERS (session);
@@ -737,7 +737,7 @@ test_tls1 (gnutls_session session)
 }
 
 test_code_t
-test_tls1_1 (gnutls_session session)
+test_tls1_1 (gnutls_session_t session)
 {
   int ret;
   ADD_ALL_CIPHERS (session);
@@ -757,7 +757,7 @@ test_tls1_1 (gnutls_session session)
 }
 
 test_code_t
-test_tls1_1_fallback (gnutls_session session)
+test_tls1_1_fallback (gnutls_session_t session)
 {
   int ret;
   if (tls1_1_ok)
@@ -788,7 +788,7 @@ test_tls1_1_fallback (gnutls_session session)
  * but the previous SSL 3.0 test succeeded then disable TLS 1.0.
  */
 test_code_t
-test_tls_disable (gnutls_session session)
+test_tls_disable (gnutls_session_t session)
 {
   int ret;
   if (tls1_ok != 0)
@@ -817,7 +817,7 @@ test_tls_disable (gnutls_session session)
 }
 
 test_code_t
-test_rsa_pms (gnutls_session session)
+test_rsa_pms (gnutls_session_t session)
 {
   int ret;
 
@@ -844,7 +844,7 @@ test_rsa_pms (gnutls_session session)
 }
 
 test_code_t
-test_max_record_size (gnutls_session session)
+test_max_record_size (gnutls_session_t session)
 {
   int ret;
   ADD_ALL_CIPHERS (session);
@@ -868,7 +868,7 @@ test_max_record_size (gnutls_session session)
 }
 
 test_code_t
-test_hello_extension (gnutls_session session)
+test_hello_extension (gnutls_session_t session)
 {
   int ret;
   ADD_ALL_CIPHERS (session);
@@ -884,12 +884,12 @@ test_hello_extension (gnutls_session session)
   return ret;
 }
 
-void _gnutls_record_set_default_version (gnutls_session session,
+void _gnutls_record_set_default_version (gnutls_session_t session,
                                         unsigned char major,
                                         unsigned char minor);
 
 test_code_t
-test_version_rollback (gnutls_session session)
+test_version_rollback (gnutls_session_t session)
 {
   int ret;
   if (tls1_ok == 0)
@@ -926,7 +926,7 @@ test_version_rollback (gnutls_session session)
  * message.
  */
 test_code_t
-test_version_oob (gnutls_session session)
+test_version_oob (gnutls_session_t session)
 {
   int ret;
   /* here we enable both SSL 3.0 and TLS 1.0
@@ -945,11 +945,11 @@ test_version_oob (gnutls_session session)
   return ret;
 }
 
-void _gnutls_rsa_pms_set_version (gnutls_session session,
+void _gnutls_rsa_pms_set_version (gnutls_session_t session,
                                  unsigned char major, unsigned char minor);
 
 test_code_t
-test_rsa_pms_version_check (gnutls_session session)
+test_rsa_pms_version_check (gnutls_session_t session)
 {
   int ret;
   /* here we use an arbitary version in the RSA PMS
@@ -973,7 +973,7 @@ test_rsa_pms_version_check (gnutls_session session)
 
 #ifdef ENABLE_ANON
 test_code_t
-test_anonymous (gnutls_session session)
+test_anonymous (gnutls_session_t session)
 {
   int ret;
 
@@ -995,7 +995,7 @@ test_anonymous (gnutls_session session)
 #endif
 
 test_code_t
-test_session_resume2 (gnutls_session session)
+test_session_resume2 (gnutls_session_t session)
 {
   int ret;
   char tmp_session_id[32];
@@ -1044,7 +1044,7 @@ test_session_resume2 (gnutls_session session)
 extern char *hostname;
 
 test_code_t
-test_certificate (gnutls_session session)
+test_certificate (gnutls_session_t session)
 {
   int ret;
 
@@ -1073,9 +1073,9 @@ test_certificate (gnutls_session session)
 /* A callback function to be used at the certificate selection time.
  */
 static int
-cert_callback (gnutls_session session,
-              const gnutls_datum * req_ca_rdn, int nreqs,
-              const gnutls_pk_algorithm * sign_algos,
+cert_callback (gnutls_session_t session,
+              const gnutls_datum_t * req_ca_rdn, int nreqs,
+              const gnutls_pk_algorithm_t * sign_algos,
               int sign_algos_length, gnutls_retr_st * st)
 {
   char issuer_dn[256];
@@ -1113,7 +1113,7 @@ cert_callback (gnutls_session session,
  * if the server sends a certificate request packet.
  */
 test_code_t
-test_server_cas (gnutls_session session)
+test_server_cas (gnutls_session_t session)
 {
   int ret;
 
index 77e9be3cd69909d447b8c3af28e58b0e2311cef6..072b2cae97af970663aaf439c362790ed461fe81 100644 (file)
@@ -3,37 +3,37 @@ typedef enum
   TEST_SUCCEED, TEST_FAILED, TEST_UNSURE, TEST_IGNORE
 } test_code_t;
 
-test_code_t test_srp (gnutls_session state);
-test_code_t test_server (gnutls_session state);
-test_code_t test_export (gnutls_session state);
-test_code_t test_export_info (gnutls_session state);
-test_code_t test_hello_extension (gnutls_session state);
-test_code_t test_dhe (gnutls_session state);
-test_code_t test_dhe_group (gnutls_session state);
-test_code_t test_ssl3 (gnutls_session state);
-test_code_t test_aes (gnutls_session state);
-test_code_t test_md5 (gnutls_session state);
-test_code_t test_sha (gnutls_session state);
-test_code_t test_3des (gnutls_session state);
-test_code_t test_arcfour (gnutls_session state);
-test_code_t test_arcfour_40 (gnutls_session state);
-test_code_t test_tls1 (gnutls_session state);
-test_code_t test_tls1_1 (gnutls_session state);
-test_code_t test_tls1_1_fallback (gnutls_session state);
-test_code_t test_tls_disable (gnutls_session state);
-test_code_t test_rsa_pms (gnutls_session state);
-test_code_t test_max_record_size (gnutls_session state);
-test_code_t test_version_rollback (gnutls_session state);
-test_code_t test_anonymous (gnutls_session state);
-test_code_t test_unknown_ciphersuites (gnutls_session state);
-test_code_t test_openpgp1 (gnutls_session state);
-test_code_t test_bye (gnutls_session state);
-test_code_t test_certificate (gnutls_session state);
-test_code_t test_server_cas (gnutls_session state);
-test_code_t test_session_resume2 (gnutls_session state);
-test_code_t test_rsa_pms_version_check (gnutls_session session);
-test_code_t test_version_oob (gnutls_session session);
-test_code_t test_zlib (gnutls_session session);
-test_code_t test_lzo (gnutls_session session);
-int _test_srp_username_callback (gnutls_session session, unsigned int times,
+test_code_t test_srp (gnutls_session_t state);
+test_code_t test_server (gnutls_session_t state);
+test_code_t test_export (gnutls_session_t state);
+test_code_t test_export_info (gnutls_session_t state);
+test_code_t test_hello_extension (gnutls_session_t state);
+test_code_t test_dhe (gnutls_session_t state);
+test_code_t test_dhe_group (gnutls_session_t state);
+test_code_t test_ssl3 (gnutls_session_t state);
+test_code_t test_aes (gnutls_session_t state);
+test_code_t test_md5 (gnutls_session_t state);
+test_code_t test_sha (gnutls_session_t state);
+test_code_t test_3des (gnutls_session_t state);
+test_code_t test_arcfour (gnutls_session_t state);
+test_code_t test_arcfour_40 (gnutls_session_t state);
+test_code_t test_tls1 (gnutls_session_t state);
+test_code_t test_tls1_1 (gnutls_session_t state);
+test_code_t test_tls1_1_fallback (gnutls_session_t state);
+test_code_t test_tls_disable (gnutls_session_t state);
+test_code_t test_rsa_pms (gnutls_session_t state);
+test_code_t test_max_record_size (gnutls_session_t state);
+test_code_t test_version_rollback (gnutls_session_t state);
+test_code_t test_anonymous (gnutls_session_t state);
+test_code_t test_unknown_ciphersuites (gnutls_session_t state);
+test_code_t test_openpgp1 (gnutls_session_t state);
+test_code_t test_bye (gnutls_session_t state);
+test_code_t test_certificate (gnutls_session_t state);
+test_code_t test_server_cas (gnutls_session_t state);
+test_code_t test_session_resume2 (gnutls_session_t state);
+test_code_t test_rsa_pms_version_check (gnutls_session_t session);
+test_code_t test_version_oob (gnutls_session_t session);
+test_code_t test_zlib (gnutls_session_t session);
+test_code_t test_lzo (gnutls_session_t session);
+int _test_srp_username_callback (gnutls_session_t session, unsigned int times,
                                 char **username, char **password);
index 7c2d53d73a86c1ea8e0c81cfe32b85b5f8249385..ab79257c95ebd29a797551f06916a1c923c60351 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2000,2001,2002,2003,2006 Nikos Mavroyanopoulos
+ * Copyright (C) 2000,2001,2002,2003,2006,2007 Nikos Mavroyanopoulos
  * Copyright (C) 2004,2005 Free Software Foundation
  *
  * This file is part of GNUTLS.
@@ -52,9 +52,9 @@ int record_max_size;
 int fingerprint;
 static int debug;
 
-gnutls_srp_client_credentials srp_cred;
-gnutls_anon_client_credentials anon_cred;
-gnutls_certificate_credentials xcred;
+gnutls_srp_client_credentials_t srp_cred;
+gnutls_anon_client_credentials_t anon_cred;
+gnutls_certificate_credentials_t xcred;
 
 /* end of global stuff */
 
@@ -71,7 +71,7 @@ tls_log_func (int level, const char *str)
   fprintf (stderr, "|<%d>| %s", level, str);
 }
 
-typedef test_code_t (*TEST_FUNC) (gnutls_session);
+typedef test_code_t (*TEST_FUNC) (gnutls_session_t);
 
 typedef struct
 {
@@ -162,7 +162,7 @@ main (int argc, char **argv)
 {
   int err, ret;
   int sd, i;
-  gnutls_session state;
+  gnutls_session_t state;
   char buffer[MAX_BUF + 1];
   char portname[6];
   struct addrinfo hints, *res, *ptr;
@@ -267,7 +267,7 @@ main (int argc, char **argv)
       ERR(err, "connect")
 
       gnutls_init (&state, GNUTLS_CLIENT);
-      gnutls_transport_set_ptr (state, (gnutls_transport_ptr) sd);
+      gnutls_transport_set_ptr (state, (gnutls_transport_ptr_t) sd);
 
       do
        {