summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2004-06-13 21:32:00 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2004-06-13 21:32:00 +0000
commit933c12dd1b0b7af1e6b0d9de9a5037d0990d2be0 (patch)
tree353eda85d53bbac1a632cc59004bd86674818adf /includes
parent906958f81d6057f2bbc0bb628c9b6425f45a4779 (diff)
downloadgnutls-933c12dd1b0b7af1e6b0d9de9a5037d0990d2be0.tar.gz
Added the '_t' suffix to all exported symbols.
Diffstat (limited to 'includes')
-rw-r--r--includes/Makefile.am2
-rw-r--r--includes/gnutls/Makefile.am2
-rw-r--r--includes/gnutls/compat.h57
-rw-r--r--includes/gnutls/extra.h80
-rw-r--r--includes/gnutls/openpgp.h68
-rw-r--r--includes/gnutls/openssl.h28
-rw-r--r--includes/gnutls/pkcs12.h60
-rw-r--r--includes/gnutls/x509.h342
8 files changed, 348 insertions, 291 deletions
diff --git a/includes/Makefile.am b/includes/Makefile.am
index cb35de5471..ba9f4001a4 100644
--- a/includes/Makefile.am
+++ b/includes/Makefile.am
@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in
nobase_include_HEADERS = gnutls/extra.h gnutls/gnutls.h $(OPENSSL_H) \
- gnutls/x509.h gnutls/pkcs12.h \
+ gnutls/x509.h gnutls/pkcs12.h gnutls/compat.h \
gnutls/openpgp.h
if ENABLE_OPENSSL
diff --git a/includes/gnutls/Makefile.am b/includes/gnutls/Makefile.am
index 484ff83428..7d7099044a 100644
--- a/includes/gnutls/Makefile.am
+++ b/includes/gnutls/Makefile.am
@@ -1 +1 @@
-EXTRA_DIST = extra.h openssl.h gnutls.h x509.h pkcs12.h openpgp.h
+EXTRA_DIST = extra.h openssl.h gnutls.h x509.h pkcs12.h openpgp.h compat.h
diff --git a/includes/gnutls/compat.h b/includes/gnutls/compat.h
new file mode 100644
index 0000000000..eab5442262
--- /dev/null
+++ b/includes/gnutls/compat.h
@@ -0,0 +1,57 @@
+/* Typedefs to be fully compatible with the types of
+ * GnuTLS 1.0.x.
+ */
+
+#ifndef GCOMPAT_H
+# define GCOMPAT_H
+
+#define gnutls_cipher_algorithm gnutls_cipher_algorithm_t
+#define gnutls_kx_algorithm gnutls_kx_algorithm_t
+#define gnutls_paramsype gnutls_paramsype_t
+#define gnutls_mac_algorithm gnutls_mac_algorithm_t
+#define gnutls_digest_algorithm gnutls_digest_algorithm_t
+#define gnutls_compression_method gnutls_compression_method_t
+#define gnutls_connection_end gnutls_connection_end_t
+#define gnutls_credentialsype gnutls_credentialsype_t
+#define gnutls_certificateype gnutls_certificateype_t
+#define gnutls_x509_crt_fmt gnutls_x509_crt_fmt_t
+#define gnutls_openpgp_key_fmt gnutls_openpgp_key_fmt_t
+#define gnutls_pk_algorithm gnutls_pk_algorithm_t
+#define gnutls_sign_algorithm gnutls_sign_algorithm_t
+#define gnutls_server_name gnutls_server_nameype_t
+#define gnutls_protocol gnutls_protocol_version_t
+#define gnutls_close_request gnutls_close_request_t
+#define gnutls_openpgp_key_status gnutls_openpgp_key_status_t
+#define gnutls_certificate_request gnutls_certificate_request_t
+#define gnutls_certificate_status gnutls_certificate_status_t
+#define gnutls_session gnutls_session_t
+#define gnutls_alert_level gnutls_alert_level_t
+#define gnutls_alert_description gnutls_alert_description_t
+#define gnutls_x509_subject_alt_name gnutls_x509_subject_alt_name_t
+#define gnutls_openpgp_key gnutls_openpgp_key_t
+#define gnutls_openpgp_privkey gnutls_openpgp_privkey_t
+#define gnutls_openpgp_keyring gnutls_openpgp_keyring_t
+#define gnutls_openpgp_trustdb gnutls_openpgp_trustdb_t
+#define gnutls_x509_crt gnutls_x509_crt_t
+#define gnutls_x509_privkey gnutls_x509_privkey_t
+#define gnutls_x509_crl gnutls_x509_crl_t
+#define gnutls_pkcs7 gnutls_pkcs7_t
+#define gnutls_x509_crq gnutls_x509_crq_t
+#define gnutls_pkcs_encrypt_flags gnutls_pkcs_encrypt_flags_t
+#define gnutls_pkcs12_bag_type gnutls_pkcs12_bag_type_t
+#define gnutls_pkcs12_bag gnutls_pkcs12_bag_t
+#define gnutls_pkcs12 gnutls_pkcs12_t
+#define gnutls_certificate_credentials gnutls_certificate_credentials_t
+#define gnutls_anon_server_credentials gnutls_anon_server_credentials_t
+#define gnutls_anon_client_credentials gnutls_anon_client_credentials_t
+#define gnutls_srp_client_credentials gnutls_srp_client_credentials_t
+#define gnutls_srp_server_credentials gnutls_srp_server_credentials_t
+#define gnutls_dh_params gnutls_dh_params_t
+#define gnutls_rsa_params gnutls_rsa_params_t
+#define gnutls_params_type gnutls_params_type_t
+#define gnutls_credentials_type gnutls_credentials_type_t
+#define gnutls_certificate_type gnutls_certificate_type_t
+#define gnutls_datum gnutls_datum_t
+#define gnutls_transport_ptr gnutls_transport_ptr_t
+
+#endif /* GCOMPAT_H */
diff --git a/includes/gnutls/extra.h b/includes/gnutls/extra.h
index 46283171de..fb3900874a 100644
--- a/includes/gnutls/extra.h
+++ b/includes/gnutls/extra.h
@@ -30,76 +30,76 @@
/* SRP */
-typedef struct DSTRUCT* gnutls_srp_server_credentials;
-typedef struct DSTRUCT* gnutls_srp_client_credentials;
+typedef struct DSTRUCT* gnutls_srp_server_credentials_t;
+typedef struct DSTRUCT* gnutls_srp_client_credentials_t;
-void gnutls_srp_free_client_credentials( gnutls_srp_client_credentials sc);
-int gnutls_srp_allocate_client_credentials( gnutls_srp_client_credentials *sc);
-int gnutls_srp_set_client_credentials( gnutls_srp_client_credentials res, char *username, char* password);
+void gnutls_srp_free_client_credentials( gnutls_srp_client_credentials_t sc);
+int gnutls_srp_allocate_client_credentials( gnutls_srp_client_credentials_t *sc);
+int gnutls_srp_set_client_credentials( gnutls_srp_client_credentials_t res, char *username, char* password);
-void gnutls_srp_free_server_credentials( gnutls_srp_server_credentials sc);
-int gnutls_srp_allocate_server_credentials( gnutls_srp_server_credentials *sc);
-int gnutls_srp_set_server_credentials_file( gnutls_srp_server_credentials res,
+void gnutls_srp_free_server_credentials( gnutls_srp_server_credentials_t sc);
+int gnutls_srp_allocate_server_credentials( gnutls_srp_server_credentials_t *sc);
+int gnutls_srp_set_server_credentials_file( gnutls_srp_server_credentials_t res,
const char *password_file, const char* password_conf_file);
-const char* gnutls_srp_server_get_username( gnutls_session state);
+const char* gnutls_srp_server_get_username( gnutls_session_t state);
-int gnutls_srp_verifier( const char* username, const char* password, const gnutls_datum *salt,
- const gnutls_datum* g, const gnutls_datum* n,
- gnutls_datum * res);
+int gnutls_srp_verifier( const char* username, const char* password, const gnutls_datum_t *salt,
+ const gnutls_datum_t* g, const gnutls_datum_t* n,
+ gnutls_datum_t * res);
/* The static parameters defined in draft-ietf-tls-srp-05
* Those should be used as input to gnutls_srp_verifier().
*/
-extern const gnutls_datum gnutls_srp_2048_group_prime;
-extern const gnutls_datum gnutls_srp_2048_group_generator;
+extern const gnutls_datum_t gnutls_srp_2048_group_prime;
+extern const gnutls_datum_t gnutls_srp_2048_group_generator;
-extern const gnutls_datum gnutls_srp_1536_group_prime;
-extern const gnutls_datum gnutls_srp_1536_group_generator;
+extern const gnutls_datum_t gnutls_srp_1536_group_prime;
+extern const gnutls_datum_t gnutls_srp_1536_group_generator;
-extern const gnutls_datum gnutls_srp_1024_group_prime;
-extern const gnutls_datum gnutls_srp_1024_group_generator;
+extern const gnutls_datum_t gnutls_srp_1024_group_prime;
+extern const gnutls_datum_t gnutls_srp_1024_group_generator;
typedef int gnutls_srp_server_credentials_function(
- gnutls_session,
- const char* username, gnutls_datum* salt,
- gnutls_datum* verifier, gnutls_datum* generator,
- gnutls_datum* prime
+ gnutls_session_t,
+ const char* username, gnutls_datum_t* salt,
+ gnutls_datum_t* verifier, gnutls_datum_t* generator,
+ gnutls_datum_t* prime
);
void gnutls_srp_set_server_credentials_function(
- gnutls_srp_server_credentials,
+ gnutls_srp_server_credentials_t,
gnutls_srp_server_credentials_function *);
-typedef int gnutls_srp_client_credentials_function(gnutls_session, unsigned int,
+typedef int gnutls_srp_client_credentials_function(gnutls_session_t, unsigned int,
char **, char**);
-void gnutls_srp_set_client_credentials_function( gnutls_srp_client_credentials,
+void gnutls_srp_set_client_credentials_function( gnutls_srp_client_credentials_t,
gnutls_srp_client_credentials_function *);
/* Openpgp certificate stuff
*/
-typedef int (*gnutls_openpgp_recv_key_func)(gnutls_session, const unsigned char *keyfpr,
- unsigned int keyfpr_length, gnutls_datum *key);
+typedef int (*gnutls_openpgp_recv_key_func)(gnutls_session_t, const unsigned char *keyfpr,
+ unsigned int keyfpr_length, gnutls_datum_t *key);
-void gnutls_openpgp_set_recv_key_function( gnutls_session, gnutls_openpgp_recv_key_func);
+void gnutls_openpgp_set_recv_key_function( gnutls_session_t, gnutls_openpgp_recv_key_func);
-int gnutls_certificate_set_openpgp_key_file( gnutls_certificate_credentials res,
+int gnutls_certificate_set_openpgp_key_file( gnutls_certificate_credentials_t res,
const char *CERTFILE, const char* KEYFILE);
-int gnutls_certificate_set_openpgp_key_mem( gnutls_certificate_credentials res,
- const gnutls_datum* CERT, const gnutls_datum* KEY);
+int gnutls_certificate_set_openpgp_key_mem( gnutls_certificate_credentials_t res,
+ const gnutls_datum_t* CERT, const gnutls_datum_t* KEY);
-int gnutls_certificate_set_openpgp_keyserver(gnutls_certificate_credentials res,
+int gnutls_certificate_set_openpgp_keyserver(gnutls_certificate_credentials_t res,
const char* keyserver, int port);
-int gnutls_certificate_set_openpgp_trustdb(gnutls_certificate_credentials res,
+int gnutls_certificate_set_openpgp_trustdb(gnutls_certificate_credentials_t res,
const char* trustdb);
int gnutls_certificate_set_openpgp_keyring_mem(
- gnutls_certificate_credentials c,
+ gnutls_certificate_credentials_t c,
const unsigned char *data, size_t dlen );
-int gnutls_certificate_set_openpgp_keyring_file( gnutls_certificate_credentials res,
+int gnutls_certificate_set_openpgp_keyring_file( gnutls_certificate_credentials_t res,
const char *name);
int gnutls_global_init_extra(void);
@@ -109,12 +109,12 @@ int gnutls_global_init_extra(void);
const char* gnutls_extra_check_version( const char*);
/* base64 */
-int gnutls_srp_base64_encode( const gnutls_datum *data, char* result, int* result_size);
-int gnutls_srp_base64_encode_alloc( const gnutls_datum *data, gnutls_datum* result);
+int gnutls_srp_base64_encode( const gnutls_datum_t *data, char* result, int* result_size);
+int gnutls_srp_base64_encode_alloc( const gnutls_datum_t *data, gnutls_datum_t* result);
-int gnutls_srp_base64_decode( const gnutls_datum *b64_data, char* result, int* result_size);
-int gnutls_srp_base64_decode_alloc( const gnutls_datum *b64_data,
- gnutls_datum* result);
+int gnutls_srp_base64_decode( const gnutls_datum_t *b64_data, char* result, int* result_size);
+int gnutls_srp_base64_decode_alloc( const gnutls_datum_t *b64_data,
+ gnutls_datum_t* result);
#endif
diff --git a/includes/gnutls/openpgp.h b/includes/gnutls/openpgp.h
index 7d9dc237cd..3810388a61 100644
--- a/includes/gnutls/openpgp.h
+++ b/includes/gnutls/openpgp.h
@@ -33,53 +33,53 @@ extern "C" {
#include <gnutls/gnutls.h>
#include <gnutls/extra.h>
-/* gnutls_openpgp_key should be defined in gnutls.h
+/* gnutls_openpgp_key_t should be defined in gnutls.h
*/
typedef enum gnutls_openpgp_key_fmt { GNUTLS_OPENPGP_FMT_RAW,
GNUTLS_OPENPGP_FMT_BASE64 } gnutls_openpgp_key_fmt;
-int gnutls_openpgp_key_init( gnutls_openpgp_key* key); /* initializes the memory for gnutls_openpgp_key struct */
-void gnutls_openpgp_key_deinit(gnutls_openpgp_key key); /* frees all memory */
+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 */
-int gnutls_openpgp_key_import(gnutls_openpgp_key key,
- const gnutls_datum* data, gnutls_openpgp_key_fmt format);
-int gnutls_openpgp_key_export(gnutls_openpgp_key key,
+int gnutls_openpgp_key_import(gnutls_openpgp_key_t key,
+ const gnutls_datum_t* data, gnutls_openpgp_key_fmt format);
+int gnutls_openpgp_key_export(gnutls_openpgp_key_t key,
gnutls_openpgp_key_fmt format, void* output_data,
size_t* output_data_size);
/* The key_usage flags are defined in gnutls.h. They are
* the GNUTLS_KEY_* definitions.
*/
-int gnutls_openpgp_key_get_key_usage( gnutls_openpgp_key cert, unsigned int* key_usage);
-int gnutls_openpgp_key_get_fingerprint( gnutls_openpgp_key key,
+int gnutls_openpgp_key_get_key_usage( gnutls_openpgp_key_t cert, unsigned int* key_usage);
+int gnutls_openpgp_key_get_fingerprint( gnutls_openpgp_key_t key,
void* result, size_t* result_size);
-int gnutls_openpgp_key_get_name( gnutls_openpgp_key key,
+int gnutls_openpgp_key_get_name( gnutls_openpgp_key_t key,
int idx, char *buf, size_t *sizeof_buf);
-int gnutls_openpgp_key_get_pk_algorithm(gnutls_openpgp_key key,
+int gnutls_openpgp_key_get_pk_algorithm(gnutls_openpgp_key_t key,
unsigned int *r_bits);
-int gnutls_openpgp_key_get_version( gnutls_openpgp_key key );
+int gnutls_openpgp_key_get_version( gnutls_openpgp_key_t key );
-time_t gnutls_openpgp_key_get_creation_time( gnutls_openpgp_key key );
-time_t gnutls_openpgp_key_get_expiration_time( gnutls_openpgp_key key );
+time_t gnutls_openpgp_key_get_creation_time( gnutls_openpgp_key_t key );
+time_t gnutls_openpgp_key_get_expiration_time( gnutls_openpgp_key_t key );
-int gnutls_openpgp_key_get_id( gnutls_openpgp_key key, unsigned char keyid[8]);
+int gnutls_openpgp_key_get_id( gnutls_openpgp_key_t key, unsigned char keyid[8]);
-int gnutls_openpgp_key_check_hostname( gnutls_openpgp_key key, const char *hostname);
+int gnutls_openpgp_key_check_hostname( gnutls_openpgp_key_t key, const char *hostname);
-int gnutls_openpgp_key_to_xml( gnutls_openpgp_key key, gnutls_datum *xmlkey,
+int gnutls_openpgp_key_to_xml( gnutls_openpgp_key_t key, gnutls_datum_t *xmlkey,
int ext);
/* privkey stuff.
*/
-int gnutls_openpgp_privkey_init(gnutls_openpgp_privkey * key);
-void gnutls_openpgp_privkey_deinit(gnutls_openpgp_privkey key);
-int gnutls_openpgp_privkey_get_pk_algorithm( gnutls_openpgp_privkey key, unsigned int *bits);
-int gnutls_openpgp_privkey_import(gnutls_openpgp_privkey key,
- const gnutls_datum * data, gnutls_openpgp_key_fmt format,
+int gnutls_openpgp_privkey_init(gnutls_openpgp_privkey_t * key);
+void gnutls_openpgp_privkey_deinit(gnutls_openpgp_privkey_t key);
+int gnutls_openpgp_privkey_get_pk_algorithm( gnutls_openpgp_privkey_t key, unsigned int *bits);
+int gnutls_openpgp_privkey_import(gnutls_openpgp_privkey_t key,
+ const gnutls_datum_t * data, gnutls_openpgp_key_fmt format,
const char* pass, unsigned int flags);
/* Keyring stuff.
@@ -88,12 +88,12 @@ struct gnutls_openpgp_keyring_int; /* object to hold (parsed) openpgp keyrings *
typedef struct gnutls_openpgp_keyring_int* gnutls_openpgp_keyring;
int gnutls_openpgp_keyring_init( gnutls_openpgp_keyring* ring);
-void gnutls_openpgp_keyring_deinit(gnutls_openpgp_keyring ring);
+void gnutls_openpgp_keyring_deinit(gnutls_openpgp_keyring_t ring);
-int gnutls_openpgp_keyring_import(gnutls_openpgp_keyring ring,
- const gnutls_datum* data, gnutls_openpgp_key_fmt format);
+int gnutls_openpgp_keyring_import(gnutls_openpgp_keyring_t ring,
+ const gnutls_datum_t* data, gnutls_openpgp_key_fmt format);
-int gnutls_openpgp_keyring_check_id( gnutls_openpgp_keyring ring,
+int gnutls_openpgp_keyring_check_id( gnutls_openpgp_keyring_t ring,
const unsigned char keyid[8], unsigned int flags);
/* Trustdb functions.
@@ -102,32 +102,32 @@ struct gnutls_openpgp_trustdb_int; /* object to hold (parsed) openpgp trustdbs *
typedef struct gnutls_openpgp_trustdb_int* gnutls_openpgp_trustdb;
int gnutls_openpgp_trustdb_init( gnutls_openpgp_trustdb* db);
-void gnutls_openpgp_trustdb_deinit(gnutls_openpgp_trustdb db);
+void gnutls_openpgp_trustdb_deinit(gnutls_openpgp_trustdb_t db);
-int gnutls_openpgp_trustdb_import(gnutls_openpgp_trustdb db,
+int gnutls_openpgp_trustdb_import(gnutls_openpgp_trustdb_t db,
const char* file);
int gnutls_openpgp_key_verify_ring(
- gnutls_openpgp_key key,
- gnutls_openpgp_keyring ring,
+ gnutls_openpgp_key_t key,
+ gnutls_openpgp_keyring_t ring,
unsigned int flags,
unsigned int * verify /* the output of the verification */);
-int gnutls_openpgp_key_verify_self( gnutls_openpgp_key key,
+int gnutls_openpgp_key_verify_self( gnutls_openpgp_key_t key,
unsigned int flags, unsigned int *verify);
int gnutls_openpgp_key_verify_trustdb(
- gnutls_openpgp_key key,
- gnutls_openpgp_trustdb db,
+ gnutls_openpgp_key_t key,
+ gnutls_openpgp_trustdb_t db,
unsigned int flags,
unsigned int * verify /* the output of the verification */);
/* certificate authentication stuff.
*/
-int gnutls_certificate_set_openpgp_key(gnutls_certificate_credentials res,
- gnutls_openpgp_key key, gnutls_openpgp_privkey pkey);
+int gnutls_certificate_set_openpgp_key(gnutls_certificate_credentials_t res,
+ gnutls_openpgp_key_t key, gnutls_openpgp_privkey_t pkey);
#ifdef __cplusplus
}
diff --git a/includes/gnutls/openssl.h b/includes/gnutls/openssl.h
index 07d2e510c3..eeb7161121 100644
--- a/includes/gnutls/openssl.h
+++ b/includes/gnutls/openssl.h
@@ -86,7 +86,7 @@ typedef struct {
#define SSL_MODE_AUTO_RETRY (0x4)
typedef gnutls_x509_dn X509_NAME;
-typedef gnutls_datum X509;
+typedef gnutls_datum_t X509;
struct _SSL;
@@ -97,29 +97,29 @@ typedef struct
int comp_priority[GNUTLS_MAX_ALGORITHM_NUM];
int kx_priority[GNUTLS_MAX_ALGORITHM_NUM];
int mac_priority[GNUTLS_MAX_ALGORITHM_NUM];
- gnutls_connection_end connend;
+ gnutls_connection_end_t connend;
} SSL_METHOD;
typedef struct
{
- gnutls_protocol_version version;
- gnutls_cipher_algorithm cipher;
- gnutls_kx_algorithm kx;
- gnutls_mac_algorithm mac;
- gnutls_compression_method compression;
- gnutls_certificate_type cert;
+ gnutls_protocol_t version;
+ gnutls_cipher_algorithm_t cipher;
+ gnutls_kx_algorithm_t kx;
+ gnutls_mac_algorithm_t mac;
+ gnutls_compression_method_t compression;
+ gnutls_certificate_type_t cert;
} SSL_CIPHER;
typedef struct _BIO
{
- gnutls_transport_ptr fd;
+ gnutls_transport_ptr_t fd;
} BIO;
typedef struct
{
struct _SSL *ssl;
int error;
- const gnutls_datum *cert_list;
+ const gnutls_datum_t *cert_list;
#define current_cert cert_list
} X509_STORE_CTX;
@@ -141,7 +141,7 @@ typedef struct _SSL_CTX
typedef struct _SSL
{
- gnutls_session gnutls_state;
+ gnutls_session_t gnutls_state;
#define rbio gnutls_state
gnutls_certificate_client_credentials gnutls_cred;
@@ -157,8 +157,8 @@ typedef struct _SSL
int (*verify_callback)(int, X509_STORE_CTX *);
int verify_mode;
- gnutls_transport_ptr rfd;
- gnutls_transport_ptr wfd;
+ gnutls_transport_ptr_t rfd;
+ gnutls_transport_ptr_t wfd;
} SSL;
typedef struct
@@ -282,7 +282,7 @@ void X509_free(const X509 *cert);
/* BIO functions */
-void BIO_get_fd(gnutls_session gnutls_state, int *fd);
+void BIO_get_fd(gnutls_session_t gnutls_state, int *fd);
BIO *BIO_new_socket(int sock, int close_flag);
/* error handling */
diff --git a/includes/gnutls/pkcs12.h b/includes/gnutls/pkcs12.h
index 05ef7fe211..3f04997d1d 100644
--- a/includes/gnutls/pkcs12.h
+++ b/includes/gnutls/pkcs12.h
@@ -31,29 +31,29 @@ extern "C" {
/* PKCS12 structures handling
*/
struct gnutls_pkcs12_int;
-typedef struct gnutls_pkcs12_int* gnutls_pkcs12;
+typedef struct gnutls_pkcs12_int* gnutls_pkcs12_t;
struct gnutls_pkcs12_bag_int;
-typedef struct gnutls_pkcs12_bag_int* gnutls_pkcs12_bag;
+typedef struct gnutls_pkcs12_bag_int* gnutls_pkcs12_bag_t;
-int gnutls_pkcs12_init(gnutls_pkcs12 * pkcs12);
-void gnutls_pkcs12_deinit(gnutls_pkcs12 pkcs12);
-int gnutls_pkcs12_import(gnutls_pkcs12 pkcs12, const gnutls_datum * data,
+int gnutls_pkcs12_init(gnutls_pkcs12_t * pkcs12);
+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);
-int gnutls_pkcs12_export( gnutls_pkcs12 pkcs12,
+int gnutls_pkcs12_export( gnutls_pkcs12_t pkcs12,
gnutls_x509_crt_fmt format, void* output_data, size_t* output_data_size);
-int gnutls_pkcs12_get_bag(gnutls_pkcs12 pkcs12,
- int indx, gnutls_pkcs12_bag bag);
-int gnutls_pkcs12_set_bag(gnutls_pkcs12 pkcs12, gnutls_pkcs12_bag bag);
+int gnutls_pkcs12_get_bag(gnutls_pkcs12_t pkcs12,
+ int indx, gnutls_pkcs12_bag_t bag);
+int gnutls_pkcs12_set_bag(gnutls_pkcs12_t pkcs12, gnutls_pkcs12_bag_t bag);
-int gnutls_pkcs12_generate_mac(gnutls_pkcs12 pkcs12, const char* pass);
-int gnutls_pkcs12_verify_mac(gnutls_pkcs12 pkcs12, const char* pass);
+int gnutls_pkcs12_generate_mac(gnutls_pkcs12_t pkcs12, const char* pass);
+int gnutls_pkcs12_verify_mac(gnutls_pkcs12_t pkcs12, const char* pass);
-int gnutls_pkcs12_bag_decrypt(gnutls_pkcs12_bag bag, const char* pass);
-int gnutls_pkcs12_bag_encrypt(gnutls_pkcs12_bag bag, const char* pass, unsigned int flags);
+int gnutls_pkcs12_bag_decrypt(gnutls_pkcs12_bag_t bag, const char* pass);
+int gnutls_pkcs12_bag_encrypt(gnutls_pkcs12_bag_t bag, const char* pass, unsigned int flags);
-typedef enum gnutls_pkcs12_bag_type {
+typedef enum gnutls_pkcs12_bag_type_t {
GNUTLS_BAG_EMPTY = 0,
GNUTLS_BAG_PKCS8_ENCRYPTED_KEY=1,
@@ -62,27 +62,27 @@ typedef enum gnutls_pkcs12_bag_type {
GNUTLS_BAG_CRL,
GNUTLS_BAG_ENCRYPTED=10,
GNUTLS_BAG_UNKNOWN=20
-} gnutls_pkcs12_bag_type;
+} gnutls_pkcs12_bag_type_t;
-gnutls_pkcs12_bag_type gnutls_pkcs12_bag_get_type(gnutls_pkcs12_bag bag, int indx);
-int gnutls_pkcs12_bag_get_data(gnutls_pkcs12_bag bag, int indx, gnutls_datum* data);
-int gnutls_pkcs12_bag_set_data(gnutls_pkcs12_bag bag, gnutls_pkcs12_bag_type type,
- const gnutls_datum* data);
-int gnutls_pkcs12_bag_set_crl(gnutls_pkcs12_bag bag, gnutls_x509_crl crl);
-int gnutls_pkcs12_bag_set_crt(gnutls_pkcs12_bag bag, gnutls_x509_crt crt);
+gnutls_pkcs12_bag_type_t gnutls_pkcs12_bag_get_type(gnutls_pkcs12_bag_t bag, int indx);
+int gnutls_pkcs12_bag_get_data(gnutls_pkcs12_bag_t bag, int indx, gnutls_datum_t* data);
+int gnutls_pkcs12_bag_set_data(gnutls_pkcs12_bag_t bag, gnutls_pkcs12_bag_type_t type,
+ const gnutls_datum_t* data);
+int gnutls_pkcs12_bag_set_crl(gnutls_pkcs12_bag_t bag, gnutls_x509_crl_t crl);
+int gnutls_pkcs12_bag_set_crt(gnutls_pkcs12_bag_t bag, gnutls_x509_crt_t crt);
-int gnutls_pkcs12_bag_init(gnutls_pkcs12_bag * bag);
-void gnutls_pkcs12_bag_deinit(gnutls_pkcs12_bag bag);
-int gnutls_pkcs12_bag_get_count(gnutls_pkcs12_bag bag);
+int gnutls_pkcs12_bag_init(gnutls_pkcs12_bag_t * bag);
+void gnutls_pkcs12_bag_deinit(gnutls_pkcs12_bag_t bag);
+int gnutls_pkcs12_bag_get_count(gnutls_pkcs12_bag_t bag);
-int gnutls_pkcs12_bag_get_key_id(gnutls_pkcs12_bag bag, int indx,
- gnutls_datum* id);
-int gnutls_pkcs12_bag_set_key_id(gnutls_pkcs12_bag bag, int indx,
- const gnutls_datum* id);
+int gnutls_pkcs12_bag_get_key_id(gnutls_pkcs12_bag_t bag, int indx,
+ gnutls_datum_t* id);
+int gnutls_pkcs12_bag_set_key_id(gnutls_pkcs12_bag_t bag, int indx,
+ const gnutls_datum_t* id);
-int gnutls_pkcs12_bag_get_friendly_name(gnutls_pkcs12_bag bag, int indx,
+int gnutls_pkcs12_bag_get_friendly_name(gnutls_pkcs12_bag_t bag, int indx,
char **name);
-int gnutls_pkcs12_bag_set_friendly_name(gnutls_pkcs12_bag bag, int indx,
+int gnutls_pkcs12_bag_set_friendly_name(gnutls_pkcs12_bag_t bag, int indx,
const char* name);
#ifdef __cplusplus
diff --git a/includes/gnutls/x509.h b/includes/gnutls/x509.h
index e644f78fab..8a061bc2da 100644
--- a/includes/gnutls/x509.h
+++ b/includes/gnutls/x509.h
@@ -77,40 +77,40 @@ extern "C" {
/* Certificate handling functions
*/
-int gnutls_x509_crt_init(gnutls_x509_crt * cert);
-void gnutls_x509_crt_deinit(gnutls_x509_crt cert);
-int gnutls_x509_crt_import(gnutls_x509_crt cert, const gnutls_datum * data,
- gnutls_x509_crt_fmt format);
-int gnutls_x509_crt_export( gnutls_x509_crt cert,
- gnutls_x509_crt_fmt format, void* output_data, size_t* output_data_size);
-int gnutls_x509_crt_get_issuer_dn(gnutls_x509_crt cert, char *buf,
+int gnutls_x509_crt_init(gnutls_x509_crt_t * cert);
+void gnutls_x509_crt_deinit(gnutls_x509_crt_t cert);
+int gnutls_x509_crt_import(gnutls_x509_crt_t cert, const gnutls_datum_t * data,
+ gnutls_x509_crt_fmt_t format);
+int gnutls_x509_crt_export( gnutls_x509_crt_t cert,
+ gnutls_x509_crt_fmt_t format, void* output_data, size_t* output_data_size);
+int gnutls_x509_crt_get_issuer_dn(gnutls_x509_crt_t cert, char *buf,
size_t *sizeof_buf);
-int gnutls_x509_crt_get_issuer_dn_oid(gnutls_x509_crt cert,
+int gnutls_x509_crt_get_issuer_dn_oid(gnutls_x509_crt_t cert,
int indx, void *oid, size_t *sizeof_oid);
-int gnutls_x509_crt_get_issuer_dn_by_oid(gnutls_x509_crt cert,
+int gnutls_x509_crt_get_issuer_dn_by_oid(gnutls_x509_crt_t cert,
const char* oid, int indx, unsigned int raw_flag,
void *buf, size_t *sizeof_buf);
-int gnutls_x509_crt_get_dn(gnutls_x509_crt cert, char *buf,
+int gnutls_x509_crt_get_dn(gnutls_x509_crt_t cert, char *buf,
size_t *sizeof_buf);
-int gnutls_x509_crt_get_dn_oid(gnutls_x509_crt cert,
+int gnutls_x509_crt_get_dn_oid(gnutls_x509_crt_t cert,
int indx, void *oid, size_t *sizeof_oid);
-int gnutls_x509_crt_get_dn_by_oid(gnutls_x509_crt cert, const char* oid,
+int gnutls_x509_crt_get_dn_by_oid(gnutls_x509_crt_t cert, const char* oid,
int indx, unsigned int raw_flag, void *buf, size_t *sizeof_buf);
-int gnutls_x509_crt_check_hostname(gnutls_x509_crt cert,
- const char *hostname);
+int gnutls_x509_crt_check_hostname(gnutls_x509_crt_t cert,
+ const char *hostname);
-int gnutls_x509_crt_get_signature_algorithm(gnutls_x509_crt cert);
-int gnutls_x509_crt_get_version(gnutls_x509_crt cert);
-int gnutls_x509_crt_get_key_id( gnutls_x509_crt crt, unsigned int flags,
+int gnutls_x509_crt_get_signature_algorithm(gnutls_x509_crt_t cert);
+int gnutls_x509_crt_get_version(gnutls_x509_crt_t cert);
+int gnutls_x509_crt_get_key_id( gnutls_x509_crt_t crt, unsigned int flags,
unsigned char* output_data, size_t* output_data_size);
-int gnutls_x509_crt_set_authority_key_id(gnutls_x509_crt cert, const void* id,
+int gnutls_x509_crt_set_authority_key_id(gnutls_x509_crt_t cert, const void* id,
size_t id_size);
-int gnutls_x509_crt_get_authority_key_id(gnutls_x509_crt cert, void* ret,
+int gnutls_x509_crt_get_authority_key_id(gnutls_x509_crt_t cert, void* ret,
size_t* ret_size, unsigned int* critical);
-int gnutls_x509_crt_get_subject_key_id(gnutls_x509_crt cert, void* ret,
- size_t* ret_size, unsigned int* critical);
+int gnutls_x509_crt_get_subject_key_id(gnutls_x509_crt_t cert, void* ret,
+ size_t* ret_size, unsigned int* critical);
#define GNUTLS_CRL_REASON_UNUSED 128
#define GNUTLS_CRL_REASON_KEY_COMPROMISE 64
@@ -122,45 +122,45 @@ int gnutls_x509_crt_get_subject_key_id(gnutls_x509_crt cert, void* ret,
#define GNUTLS_CRL_REASON_PRIVILEGE_WITHDRAWN 1
#define GNUTLS_CRL_REASON_AA_COMPROMISE 32768
-int gnutls_x509_crt_get_crl_dist_points(gnutls_x509_crt cert,
+int gnutls_x509_crt_get_crl_dist_points(gnutls_x509_crt_t cert,
unsigned int seq, void *ret, size_t *ret_size, unsigned int* reason_flags,
unsigned int *critical);
-int gnutls_x509_crt_set_crl_dist_points(gnutls_x509_crt crt, gnutls_x509_subject_alt_name type,
+int gnutls_x509_crt_set_crl_dist_points(gnutls_x509_crt_t crt, gnutls_x509_subject_alt_name_t type,
const void* data_string, unsigned int reason_flags);
-int gnutls_x509_crt_cpy_crl_dist_points(gnutls_x509_crt dst,
- gnutls_x509_crt src);
+int gnutls_x509_crt_cpy_crl_dist_points(gnutls_x509_crt_t dst,
+ gnutls_x509_crt_t src);
-time_t gnutls_x509_crt_get_activation_time(gnutls_x509_crt cert);
-time_t gnutls_x509_crt_get_expiration_time(gnutls_x509_crt cert);
-int gnutls_x509_crt_get_serial(gnutls_x509_crt cert, void* result, size_t* result_size);
+time_t gnutls_x509_crt_get_activation_time(gnutls_x509_crt_t cert);
+time_t gnutls_x509_crt_get_expiration_time(gnutls_x509_crt_t cert);
+int gnutls_x509_crt_get_serial(gnutls_x509_crt_t cert, void* result, size_t* result_size);
-int gnutls_x509_crt_get_pk_algorithm( gnutls_x509_crt cert, unsigned int* bits);
-int gnutls_x509_crt_get_pk_rsa_raw(gnutls_x509_crt crt,
- gnutls_datum * m, gnutls_datum *e);
-int gnutls_x509_crt_get_pk_dsa_raw(gnutls_x509_crt crt,
- gnutls_datum * p, gnutls_datum *q,
- gnutls_datum *g, gnutls_datum *y);
+int gnutls_x509_crt_get_pk_algorithm( gnutls_x509_crt_t cert, unsigned int* bits);
+int gnutls_x509_crt_get_pk_rsa_raw(gnutls_x509_crt_t crt,
+ gnutls_datum_t * m, gnutls_datum_t *e);
+int gnutls_x509_crt_get_pk_dsa_raw(gnutls_x509_crt_t crt,
+ gnutls_datum_t * p, gnutls_datum_t *q,
+ gnutls_datum_t *g, gnutls_datum_t *y);
-int gnutls_x509_crt_get_subject_alt_name(gnutls_x509_crt cert,
+int gnutls_x509_crt_get_subject_alt_name(gnutls_x509_crt_t cert,
unsigned int seq, void *ret, size_t *ret_size, unsigned int* critical);
-int gnutls_x509_crt_get_ca_status(gnutls_x509_crt cert, unsigned int* critical);
+int gnutls_x509_crt_get_ca_status(gnutls_x509_crt_t cert, unsigned int* critical);
/* The key_usage flags are defined in gnutls.h. They are
* the GNUTLS_KEY_* definitions.
*/
-int gnutls_x509_crt_get_key_usage( gnutls_x509_crt cert, unsigned int* key_usage,
+int gnutls_x509_crt_get_key_usage( gnutls_x509_crt_t cert, unsigned int* key_usage,
unsigned int* critical);
-int gnutls_x509_crt_set_key_usage(gnutls_x509_crt crt, unsigned int usage);
+int gnutls_x509_crt_set_key_usage(gnutls_x509_crt_t crt, unsigned int usage);
int gnutls_x509_dn_oid_known(const char* oid);
-int gnutls_x509_crt_get_extension_oid(gnutls_x509_crt cert, int indx,
+int gnutls_x509_crt_get_extension_oid(gnutls_x509_crt_t cert, int indx,
void* oid, size_t * sizeof_oid);
-int gnutls_x509_crt_get_extension_by_oid(gnutls_x509_crt cert,
+int gnutls_x509_crt_get_extension_by_oid(gnutls_x509_crt_t cert,
const char* oid, int indx,
void* buf, size_t * sizeof_buf, unsigned int * critical);
-int gnutls_x509_crt_to_xml(gnutls_x509_crt cert, gnutls_datum* res, int detail);
+int gnutls_x509_crt_to_xml(gnutls_x509_crt_t cert, gnutls_datum_t* res, int detail);
/* possible values for detail.
*/
@@ -169,81 +169,81 @@ int gnutls_x509_crt_to_xml(gnutls_x509_crt cert, gnutls_datum* res, int detail);
/* X.509 Certificate writing.
*/
-int gnutls_x509_crt_set_dn_by_oid(gnutls_x509_crt crt, const char* oid,
+int gnutls_x509_crt_set_dn_by_oid(gnutls_x509_crt_t crt, const char* oid,
unsigned int raw_flag, const void *name, unsigned int sizeof_name);
-int gnutls_x509_crt_set_issuer_dn_by_oid(gnutls_x509_crt crt, const char* oid,
+int gnutls_x509_crt_set_issuer_dn_by_oid(gnutls_x509_crt_t crt, const char* oid,
unsigned int raw_flag, const void *name, unsigned int sizeof_name);
-int gnutls_x509_crt_set_version(gnutls_x509_crt crt, unsigned int version);
-int gnutls_x509_crt_set_key(gnutls_x509_crt crt, gnutls_x509_privkey key);
-int gnutls_x509_crt_set_ca_status(gnutls_x509_crt crt, unsigned int ca);
-int gnutls_x509_crt_set_subject_alternative_name(gnutls_x509_crt crt, gnutls_x509_subject_alt_name type,
+int gnutls_x509_crt_set_version(gnutls_x509_crt_t crt, unsigned int version);
+int gnutls_x509_crt_set_key(gnutls_x509_crt_t crt, gnutls_x509_privkey_t key);
+int gnutls_x509_crt_set_ca_status(gnutls_x509_crt_t crt, unsigned int ca);
+int gnutls_x509_crt_set_subject_alternative_name(gnutls_x509_crt_t crt, gnutls_x509_subject_alt_name_t type,
const char* data_string);
-int gnutls_x509_crt_sign(gnutls_x509_crt crt, gnutls_x509_crt issuer,
- gnutls_x509_privkey issuer_key);
-int gnutls_x509_crt_set_activation_time(gnutls_x509_crt cert, time_t act_time);
-int gnutls_x509_crt_set_expiration_time(gnutls_x509_crt cert, time_t exp_time);
-int gnutls_x509_crt_set_serial(gnutls_x509_crt cert, const void* serial,
+int gnutls_x509_crt_sign(gnutls_x509_crt_t crt, gnutls_x509_crt_t issuer,
+ gnutls_x509_privkey_t issuer_key);
+int gnutls_x509_crt_set_activation_time(gnutls_x509_crt_t cert, time_t act_time);
+int gnutls_x509_crt_set_expiration_time(gnutls_x509_crt_t cert, time_t exp_time);
+int gnutls_x509_crt_set_serial(gnutls_x509_crt_t cert, const void* serial,
size_t serial_size);
-int gnutls_x509_crt_set_subject_key_id(gnutls_x509_crt cert, const void* id,
+int gnutls_x509_crt_set_subject_key_id(gnutls_x509_crt_t cert, const void* id,
size_t id_size);
/* RDN handling
*/
-int gnutls_x509_rdn_get(const gnutls_datum * idn,
+int gnutls_x509_rdn_get(const gnutls_datum_t * idn,
char *buf, size_t *sizeof_buf);
-int gnutls_x509_rdn_get_oid(const gnutls_datum * idn,
+int gnutls_x509_rdn_get_oid(const gnutls_datum_t * idn,
int indx, void *buf, size_t * sizeof_buf);
-int gnutls_x509_rdn_get_by_oid(const gnutls_datum * idn, const char* oid,
+int gnutls_x509_rdn_get_by_oid(const gnutls_datum_t * idn, const char* oid,
int indx, unsigned int raw_flag, void *buf, size_t *sizeof_buf);
/* CRL handling functions */
-int gnutls_x509_crl_init(gnutls_x509_crl * crl);
-void gnutls_x509_crl_deinit(gnutls_x509_crl crl);
+int gnutls_x509_crl_init(gnutls_x509_crl_t * crl);
+void gnutls_x509_crl_deinit(gnutls_x509_crl_t crl);
-int gnutls_x509_crl_import(gnutls_x509_crl crl, const gnutls_datum * data,
- gnutls_x509_crt_fmt format);
-int gnutls_x509_crl_export( gnutls_x509_crl crl,
- gnutls_x509_crt_fmt format, void* output_data, size_t* output_data_size);
+int gnutls_x509_crl_import(gnutls_x509_crl_t crl, const gnutls_datum_t * data,
+ gnutls_x509_crt_fmt_t format);
+int gnutls_x509_crl_export( gnutls_x509_crl_t crl,
+ gnutls_x509_crt_fmt_t format, void* output_data, size_t* output_data_size);
-int gnutls_x509_crl_get_issuer_dn(const gnutls_x509_crl crl,
+int gnutls_x509_crl_get_issuer_dn(const gnutls_x509_crl_t crl,
char *buf, size_t *sizeof_buf);
-int gnutls_x509_crl_get_issuer_dn_by_oid(gnutls_x509_crl crl,
+int gnutls_x509_crl_get_issuer_dn_by_oid(gnutls_x509_crl_t crl,
const char* oid, int indx,
unsigned int raw_flag, void *buf, size_t *sizeof_buf);
-int gnutls_x509_crl_get_dn_oid(gnutls_x509_crl crl,
+int gnutls_x509_crl_get_dn_oid(gnutls_x509_crl_t crl,
int indx, void *oid, size_t *sizeof_oid);
-int gnutls_x509_crl_get_signature_algorithm(gnutls_x509_crl crl);
-int gnutls_x509_crl_get_version(gnutls_x509_crl crl);
+int gnutls_x509_crl_get_signature_algorithm(gnutls_x509_crl_t crl);
+int gnutls_x509_crl_get_version(gnutls_x509_crl_t crl);
-time_t gnutls_x509_crl_get_this_update(gnutls_x509_crl crl);
-time_t gnutls_x509_crl_get_next_update(gnutls_x509_crl crl);
+time_t gnutls_x509_crl_get_this_update(gnutls_x509_crl_t crl);
+time_t gnutls_x509_crl_get_next_update(gnutls_x509_crl_t crl);
-int gnutls_x509_crl_get_crt_count(gnutls_x509_crl crl);
-int gnutls_x509_crl_get_crt_serial(gnutls_x509_crl crl, int index, unsigned char* serial,
- size_t* serial_size, time_t* time);
+int gnutls_x509_crl_get_crt_count(gnutls_x509_crl_t crl);
+int gnutls_x509_crl_get_crt_serial(gnutls_x509_crl_t crl, int index, unsigned char* serial,
+ size_t* serial_size, time_t* time);
#define gnutls_x509_crl_get_certificate_count gnutls_x509_crl_get_crt_count
#define gnutls_x509_crl_get_certificate gnutls_x509_crl_get_crt_serial
-int gnutls_x509_crl_check_issuer( gnutls_x509_crl crl,
- gnutls_x509_crt issuer);
+int gnutls_x509_crl_check_issuer( gnutls_x509_crl_t crl,
+ gnutls_x509_crt_t issuer);
/* CRL writing.
*/
-int gnutls_x509_crl_set_version(gnutls_x509_crl crl, unsigned int version);
-int gnutls_x509_crl_sign(gnutls_x509_crl crl, gnutls_x509_crt issuer,
- gnutls_x509_privkey issuer_key);
-int gnutls_x509_crl_set_this_update(gnutls_x509_crl crl, time_t act_time);
-int gnutls_x509_crl_set_next_update(gnutls_x509_crl crl, time_t exp_time);
-int gnutls_x509_crl_set_crt_serial(gnutls_x509_crl crl, const void* serial,
+int gnutls_x509_crl_set_version(gnutls_x509_crl_t crl, unsigned int version);
+int gnutls_x509_crl_sign(gnutls_x509_crl_t crl, gnutls_x509_crt_t issuer,
+ gnutls_x509_privkey_t issuer_key);
+int gnutls_x509_crl_set_this_update(gnutls_x509_crl_t crl, time_t act_time);
+int gnutls_x509_crl_set_next_update(gnutls_x509_crl_t crl, time_t exp_time);
+int gnutls_x509_crl_set_crt_serial(gnutls_x509_crl_t crl, const void* serial,
size_t serial_size, time_t revocation_time);
-int gnutls_x509_crl_set_crt(gnutls_x509_crl crl, gnutls_x509_crt crt,
+int gnutls_x509_crl_set_crt(gnutls_x509_crl_t crl, gnutls_x509_crt_t crt,
time_t revocation_time);
@@ -251,31 +251,31 @@ int gnutls_x509_crl_set_crt(gnutls_x509_crl crl, gnutls_x509_crt crt,
*/
struct gnutls_pkcs7_int;
-typedef struct gnutls_pkcs7_int* gnutls_pkcs7;
+typedef struct gnutls_pkcs7_int* gnutls_pkcs7_t;
-int gnutls_pkcs7_init(gnutls_pkcs7 * pkcs7);
-void gnutls_pkcs7_deinit(gnutls_pkcs7 pkcs7);
-int gnutls_pkcs7_import(gnutls_pkcs7 pkcs7, const gnutls_datum * data,
- gnutls_x509_crt_fmt format);
-int gnutls_pkcs7_export( gnutls_pkcs7 pkcs7,
- gnutls_x509_crt_fmt format, void* output_data, size_t* output_data_size);
+int gnutls_pkcs7_init(gnutls_pkcs7_t * pkcs7);
+void gnutls_pkcs7_deinit(gnutls_pkcs7_t pkcs7);
+int gnutls_pkcs7_import(gnutls_pkcs7_t pkcs7, const gnutls_datum_t * data,
+ gnutls_x509_crt_fmt_t format);
+int gnutls_pkcs7_export( gnutls_pkcs7_t pkcs7,
+ gnutls_x509_crt_fmt_t format, void* output_data, size_t* output_data_size);
-int gnutls_pkcs7_get_crt_count( gnutls_pkcs7 pkcs7);
-int gnutls_pkcs7_get_crt_raw(gnutls_pkcs7 pkcs7, int indx,
+int gnutls_pkcs7_get_crt_count( gnutls_pkcs7_t pkcs7);
+int gnutls_pkcs7_get_crt_raw(gnutls_pkcs7_t pkcs7, int indx,
void* certificate, size_t* certificate_size);
-int gnutls_pkcs7_set_crt_raw(gnutls_pkcs7 pkcs7, const gnutls_datum* crt);
-int gnutls_pkcs7_set_crt(gnutls_pkcs7 pkcs7, gnutls_x509_crt crt);
-int gnutls_pkcs7_delete_crt(gnutls_pkcs7 pkcs7, int indx);
+int gnutls_pkcs7_set_crt_raw(gnutls_pkcs7_t pkcs7, const gnutls_datum_t* crt);
+int gnutls_pkcs7_set_crt(gnutls_pkcs7_t pkcs7, gnutls_x509_crt_t crt);
+int gnutls_pkcs7_delete_crt(gnutls_pkcs7_t pkcs7, int indx);
-int gnutls_pkcs7_get_crl_raw(gnutls_pkcs7 pkcs7,
+int gnutls_pkcs7_get_crl_raw(gnutls_pkcs7_t pkcs7,
int indx, void* crl, size_t* crl_size);
-int gnutls_pkcs7_get_crl_count(gnutls_pkcs7 pkcs7);
+int gnutls_pkcs7_get_crl_count(gnutls_pkcs7_t pkcs7);
-int gnutls_pkcs7_set_crl_raw(gnutls_pkcs7 pkcs7, const gnutls_datum* crt);
-int gnutls_pkcs7_set_crl(gnutls_pkcs7 pkcs7, gnutls_x509_crl crl);
-int gnutls_pkcs7_delete_crl(gnutls_pkcs7 pkcs7, int indx);
+int gnutls_pkcs7_set_crl_raw(gnutls_pkcs7_t pkcs7, const gnutls_datum_t* crt);
+int gnutls_pkcs7_set_crl(gnutls_pkcs7_t pkcs7, gnutls_x509_crl_t crl);
+int gnutls_pkcs7_delete_crl(gnutls_pkcs7_t pkcs7, int indx);
/* X.509 Certificate verification functions.
*/
@@ -290,32 +290,32 @@ typedef enum gnutls_certificate_verify_flags {
*/
} gnutls_certificate_verify_flags;
-int gnutls_x509_crt_check_issuer( gnutls_x509_crt cert,
- gnutls_x509_crt issuer);
+int gnutls_x509_crt_check_issuer( gnutls_x509_crt_t cert,
+ gnutls_x509_crt_t issuer);
-int gnutls_x509_crt_list_verify( gnutls_x509_crt* cert_list, int cert_list_length,
- const gnutls_x509_crt * CA_list, int CA_list_length,
- const gnutls_x509_crl* CRL_list, int CRL_list_length,
+int gnutls_x509_crt_list_verify( gnutls_x509_crt_t* cert_list, int cert_list_length,
+ const gnutls_x509_crt_t * CA_list, int CA_list_length,
+ const gnutls_x509_crl_t* CRL_list, int CRL_list_length,
unsigned int flags, unsigned int *verify);
-int gnutls_x509_crt_verify( gnutls_x509_crt cert,
- const gnutls_x509_crt *CA_list, int CA_list_length,
+int gnutls_x509_crt_verify( gnutls_x509_crt_t cert,
+ const gnutls_x509_crt_t *CA_list, int CA_list_length,
unsigned int flags, unsigned int *verify);
-int gnutls_x509_crl_verify( gnutls_x509_crl crl,
- const gnutls_x509_crt *CA_list, int CA_list_length,
+int gnutls_x509_crl_verify( gnutls_x509_crl_t crl,
+ const gnutls_x509_crt_t *CA_list, int CA_list_length,
unsigned int flags, unsigned int *verify);
-int gnutls_x509_crt_check_revocation(gnutls_x509_crt cert,
- const gnutls_x509_crl * crl_list,
+int gnutls_x509_crt_check_revocation(gnutls_x509_crt_t cert,
+ const gnutls_x509_crl_t * crl_list,
int crl_list_length);
-int gnutls_x509_crt_get_fingerprint(gnutls_x509_crt cert,
- gnutls_digest_algorithm algo, void *buf,
+int gnutls_x509_crt_get_fingerprint(gnutls_x509_crt_t cert,
+ gnutls_digest_algorithm_t algo, void *buf,
size_t *sizeof_buf);
-int gnutls_x509_crt_get_key_purpose_oid(gnutls_x509_crt cert,
+int gnutls_x509_crt_get_key_purpose_oid(gnutls_x509_crt_t cert,
int indx, void *oid, size_t *sizeof_oid, unsigned int* critical);
-int gnutls_x509_crt_set_key_purpose_oid(gnutls_x509_crt cert,
+int gnutls_x509_crt_set_key_purpose_oid(gnutls_x509_crt_t cert,
const void *oid, unsigned int critical);
/* Private key handling
@@ -323,7 +323,7 @@ int gnutls_x509_crt_set_key_purpose_oid(gnutls_x509_crt cert,
/* Flags for the gnutls_x509_privkey_export_pkcs8() function.
*/
-typedef enum gnutls_pkcs_encrypt_flags {
+typedef enum gnutls_pkcs_encrypt_flags_t {
GNUTLS_PKCS_PLAIN=1, /* if set the private key will not
* be encrypted.
*/
@@ -331,91 +331,91 @@ typedef enum gnutls_pkcs_encrypt_flags {
GNUTLS_PKCS_USE_PKCS12_ARCFOUR=4,
GNUTLS_PKCS_USE_PKCS12_RC2_40=8,
GNUTLS_PKCS_USE_PBES2_3DES=16
-} gnutls_pkcs_encrypt_flags;
+} gnutls_pkcs_encrypt_flags_t;
#define GNUTLS_PKCS8_PLAIN GNUTLS_PKCS_PLAIN
#define GNUTLS_PKCS8_USE_PKCS12_3DES GNUTLS_PKCS_USE_PKCS12_3DES
#define GNUTLS_PKCS8_USE_PKCS12_ARCFOUR GNUTLS_PKCS_USE_PKCS12_ARCFOUR
#define GNUTLS_PKCS8_USE_PKCS12_RC2_40 GNUTLS_PKCS_USE_PKCS12_RC2_40
-int gnutls_x509_privkey_init(gnutls_x509_privkey * key);
-void gnutls_x509_privkey_deinit(gnutls_x509_privkey key);
-int gnutls_x509_privkey_cpy(gnutls_x509_privkey dst, gnutls_x509_privkey src);
-int gnutls_x509_privkey_import(gnutls_x509_privkey key, const gnutls_datum * data,
- gnutls_x509_crt_fmt format);
-int gnutls_x509_privkey_import_pkcs8(gnutls_x509_privkey key, const gnutls_datum * data,
- gnutls_x509_crt_fmt format, const char * pass, unsigned int flags);
-int gnutls_x509_privkey_import_rsa_raw(gnutls_x509_privkey privkey,
- const gnutls_datum *m, const gnutls_datum *e,
- const gnutls_datum *d, const gnutls_datum *p, const gnutls_datum *q,
- const gnutls_datum *u);
-
-int gnutls_x509_privkey_export_dsa_raw(gnutls_x509_privkey key,
- gnutls_datum * p, gnutls_datum *q,
- gnutls_datum *g, gnutls_datum *y, gnutls_datum* x);
-int gnutls_x509_privkey_import_dsa_raw(gnutls_x509_privkey key,
- const gnutls_datum* p, const gnutls_datum* q,
- const gnutls_datum* g, const gnutls_datum* y,
- const gnutls_datum* x);
-
-int gnutls_x509_privkey_get_pk_algorithm( gnutls_x509_privkey key);
-int gnutls_x509_privkey_get_key_id( gnutls_x509_privkey key, unsigned int flags,
+int gnutls_x509_privkey_init(gnutls_x509_privkey_t * key);
+void gnutls_x509_privkey_deinit(gnutls_x509_privkey_t key);
+int gnutls_x509_privkey_cpy(gnutls_x509_privkey_t dst, gnutls_x509_privkey_t src);
+int gnutls_x509_privkey_import(gnutls_x509_privkey_t key, const gnutls_datum_t * data,
+ gnutls_x509_crt_fmt_t format);
+int gnutls_x509_privkey_import_pkcs8(gnutls_x509_privkey_t key, const gnutls_datum_t * data,
+ gnutls_x509_crt_fmt_t format, const char * pass, unsigned int flags);
+int gnutls_x509_privkey_import_rsa_raw(gnutls_x509_privkey_t privkey,
+ const gnutls_datum_t *m, const gnutls_datum_t *e,
+ const gnutls_datum_t *d, const gnutls_datum_t *p, const gnutls_datum_t *q,
+ const gnutls_datum_t *u);
+
+int gnutls_x509_privkey_export_dsa_raw(gnutls_x509_privkey_t key,
+ gnutls_datum_t * p, gnutls_datum_t *q,
+ gnutls_datum_t *g, gnutls_datum_t *y, gnutls_datum_t* x);
+int gnutls_x509_privkey_import_dsa_raw(gnutls_x509_privkey_t key,
+ const gnutls_datum_t* p, const gnutls_datum_t* q,
+ const gnutls_datum_t* g, const gnutls_datum_t* y,
+ const gnutls_datum_t* x);
+
+int gnutls_x509_privkey_get_pk_algorithm( gnutls_x509_privkey_t key);
+int gnutls_x509_privkey_get_key_id( gnutls_x509_privkey_t key, unsigned int flags,
unsigned char* output_data, size_t* output_data_size);
-int gnutls_x509_privkey_generate( gnutls_x509_privkey key, gnutls_pk_algorithm algo,
+int gnutls_x509_privkey_generate( gnutls_x509_privkey_t key, gnutls_pk_algorithm_t algo,
unsigned int bits, unsigned int flags);
-int gnutls_x509_privkey_export( gnutls_x509_privkey key,
- gnutls_x509_crt_fmt format, void* output_data, size_t* output_data_size);
-int gnutls_x509_privkey_export_pkcs8( gnutls_x509_privkey key,
- gnutls_x509_crt_fmt format, const char* password, unsigned int flags,
+int gnutls_x509_privkey_export( gnutls_x509_privkey_t key,
+ gnutls_x509_crt_fmt_t format, void* output_data, size_t* output_data_size);
+int gnutls_x509_privkey_export_pkcs8( gnutls_x509_privkey_t key,
+ gnutls_x509_crt_fmt_t format, const char* password, unsigned int flags,
void* output_data, size_t* output_data_size);
-int gnutls_x509_privkey_export_rsa_raw(gnutls_x509_privkey key,
- gnutls_datum * m, gnutls_datum *e,
- gnutls_datum *d, gnutls_datum *p, gnutls_datum* q,
- gnutls_datum* u);
+int gnutls_x509_privkey_export_rsa_raw(gnutls_x509_privkey_t key,
+ gnutls_datum_t * m, gnutls_datum_t *e,
+ gnutls_datum_t *d, gnutls_datum_t *p, gnutls_datum_t* q,
+ gnutls_datum_t* u);
/* signing stuff.
*/
-int gnutls_x509_privkey_sign_data( gnutls_x509_privkey key, gnutls_digest_algorithm digest,
- unsigned int flags, const gnutls_datum* data,
+int gnutls_x509_privkey_sign_data( gnutls_x509_privkey_t key, gnutls_digest_algorithm_t digest,
+ unsigned int flags, const gnutls_datum_t* data,
void* signature, size_t* signature_size);
-int gnutls_x509_privkey_verify_data( gnutls_x509_privkey key, unsigned int flags,
- const gnutls_datum* data, const gnutls_datum* signature);
-int gnutls_x509_crt_verify_data( gnutls_x509_crt crt, unsigned int flags,
- const gnutls_datum* data, const gnutls_datum* signature);
+int gnutls_x509_privkey_verify_data( gnutls_x509_privkey_t key, unsigned int flags,
+ const gnutls_datum_t* data, const gnutls_datum_t* signature);
+int gnutls_x509_crt_verify_data( gnutls_x509_crt_t crt, unsigned int flags,
+ const gnutls_datum_t* data, const gnutls_datum_t* signature);
/* Certificate request stuff
*/
struct gnutls_x509_crq_int;
-typedef struct gnutls_x509_crq_int* gnutls_x509_crq;
-
-int gnutls_x509_crq_init(gnutls_x509_crq * crq);
-void gnutls_x509_crq_deinit(gnutls_x509_crq crq);
-int gnutls_x509_crq_import(gnutls_x509_crq crq, const gnutls_datum * data,
- gnutls_x509_crt_fmt format);
-int gnutls_x509_crq_get_pk_algorithm( gnutls_x509_crq crq, unsigned int* bits);
-int gnutls_x509_crq_get_dn(gnutls_x509_crq crq, char *buf,
+typedef struct gnutls_x509_crq_int* gnutls_x509_crq_t;
+
+int gnutls_x509_crq_init(gnutls_x509_crq_t * crq);
+void gnutls_x509_crq_deinit(gnutls_x509_crq_t crq);
+int gnutls_x509_crq_import(gnutls_x509_crq_t crq, const gnutls_datum_t * data,
+ gnutls_x509_crt_fmt_t format);
+int gnutls_x509_crq_get_pk_algorithm( gnutls_x509_crq_t crq, unsigned int* bits);
+int gnutls_x509_crq_get_dn(gnutls_x509_crq_t crq, char *buf,
size_t *sizeof_buf);
-int gnutls_x509_crq_get_dn_oid(gnutls_x509_crq crq,
+int gnutls_x509_crq_get_dn_oid(gnutls_x509_crq_t crq,
int indx, void *oid, size_t *sizeof_oid);
-int gnutls_x509_crq_get_dn_by_oid(gnutls_x509_crq crq, const char* oid,
+int gnutls_x509_crq_get_dn_by_oid(gnutls_x509_crq_t crq, const char* oid,
int indx, unsigned int raw_flag, void *buf, size_t *sizeof_buf);
-int gnutls_x509_crq_set_dn_by_oid(gnutls_x509_crq crq, const char* oid,
+int gnutls_x509_crq_set_dn_by_oid(gnutls_x509_crq_t crq, const char* oid,
unsigned int raw_flag, const void *name, unsigned int sizeof_name);
-int gnutls_x509_crq_set_version(gnutls_x509_crq crq, unsigned int version);
-int gnutls_x509_crq_set_key(gnutls_x509_crq crq, gnutls_x509_privkey key);
-int gnutls_x509_crq_sign(gnutls_x509_crq crq, gnutls_x509_privkey key);
+int gnutls_x509_crq_set_version(gnutls_x509_crq_t crq, unsigned int version);
+int gnutls_x509_crq_set_key(gnutls_x509_crq_t crq, gnutls_x509_privkey_t key);
+int gnutls_x509_crq_sign(gnutls_x509_crq_t crq, gnutls_x509_privkey_t key);
-int gnutls_x509_crq_set_challenge_password(gnutls_x509_crq crq, const char* pass);
-int gnutls_x509_crq_get_challenge_password(gnutls_x509_crq crq,
+int gnutls_x509_crq_set_challenge_password(gnutls_x509_crq_t crq, const char* pass);
+int gnutls_x509_crq_get_challenge_password(gnutls_x509_crq_t crq,
const char* pass, size_t* sizeof_pass);
-int gnutls_x509_crq_export( gnutls_x509_crq crq,
- gnutls_x509_crt_fmt format, void* output_data, size_t* output_data_size);
+int gnutls_x509_crq_export( gnutls_x509_crq_t crq,
+ gnutls_x509_crt_fmt_t format, void* output_data, size_t* output_data_size);
-int gnutls_x509_crt_set_crq(gnutls_x509_crt crt, gnutls_x509_crq crq);
+int gnutls_x509_crt_set_crq(gnutls_x509_crt_t crt, gnutls_x509_crq_t crq);
#ifdef __cplusplus