summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2005-12-09 11:22:11 +0000
committerSimon Josefsson <simon@josefsson.org>2005-12-09 11:22:11 +0000
commitb7807baab8f7aa10b74f8cea0907668771652fc2 (patch)
tree4e5c73b88b6653e7da1be542cf15b4d0597b1001 /lib
parentf3531e5db5c95c87a5ecb35235dcf945d9ad74e2 (diff)
downloadgnutls-b7807baab8f7aa10b74f8cea0907668771652fc2.tar.gz
Replace uint8 with uint8_t.
Diffstat (limited to 'lib')
-rw-r--r--lib/auth_cert.c2
-rw-r--r--lib/auth_dh_common.c8
-rw-r--r--lib/auth_rsa_export.c6
-rw-r--r--lib/auth_srp.c18
-rw-r--r--lib/auth_srp_passwd.h4
-rw-r--r--lib/auth_srp_sb64.c20
-rw-r--r--lib/defines.h6
-rw-r--r--lib/ext_cert_type.c4
-rw-r--r--lib/ext_max_record.c4
-rw-r--r--lib/ext_server_name.c2
-rw-r--r--lib/ext_srp.c6
-rw-r--r--lib/gnutls_alert.c6
-rw-r--r--lib/gnutls_algorithms.c12
-rw-r--r--lib/gnutls_algorithms.h2
-rw-r--r--lib/gnutls_cipher.c24
-rw-r--r--lib/gnutls_cipher.h4
-rw-r--r--lib/gnutls_datum.c2
-rw-r--r--lib/gnutls_db.c4
-rw-r--r--lib/gnutls_db.h4
-rw-r--r--lib/gnutls_handshake.c44
-rw-r--r--lib/gnutls_handshake.h8
-rw-r--r--lib/gnutls_int.h10
-rw-r--r--lib/gnutls_kx.c20
-rw-r--r--lib/gnutls_num.c12
-rw-r--r--lib/gnutls_record.c14
-rw-r--r--lib/x509/extensions.c6
-rw-r--r--lib/x509/pkcs12.c2
-rw-r--r--lib/x509/pkcs7.c2
-rw-r--r--lib/x509/x509.c2
-rw-r--r--lib/x509_b64.c34
-rw-r--r--lib/x509_b64.h16
31 files changed, 151 insertions, 157 deletions
diff --git a/lib/auth_cert.c b/lib/auth_cert.c
index c458ff987a..eac86abc5c 100644
--- a/lib/auth_cert.c
+++ b/lib/auth_cert.c
@@ -1029,7 +1029,7 @@ _gnutls_proc_openpgp_server_certificate (gnutls_session_t session,
p++;
DECR_LEN (dsize, 1);
- len = (uint8) * p;
+ len = (uint8_t) * p;
p++;
if (len != 20)
diff --git a/lib/auth_dh_common.c b/lib/auth_dh_common.c
index e3e48febf3..e13fbe5379 100644
--- a/lib/auth_dh_common.c
+++ b/lib/auth_dh_common.c
@@ -217,9 +217,9 @@ _gnutls_proc_dh_common_server_kx (gnutls_session_t session,
{
uint16 n_Y, n_g, n_p;
size_t _n_Y, _n_g, _n_p;
- uint8 *data_p;
- uint8 *data_g;
- uint8 *data_Y;
+ uint8_t *data_p;
+ uint8_t *data_g;
+ uint8_t *data_Y;
int i, bits, psk_size, ret;
ssize_t data_size = _data_size;
@@ -311,7 +311,7 @@ _gnutls_dh_common_print_server_kx (gnutls_session_t session,
mpi_t x, X;
size_t n_X, n_g, n_p;
int ret, data_size, pos;
- uint8 *pdata;
+ uint8_t *pdata;
X = gnutls_calc_dh_secret (&x, g, p);
if (X == NULL || x == NULL)
diff --git a/lib/auth_rsa_export.c b/lib/auth_rsa_export.c
index 7b5c839909..490492a687 100644
--- a/lib/auth_rsa_export.c
+++ b/lib/auth_rsa_export.c
@@ -72,7 +72,7 @@ gen_rsa_export_server_kx (gnutls_session_t session, opaque ** data)
gnutls_rsa_params_t rsa_params;
const mpi_t *rsa_mpis;
size_t n_e, n_m;
- uint8 *data_e, *data_m;
+ uint8_t *data_e, *data_m;
int ret = 0, data_size;
gnutls_cert *apr_cert_list;
gnutls_privkey *apr_pkey;
@@ -236,8 +236,8 @@ proc_rsa_export_server_kx (gnutls_session_t session,
{
uint16 n_m, n_e;
size_t _n_m, _n_e;
- uint8 *data_m;
- uint8 *data_e;
+ uint8_t *data_m;
+ uint8_t *data_e;
int i, sigsize;
gnutls_datum_t vparams, signature;
int ret;
diff --git a/lib/auth_srp.c b/lib/auth_srp.c
index 0efadd16a9..a850610bc6 100644
--- a/lib/auth_srp.c
+++ b/lib/auth_srp.c
@@ -138,15 +138,15 @@ int
_gnutls_gen_srp_server_kx (gnutls_session_t session, opaque ** data)
{
int ret;
- uint8 *data_n, *data_s;
- uint8 *data_g;
+ uint8_t *data_n, *data_s;
+ uint8_t *data_g;
char *username;
SRP_PWD_ENTRY *pwd_entry;
srp_server_auth_info_t info;
ssize_t data_size;
size_t n_b, tmp_size;
char buf[64];
- uint8 *data_b;
+ uint8_t *data_b;
if ((ret =
_gnutls_auth_info_set (session, GNUTLS_CRD_SRP,
@@ -260,7 +260,7 @@ _gnutls_gen_srp_client_kx (gnutls_session_t session, opaque ** data)
{
size_t n_a;
int ret;
- uint8 *data_a;
+ uint8_t *data_a;
char *username, *password;
char buf[64];
gnutls_srp_client_credentials_t cred;
@@ -691,13 +691,13 @@ int
_gnutls_proc_srp_server_kx (gnutls_session_t session, opaque * data,
size_t _data_size)
{
- uint8 n_s;
+ uint8_t n_s;
uint16 n_g, n_n, n_b;
size_t _n_s, _n_g, _n_n, _n_b;
- const uint8 *data_n;
- const uint8 *data_g;
- const uint8 *data_s;
- const uint8 *data_b;
+ const uint8_t *data_n;
+ const uint8_t *data_g;
+ const uint8_t *data_s;
+ const uint8_t *data_b;
int i, ret;
opaque hd[SRP_MAX_HASH_SIZE];
char *username, *password;
diff --git a/lib/auth_srp_passwd.h b/lib/auth_srp_passwd.h
index 5111a838cb..9adaf20c76 100644
--- a/lib/auth_srp_passwd.h
+++ b/lib/auth_srp_passwd.h
@@ -38,7 +38,7 @@ typedef struct
int _gnutls_srp_pwd_read_entry (gnutls_session_t state, char *username,
SRP_PWD_ENTRY **);
void _gnutls_srp_entry_free (SRP_PWD_ENTRY * entry);
-int _gnutls_sbase64_encode (uint8 * data, size_t data_size, uint8 ** result);
-int _gnutls_sbase64_decode (uint8 * data, size_t data_size, uint8 ** result);
+int _gnutls_sbase64_encode (uint8_t * data, size_t data_size, uint8_t ** result);
+int _gnutls_sbase64_decode (uint8_t * data, size_t data_size, uint8_t ** result);
#endif /* ENABLE_SRP */
diff --git a/lib/auth_srp_sb64.c b/lib/auth_srp_sb64.c
index 578a66817d..fabc499632 100644
--- a/lib/auth_srp_sb64.c
+++ b/lib/auth_srp_sb64.c
@@ -31,10 +31,10 @@
/* this a modified base64 for srp !!!
* It seems that everybody makes an own base64 conversion.
*/
-static const uint8 b64table[] =
+static const uint8_t b64table[] =
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz./";
-static const uint8 asciitable[128] = {
+static const uint8_t asciitable[128] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
@@ -60,12 +60,12 @@ static const uint8 asciitable[128] = {
};
inline static int
-encode (uint8 * result, const uint8 * rdata, int left)
+encode (uint8_t * result, const uint8_t * rdata, int left)
{
int data_len;
int c, ret = 4;
- uint8 data[3];
+ uint8_t data[3];
if (left > 3)
data_len = 3;
@@ -148,7 +148,7 @@ encode (uint8 * result, const uint8 * rdata, int left)
* The result_size is the return value
*/
int
-_gnutls_sbase64_encode (uint8 * data, size_t data_size, uint8 ** result)
+_gnutls_sbase64_encode (uint8_t * data, size_t data_size, uint8_t ** result)
{
uint i, j;
int ret, tmp;
@@ -206,9 +206,9 @@ _gnutls_sbase64_encode (uint8 * data, size_t data_size, uint8 ** result)
*/
#define TOASCII(c) (c < 127 ? asciitable[c] : 0xff)
inline static int
-decode (uint8 * result, const uint8 * data)
+decode (uint8_t * result, const uint8_t * data)
{
- uint8 a1, a2;
+ uint8_t a1, a2;
int ret = 3;
memset (result, 0, 3);
@@ -249,13 +249,13 @@ decode (uint8 * result, const uint8 * data)
* before calling it.
*/
int
-_gnutls_sbase64_decode (uint8 * data, size_t idata_size, uint8 ** result)
+_gnutls_sbase64_decode (uint8_t * data, size_t idata_size, uint8_t ** result)
{
uint i, j;
int ret, left;
int data_size, tmp;
- uint8 datrev[4];
- uint8 tmpres[3];
+ uint8_t datrev[4];
+ uint8_t tmpres[3];
data_size = (idata_size / 4) * 4;
left = idata_size % 4;
diff --git a/lib/defines.h b/lib/defines.h
index 6646288083..2c5635b2cb 100644
--- a/lib/defines.h
+++ b/lib/defines.h
@@ -105,10 +105,4 @@ typedef unsigned short int uint16;
# error "Cannot find a 16 bit integer in your system, sorry."
#endif
-#if SIZEOF_UNSIGNED_CHAR == 1
-typedef unsigned char uint8;
-#else
-# error "Cannot find an 8 bit char in your system, sorry."
-#endif
-
#endif /* defines_h */
diff --git a/lib/ext_cert_type.c b/lib/ext_cert_type.c
index b53feebf79..cb615a7704 100644
--- a/lib/ext_cert_type.c
+++ b/lib/ext_cert_type.c
@@ -86,7 +86,7 @@ _gnutls_cert_type_recv_params (gnutls_session_t session,
*/
if (data_size > 1)
{
- uint8 len;
+ uint8_t len;
len = data[0];
DECR_LEN (data_size, len);
@@ -173,7 +173,7 @@ _gnutls_cert_type_send_params (gnutls_session_t session, opaque * data,
/* this is a vector!
*/
- data[0] = (uint8) len;
+ data[0] = (uint8_t) len;
for (i = 0; i < len; i++)
{
diff --git a/lib/ext_max_record.c b/lib/ext_max_record.c
index 0ed17a8587..05406cb934 100644
--- a/lib/ext_max_record.c
+++ b/lib/ext_max_record.c
@@ -120,7 +120,7 @@ _gnutls_max_record_send_params (gnutls_session_t session, opaque * data,
}
data[0] =
- (uint8) _gnutls_mre_record2num (session->internals.
+ (uint8_t) _gnutls_mre_record2num (session->internals.
proposed_record_size);
return len;
}
@@ -140,7 +140,7 @@ _gnutls_max_record_send_params (gnutls_session_t session, opaque * data,
}
data[0] =
- (uint8) _gnutls_mre_record2num (session->
+ (uint8_t) _gnutls_mre_record2num (session->
security_parameters.
max_record_recv_size);
return len;
diff --git a/lib/ext_server_name.c b/lib/ext_server_name.c
index e5b7006a3b..761e4a173e 100644
--- a/lib/ext_server_name.c
+++ b/lib/ext_server_name.c
@@ -153,7 +153,7 @@ _gnutls_server_name_send_params (gnutls_session_t session,
session->security_parameters.extensions.server_names[i].
name_length;
- /* uint8 + uint16 + size
+ /* uint8_t + uint16 + size
*/
total_size += 1 + 2 + len;
}
diff --git a/lib/ext_srp.c b/lib/ext_srp.c
index d6abcb9fdf..8e0cd51980 100644
--- a/lib/ext_srp.c
+++ b/lib/ext_srp.c
@@ -37,7 +37,7 @@ int
_gnutls_srp_recv_params (gnutls_session_t session, const opaque * data,
size_t _data_size)
{
- uint8 len;
+ uint8_t len;
ssize_t data_size = _data_size;
if (_gnutls_kx_priority (session, GNUTLS_KX_SRP) < 0 &&
@@ -107,7 +107,7 @@ _gnutls_srp_send_params (gnutls_session_t session, opaque * data,
return GNUTLS_E_SHORT_MEMORY_BUFFER;
}
- data[0] = (uint8) len;
+ data[0] = (uint8_t) len;
memcpy (&data[1], cred->username, len);
return len + 1;
}
@@ -145,7 +145,7 @@ _gnutls_srp_send_params (gnutls_session_t session, opaque * data,
session->internals.srp_username = username;
session->internals.srp_password = password;
- data[0] = (uint8) len;
+ data[0] = (uint8_t) len;
memcpy (&data[1], username, len);
return len + 1;
}
diff --git a/lib/gnutls_alert.c b/lib/gnutls_alert.c
index b2959de53f..566fe49bf5 100644
--- a/lib/gnutls_alert.c
+++ b/lib/gnutls_alert.c
@@ -114,12 +114,12 @@ int
gnutls_alert_send (gnutls_session_t session, gnutls_alert_level_t level,
gnutls_alert_description_t desc)
{
- uint8 data[2];
+ uint8_t data[2];
int ret;
const char *name;
- data[0] = (uint8) level;
- data[1] = (uint8) desc;
+ data[0] = (uint8_t) level;
+ data[1] = (uint8_t) desc;
name = gnutls_alert_get_name ((int) data[1]);
if (name == NULL)
diff --git a/lib/gnutls_algorithms.c b/lib/gnutls_algorithms.c
index 24fd9e2b72..f3c3b7a906 100644
--- a/lib/gnutls_algorithms.c
+++ b/lib/gnutls_algorithms.c
@@ -1127,9 +1127,9 @@ _gnutls_partition (gnutls_session_t session, void *_base,
int (*compar) (gnutls_session_t,
const void *, const void *))
{
- uint8 *base = _base;
- uint8 tmp[MAX_ELEM_SIZE];
- uint8 ptmp[MAX_ELEM_SIZE];
+ uint8_t *base = _base;
+ uint8_t tmp[MAX_ELEM_SIZE];
+ uint8_t ptmp[MAX_ELEM_SIZE];
unsigned int pivot;
unsigned int i, j;
unsigned int full;
@@ -1405,11 +1405,11 @@ _gnutls_supported_ciphersuites (gnutls_session_t session,
#define SUPPORTED_COMPRESSION_METHODS session->internals.compression_method_priority.algorithms
int
_gnutls_supported_compression_methods (gnutls_session_t session,
- uint8 ** comp)
+ uint8_t ** comp)
{
unsigned int i, j;
- *comp = gnutls_malloc (sizeof (uint8) * SUPPORTED_COMPRESSION_METHODS);
+ *comp = gnutls_malloc (sizeof (uint8_t) * SUPPORTED_COMPRESSION_METHODS);
if (*comp == NULL)
return GNUTLS_E_MEMORY_ERROR;
@@ -1428,7 +1428,7 @@ _gnutls_supported_compression_methods (gnutls_session_t session,
continue;
}
- (*comp)[j] = (uint8) tmp;
+ (*comp)[j] = (uint8_t) tmp;
j++;
}
diff --git a/lib/gnutls_algorithms.h b/lib/gnutls_algorithms.h
index 71562773d5..1582435554 100644
--- a/lib/gnutls_algorithms.h
+++ b/lib/gnutls_algorithms.h
@@ -51,7 +51,7 @@ int _gnutls_supported_ciphersuites (gnutls_session_t session,
int _gnutls_supported_ciphersuites_sorted (gnutls_session_t session,
cipher_suite_st ** ciphers);
int _gnutls_supported_compression_methods (gnutls_session_t session,
- uint8 ** comp);
+ uint8_t ** comp);
const char *_gnutls_cipher_suite_get_name (cipher_suite_st * algorithm);
gnutls_cipher_algorithm_t _gnutls_cipher_suite_get_cipher_algo (const
cipher_suite_st
diff --git a/lib/gnutls_cipher.c b/lib/gnutls_cipher.c
index dbace455da..ca866ca25a 100644
--- a/lib/gnutls_cipher.c
+++ b/lib/gnutls_cipher.c
@@ -125,7 +125,7 @@ _gnutls_encrypt (gnutls_session_t session, const opaque * headers,
*/
int
_gnutls_decrypt (gnutls_session_t session, opaque * ciphertext,
- size_t ciphertext_size, uint8 * data,
+ size_t ciphertext_size, uint8_t * data,
size_t max_data_size, content_type_t type)
{
gnutls_datum_t gtxt;
@@ -221,10 +221,10 @@ mac_deinit (mac_hd_t td, opaque * res, int ver)
inline static int
calc_enc_length (gnutls_session_t session, int data_size,
- int hash_size, uint8 * pad, int random_pad,
+ int hash_size, uint8_t * pad, int random_pad,
cipher_type_t block_algo, uint16 blocksize)
{
- uint8 rnd;
+ uint8_t rnd;
int length;
*pad = 0;
@@ -260,7 +260,7 @@ calc_enc_length (gnutls_session_t session, int data_size,
length = data_size + hash_size;
- *pad = (uint8) (blocksize - (length % blocksize)) + rnd;
+ *pad = (uint8_t) (blocksize - (length % blocksize)) + rnd;
length += *pad;
if (session->security_parameters.version >= GNUTLS_TLS1_1)
@@ -286,13 +286,13 @@ _gnutls_compressed2ciphertext (gnutls_session_t session,
gnutls_datum_t compressed,
content_type_t _type, int random_pad)
{
- uint8 MAC[MAX_HASH_SIZE];
+ uint8_t MAC[MAX_HASH_SIZE];
uint16 c_length;
- uint8 pad;
+ uint8_t pad;
int length, ret;
mac_hd_t td;
- uint8 type = _type;
- uint8 major, minor;
+ uint8_t type = _type;
+ uint8_t major, minor;
int hash_size =
_gnutls_hash_get_algo_len (session->security_parameters.
write_mac_algorithm);
@@ -410,16 +410,16 @@ int
_gnutls_ciphertext2compressed (gnutls_session_t session,
opaque * compress_data,
int compress_size,
- gnutls_datum_t ciphertext, uint8 type)
+ gnutls_datum_t ciphertext, uint8_t type)
{
- uint8 MAC[MAX_HASH_SIZE];
+ uint8_t MAC[MAX_HASH_SIZE];
uint16 c_length;
- uint8 pad;
+ uint8_t pad;
int length;
mac_hd_t td;
uint16 blocksize;
int ret, i, pad_failed = 0;
- uint8 major, minor;
+ uint8_t major, minor;
gnutls_protocol_t ver;
int hash_size =
_gnutls_hash_get_algo_len (session->security_parameters.
diff --git a/lib/gnutls_cipher.h b/lib/gnutls_cipher.h
index 9caf440497..47691a72bc 100644
--- a/lib/gnutls_cipher.h
+++ b/lib/gnutls_cipher.h
@@ -29,7 +29,7 @@ int _gnutls_encrypt (gnutls_session_t session, const opaque * headers,
int random_pad);
int _gnutls_decrypt (gnutls_session_t session, opaque * ciphertext,
- size_t ciphertext_size, uint8 * data, size_t data_size,
+ size_t ciphertext_size, uint8_t * data, size_t data_size,
content_type_t type);
int _gnutls_compressed2ciphertext (gnutls_session_t session,
opaque * cipher_data, int cipher_size,
@@ -38,4 +38,4 @@ int _gnutls_compressed2ciphertext (gnutls_session_t session,
int _gnutls_ciphertext2compressed (gnutls_session_t session,
opaque * compress_data,
int compress_size,
- gnutls_datum_t ciphertext, uint8 type);
+ gnutls_datum_t ciphertext, uint8_t type);
diff --git a/lib/gnutls_datum.c b/lib/gnutls_datum.c
index 367e0d2a2a..46a60da5c3 100644
--- a/lib/gnutls_datum.c
+++ b/lib/gnutls_datum.c
@@ -60,7 +60,7 @@ _gnutls_write_datum32 (opaque * dest, gnutls_datum_t dat)
void
_gnutls_write_datum8 (opaque * dest, gnutls_datum_t dat)
{
- dest[0] = (uint8) dat.size;
+ dest[0] = (uint8_t) dat.size;
if (dat.data != NULL)
memcpy (&dest[1], dat.data, dat.size);
}
diff --git a/lib/gnutls_db.c b/lib/gnutls_db.c
index 75be69303d..0e2abaf122 100644
--- a/lib/gnutls_db.c
+++ b/lib/gnutls_db.c
@@ -225,7 +225,7 @@ _gnutls_db_func_is_ok (gnutls_session_t session)
int
_gnutls_server_restore_session (gnutls_session_t session,
- uint8 * session_id, int session_id_size)
+ uint8_t * session_id, int session_id_size)
{
gnutls_datum_t data;
gnutls_datum_t key;
@@ -262,7 +262,7 @@ _gnutls_server_restore_session (gnutls_session_t session,
}
int
-_gnutls_db_remove_session (gnutls_session_t session, uint8 * session_id,
+_gnutls_db_remove_session (gnutls_session_t session, uint8_t * session_id,
int session_id_size)
{
gnutls_datum_t key;
diff --git a/lib/gnutls_db.h b/lib/gnutls_db.h
index aed508942e..342886a47a 100644
--- a/lib/gnutls_db.h
+++ b/lib/gnutls_db.h
@@ -24,8 +24,8 @@
int _gnutls_server_register_current_session (gnutls_session_t session);
int _gnutls_server_restore_session (gnutls_session_t session,
- uint8 * session_id, int session_id_size);
-int _gnutls_db_remove_session (gnutls_session_t session, uint8 * session_id,
+ uint8_t * session_id, int session_id_size);
+int _gnutls_db_remove_session (gnutls_session_t session, uint8_t * session_id,
int session_id_size);
int _gnutls_store_session (gnutls_session_t session,
gnutls_datum_t session_id,
diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c
index 1b0c2800cf..cdf51ff35f 100644
--- a/lib/gnutls_handshake.c
+++ b/lib/gnutls_handshake.c
@@ -125,13 +125,13 @@ resume_copy_required_values (gnutls_session_t session)
}
void
-_gnutls_set_server_random (gnutls_session_t session, uint8 * rnd)
+_gnutls_set_server_random (gnutls_session_t session, uint8_t * rnd)
{
memcpy (session->security_parameters.server_random, rnd, TLS_RANDOM_SIZE);
}
void
-_gnutls_set_client_random (gnutls_session_t session, uint8 * rnd)
+_gnutls_set_client_random (gnutls_session_t session, uint8_t * rnd)
{
memcpy (session->security_parameters.client_random, rnd, TLS_RANDOM_SIZE);
}
@@ -269,7 +269,7 @@ int
_gnutls_read_client_hello (gnutls_session_t session, opaque * data,
int datalen)
{
- uint8 session_id_len, z;
+ uint8_t session_id_len, z;
int pos = 0, ret;
uint16 suite_size;
gnutls_protocol_t version;
@@ -445,7 +445,7 @@ _gnutls_handshake_hash_pending (gnutls_session_t session)
int
_gnutls_send_finished (gnutls_session_t session, int again)
{
- uint8 data[36];
+ uint8_t data[36];
int ret;
int data_size = 0;
@@ -498,7 +498,7 @@ _gnutls_send_finished (gnutls_session_t session, int again)
int
_gnutls_recv_finished (gnutls_session_t session)
{
- uint8 data[36], *vrfy;
+ uint8_t data[36], *vrfy;
int data_size;
int ret;
int vrfysize;
@@ -734,7 +734,7 @@ _gnutls_server_select_comp_method (gnutls_session_t session,
opaque * data, int datalen)
{
int x, i, j;
- uint8 *comps;
+ uint8_t *comps;
x = _gnutls_supported_compression_methods (session, &comps);
if (x < 0)
@@ -837,7 +837,7 @@ _gnutls_send_handshake (gnutls_session_t session, void *i_data,
gnutls_handshake_description_t type)
{
int ret;
- uint8 *data;
+ uint8_t *data;
uint32 datasize;
int pos = 0;
@@ -866,7 +866,7 @@ _gnutls_send_handshake (gnutls_session_t session, void *i_data,
return GNUTLS_E_MEMORY_ERROR;
}
- data[pos++] = (uint8) type;
+ data[pos++] = (uint8_t) type;
_gnutls_write_uint24 (i_datasize, &data[pos]);
pos += 3;
@@ -913,7 +913,7 @@ _gnutls_recv_handshake_header (gnutls_session_t session,
{
int ret;
uint32 length32 = 0;
- uint8 *dataptr = NULL; /* for realloc */
+ uint8_t *dataptr = NULL; /* for realloc */
size_t handshake_header_size = HANDSHAKE_HEADER_SIZE;
/* if we have data into the buffer then return them, do not read the next packet.
@@ -1089,7 +1089,7 @@ _gnutls_handshake_hash_add_recvd (gnutls_session_t session,
* passed to _gnutls_recv_hello().
*/
int
-_gnutls_recv_handshake (gnutls_session_t session, uint8 ** data,
+_gnutls_recv_handshake (gnutls_session_t session, uint8_t ** data,
int *datalen, gnutls_handshake_description_t type,
Optional optional)
{
@@ -1225,7 +1225,7 @@ _gnutls_recv_handshake (gnutls_session_t session, uint8 ** data,
static int
_gnutls_client_set_ciphersuite (gnutls_session_t session, opaque suite[2])
{
- uint8 z;
+ uint8_t z;
cipher_suite_st *cipher_suites;
int cipher_suite_num;
int i, err;
@@ -1306,7 +1306,7 @@ static int
_gnutls_client_set_comp_method (gnutls_session_t session, opaque comp_method)
{
int comp_methods_num;
- uint8 *compression_methods;
+ uint8_t *compression_methods;
int i;
comp_methods_num = _gnutls_supported_compression_methods (session,
@@ -1396,7 +1396,7 @@ static int
_gnutls_read_server_hello (gnutls_session_t session,
opaque * data, int datalen)
{
- uint8 session_id_len = 0;
+ uint8_t session_id_len = 0;
int pos = 0;
int ret = 0;
gnutls_protocol_t version;
@@ -1570,7 +1570,7 @@ _gnutls_copy_comp_methods (gnutls_session_t session,
opaque * ret_data, size_t ret_data_size)
{
int ret, i;
- uint8 *compression_methods, comp_num;
+ uint8_t *compression_methods, comp_num;
int datalen, pos;
ret = _gnutls_supported_compression_methods (session, &compression_methods);
@@ -1623,7 +1623,7 @@ _gnutls_send_client_hello (gnutls_session_t session, int again)
opaque *SessionID =
session->internals.resumed_security_parameters.session_id;
- uint8 session_id_len =
+ uint8_t session_id_len =
session->internals.resumed_security_parameters.session_id_size;
if (SessionID == NULL)
@@ -1802,9 +1802,9 @@ _gnutls_send_server_hello (gnutls_session_t session, int again)
int extdatalen;
int pos = 0;
int datalen, ret = 0;
- uint8 comp;
+ uint8_t comp;
opaque *SessionID = session->security_parameters.session_id;
- uint8 session_id_len = session->security_parameters.session_id_size;
+ uint8_t session_id_len = session->security_parameters.session_id_size;
opaque buf[2 * TLS_MAX_SESSION_ID_SIZE + 1];
if (SessionID == NULL)
@@ -1886,7 +1886,7 @@ _gnutls_send_server_hello (gnutls_session_t session, int again)
pos += 2;
comp =
- (uint8) _gnutls_compression_get_num (session->
+ (uint8_t) _gnutls_compression_get_num (session->
internals.compression_method);
data[pos++] = comp;
@@ -2340,7 +2340,7 @@ static int
_gnutls_recv_handshake_final (gnutls_session_t session, int init)
{
int ret = 0;
- uint8 ch;
+ uint8_t ch;
switch (STATE)
{
@@ -2528,7 +2528,7 @@ restart:
}
int
-_gnutls_generate_session_id (opaque * session_id, uint8 * len)
+_gnutls_generate_session_id (opaque * session_id, uint8_t * len)
{
*len = TLS_MAX_SESSION_ID_SIZE;
@@ -2545,7 +2545,7 @@ int
_gnutls_recv_hello_request (gnutls_session_t session, void *data,
uint32 data_size)
{
- uint8 type;
+ uint8_t type;
if (session->security_parameters.entity == GNUTLS_SERVER)
{
@@ -2557,7 +2557,7 @@ _gnutls_recv_hello_request (gnutls_session_t session, void *data,
gnutls_assert ();
return GNUTLS_E_UNEXPECTED_PACKET_LENGTH;
}
- type = ((uint8 *) data)[0];
+ type = ((uint8_t *) data)[0];
if (type == GNUTLS_HANDSHAKE_HELLO_REQUEST)
return GNUTLS_E_REHANDSHAKE;
else
diff --git a/lib/gnutls_handshake.h b/lib/gnutls_handshake.h
index 3067084b86..5fd1ac937b 100644
--- a/lib/gnutls_handshake.h
+++ b/lib/gnutls_handshake.h
@@ -32,15 +32,15 @@ int _gnutls_recv_hello_request (gnutls_session_t session, void *data,
uint32 data_size);
int _gnutls_send_hello (gnutls_session_t session, int again);
int _gnutls_recv_hello (gnutls_session_t session, opaque * data, int datalen);
-int _gnutls_recv_handshake (gnutls_session_t session, uint8 **, int *,
+int _gnutls_recv_handshake (gnutls_session_t session, uint8_t **, int *,
gnutls_handshake_description_t,
Optional optional);
-int _gnutls_generate_session_id (opaque * session_id, uint8 * len);
+int _gnutls_generate_session_id (opaque * session_id, uint8_t * len);
int _gnutls_handshake_common (gnutls_session_t session);
int _gnutls_handshake_client (gnutls_session_t session);
int _gnutls_handshake_server (gnutls_session_t session);
-void _gnutls_set_server_random (gnutls_session_t session, uint8 * rnd);
-void _gnutls_set_client_random (gnutls_session_t session, uint8 * rnd);
+void _gnutls_set_server_random (gnutls_session_t session, uint8_t * rnd);
+void _gnutls_set_client_random (gnutls_session_t session, uint8_t * rnd);
int _gnutls_tls_create_random (opaque * dst);
int _gnutls_remove_unwanted_ciphersuites (gnutls_session_t session,
cipher_suite_st ** cipherSuites,
diff --git a/lib/gnutls_int.h b/lib/gnutls_int.h
index 1380242434..4c1216664b 100644
--- a/lib/gnutls_int.h
+++ b/lib/gnutls_int.h
@@ -209,7 +209,7 @@ struct gnutls_key_st
gnutls_credentials_type_t auth_info_type;
int auth_info_size; /* needed in order to store to db for restoring
*/
- uint8 crypt_algo;
+ uint8_t crypt_algo;
auth_cred_st *cred; /* used to specify keys/certificates etc */
@@ -235,7 +235,7 @@ typedef struct gnutls_key_st *gnutls_key_st;
typedef struct
{
- uint8 suite[2];
+ uint8_t suite[2];
} cipher_suite_st;
/* This structure holds parameters got from TLS extension
@@ -303,7 +303,7 @@ typedef struct
opaque client_random[TLS_RANDOM_SIZE];
opaque server_random[TLS_RANDOM_SIZE];
opaque session_id[TLS_MAX_SESSION_ID_SIZE];
- uint8 session_id_size;
+ uint8_t session_id_size;
time_t timestamp;
tls_ext_st extensions;
@@ -475,8 +475,8 @@ typedef struct
* This is obtained by the Handshake Client Hello
* message. (some implementations read the Record version)
*/
- uint8 adv_version_major;
- uint8 adv_version_minor;
+ uint8_t adv_version_major;
+ uint8_t adv_version_minor;
/* if this is non zero a certificate request message
* will be sent to the client. - only if the ciphersuite
diff --git a/lib/gnutls_kx.c b/lib/gnutls_kx.c
index 82e11b8242..e990d3ac22 100644
--- a/lib/gnutls_kx.c
+++ b/lib/gnutls_kx.c
@@ -117,7 +117,7 @@ generate_normal_master (gnutls_session_t session, int keep_premaster)
int
_gnutls_send_server_kx_message (gnutls_session_t session, int again)
{
- uint8 *data = NULL;
+ uint8_t *data = NULL;
int data_size = 0;
int ret = 0;
@@ -165,7 +165,7 @@ _gnutls_send_server_kx_message (gnutls_session_t session, int again)
int
_gnutls_send_server_certificate_request (gnutls_session_t session, int again)
{
- uint8 *data = NULL;
+ uint8_t *data = NULL;
int data_size = 0;
int ret = 0;
@@ -211,7 +211,7 @@ _gnutls_send_server_certificate_request (gnutls_session_t session, int again)
int
_gnutls_send_client_kx_message (gnutls_session_t session, int again)
{
- uint8 *data;
+ uint8_t *data;
int data_size;
int ret = 0;
@@ -254,7 +254,7 @@ _gnutls_send_client_kx_message (gnutls_session_t session, int again)
int
_gnutls_send_client_certificate_verify (gnutls_session_t session, int again)
{
- uint8 *data;
+ uint8_t *data;
int ret = 0;
int data_size;
@@ -305,7 +305,7 @@ _gnutls_send_client_certificate_verify (gnutls_session_t session, int again)
int
_gnutls_recv_server_kx_message (gnutls_session_t session)
{
- uint8 *data = NULL;
+ uint8_t *data = NULL;
int datasize;
int ret = 0;
@@ -350,7 +350,7 @@ _gnutls_recv_server_kx_message (gnutls_session_t session)
int
_gnutls_recv_server_certificate_request (gnutls_session_t session)
{
- uint8 *data;
+ uint8_t *data;
int datasize;
int ret = 0;
@@ -383,7 +383,7 @@ _gnutls_recv_server_certificate_request (gnutls_session_t session)
int
_gnutls_recv_client_kx_message (gnutls_session_t session)
{
- uint8 *data;
+ uint8_t *data;
int datasize;
int ret = 0;
@@ -418,7 +418,7 @@ _gnutls_recv_client_kx_message (gnutls_session_t session)
int
_gnutls_send_client_certificate (gnutls_session_t session, int again)
{
- uint8 *data = NULL;
+ uint8_t *data = NULL;
int data_size = 0;
int ret = 0;
@@ -488,7 +488,7 @@ _gnutls_send_client_certificate (gnutls_session_t session, int again)
int
_gnutls_send_server_certificate (gnutls_session_t session, int again)
{
- uint8 *data = NULL;
+ uint8_t *data = NULL;
int data_size = 0;
int ret = 0;
@@ -664,7 +664,7 @@ _gnutls_recv_server_certificate (gnutls_session_t session)
int
_gnutls_recv_client_certificate_verify_message (gnutls_session_t session)
{
- uint8 *data;
+ uint8_t *data;
int datasize;
int ret = 0;
diff --git a/lib/gnutls_num.c b/lib/gnutls_num.c
index a59b3dcc84..7ad9eb9a4b 100644
--- a/lib/gnutls_num.c
+++ b/lib/gnutls_num.c
@@ -64,9 +64,9 @@ _gnutls_uint24touint32 (uint24 num)
{
uint32 ret = 0;
- ((uint8 *) & ret)[1] = num.pint[0];
- ((uint8 *) & ret)[2] = num.pint[1];
- ((uint8 *) & ret)[3] = num.pint[2];
+ ((uint8_t *) & ret)[1] = num.pint[0];
+ ((uint8_t *) & ret)[2] = num.pint[1];
+ ((uint8_t *) & ret)[3] = num.pint[2];
return ret;
}
@@ -75,9 +75,9 @@ _gnutls_uint32touint24 (uint32 num)
{
uint24 ret;
- ret.pint[0] = ((uint8 *) & num)[1];
- ret.pint[1] = ((uint8 *) & num)[2];
- ret.pint[2] = ((uint8 *) & num)[3];
+ ret.pint[0] = ((uint8_t *) & num)[1];
+ ret.pint[1] = ((uint8_t *) & num)[2];
+ ret.pint[2] = ((uint8_t *) & num)[3];
return ret;
}
diff --git a/lib/gnutls_record.c b/lib/gnutls_record.c
index 9e2faf965c..cb4d005511 100644
--- a/lib/gnutls_record.c
+++ b/lib/gnutls_record.c
@@ -309,12 +309,12 @@ _gnutls_send_int (gnutls_session_t session, content_type_t type,
gnutls_handshake_description_t htype, const void *_data,
size_t sizeofdata)
{
- uint8 *cipher;
+ uint8_t *cipher;
int cipher_size;
int retval, ret;
int data2send_size;
- uint8 headers[5];
- const uint8 *data = _data;
+ uint8_t headers[5];
+ const uint8_t *data = _data;
int erecord_size = 0;
opaque *erecord = NULL;
@@ -530,7 +530,7 @@ check_buffers (gnutls_session_t session, content_type_t type,
*/
static int
record_check_headers (gnutls_session_t session,
- uint8 headers[RECORD_HEADER_SIZE], content_type_t type,
+ uint8_t headers[RECORD_HEADER_SIZE], content_type_t type,
gnutls_handshake_description_t htype,
/*output */ content_type_t * recv_type,
opaque version[2], uint16 * length,
@@ -803,11 +803,11 @@ _gnutls_recv_int (gnutls_session_t session, content_type_t type,
gnutls_datum_t tmp;
int decrypted_length;
opaque version[2];
- uint8 *headers;
+ uint8_t *headers;
content_type_t recv_type;
uint16 length;
- uint8 *ciphertext;
- uint8 *recv_data;
+ uint8_t *ciphertext;
+ uint8_t *recv_data;
int ret, ret2;
uint16 header_size;
int empty_packet = 0;
diff --git a/lib/x509/extensions.c b/lib/x509/extensions.c
index 2961ce6914..2d9ac2ca68 100644
--- a/lib/x509/extensions.c
+++ b/lib/x509/extensions.c
@@ -460,7 +460,7 @@ _gnutls_x509_ext_extract_keyUsage (uint16 * keyUsage,
{
ASN1_TYPE ext = ASN1_TYPE_EMPTY;
int len, result;
- uint8 str[2];
+ uint8_t str[2];
str[0] = str[1] = 0;
*keyUsage = 0;
@@ -600,7 +600,7 @@ _gnutls_x509_ext_gen_keyUsage (uint16 usage, gnutls_datum_t * der_ext)
{
ASN1_TYPE ext = ASN1_TYPE_EMPTY;
int result;
- uint8 str[2];
+ uint8_t str[2];
result = asn1_create_element (_gnutls_get_pkix (), "PKIX1.KeyUsage", &ext);
if (result != ASN1_SUCCESS)
@@ -835,7 +835,7 @@ _gnutls_x509_ext_gen_crl_dist_points (gnutls_x509_subject_alt_name_t
ASN1_TYPE ext = ASN1_TYPE_EMPTY;
gnutls_datum_t gnames = { NULL, 0 };
int result;
- uint8 reasons[2];
+ uint8_t reasons[2];
reasons[0] = reason_flags & 0xff;
reasons[1] = reason_flags >> 8;
diff --git a/lib/x509/pkcs12.c b/lib/x509/pkcs12.c
index 57fd6985b1..c2c04a0544 100644
--- a/lib/x509/pkcs12.c
+++ b/lib/x509/pkcs12.c
@@ -682,7 +682,7 @@ cleanup:
static int
create_empty_pfx (ASN1_TYPE pkcs12)
{
- uint8 three = 3;
+ uint8_t three = 3;
int result;
ASN1_TYPE c2 = ASN1_TYPE_EMPTY;
diff --git a/lib/x509/pkcs7.c b/lib/x509/pkcs7.c
index a73d1909bc..2081e4cb72 100644
--- a/lib/x509/pkcs7.c
+++ b/lib/x509/pkcs7.c
@@ -452,7 +452,7 @@ gnutls_pkcs7_export (gnutls_pkcs7_t pkcs7,
static int
create_empty_signed_data (ASN1_TYPE pkcs7, ASN1_TYPE * sdata)
{
- uint8 one = 1;
+ uint8_t one = 1;
int result;
*sdata = ASN1_TYPE_EMPTY;
diff --git a/lib/x509/x509.c b/lib/x509/x509.c
index 3d25d74fb4..e3fd3d0ca0 100644
--- a/lib/x509/x509.c
+++ b/lib/x509/x509.c
@@ -1702,7 +1702,7 @@ gnutls_x509_crt_get_crl_dist_points (gnutls_x509_crt_t cert,
int len;
char num[MAX_INT_DIGITS];
gnutls_x509_subject_alt_name_t type;
- uint8 reasons[2];
+ uint8_t reasons[2];
if (cert == NULL)
{
diff --git a/lib/x509_b64.c b/lib/x509_b64.c
index 0e636ca528..326c0a28d0 100644
--- a/lib/x509_b64.c
+++ b/lib/x509_b64.c
@@ -30,10 +30,10 @@
#include <gnutls_datum.h>
#include <x509_b64.h>
-static const uint8 b64table[] =
+static const uint8_t b64table[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-static const uint8 asciitable[128] = {
+static const uint8_t asciitable[128] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
@@ -59,7 +59,7 @@ static const uint8 asciitable[128] = {
};
inline static int
-encode (char *result, const uint8 * data, int left)
+encode (char *result, const uint8_t * data, int left)
{
int data_len;
@@ -107,9 +107,9 @@ encode (char *result, const uint8 * data, int left)
*/
#define TOASCII(c) (c < 127 ? asciitable[c] : 0xff)
inline static int
-decode (uint8 * result, const opaque * data)
+decode (uint8_t * result, const opaque * data)
{
- uint8 a1, a2;
+ uint8_t a1, a2;
int ret = 3;
a1 = TOASCII (data[0]);
@@ -142,7 +142,7 @@ decode (uint8 * result, const opaque * data)
* The result_size is the return value
*/
int
-_gnutls_base64_encode (const uint8 * data, size_t data_size, uint8 ** result)
+_gnutls_base64_encode (const uint8_t * data, size_t data_size, uint8_t ** result)
{
unsigned int i, j;
int ret, tmp;
@@ -183,14 +183,14 @@ _gnutls_base64_encode (const uint8 * data, size_t data_size, uint8 ** result)
* The result_size (including the null terminator) is the return value.
*/
int
-_gnutls_fbase64_encode (const char *msg, const uint8 * data,
- int data_size, uint8 ** result)
+_gnutls_fbase64_encode (const char *msg, const uint8_t * data,
+ int data_size, uint8_t ** result)
{
int i, ret, tmp, j;
char tmpres[4];
- uint8 *ptr;
- uint8 top[80];
- uint8 bottom[80];
+ uint8_t *ptr;
+ uint8_t top[80];
+ uint8_t bottom[80];
int pos, bytes, top_len, bottom_len;
size_t msglen = strlen (msg);
@@ -365,11 +365,11 @@ gnutls_pem_base64_encode_alloc (const char *msg,
* The result_size is the return value
*/
int
-_gnutls_base64_decode (const uint8 * data, size_t data_size, uint8 ** result)
+_gnutls_base64_decode (const uint8_t * data, size_t data_size, uint8_t ** result)
{
unsigned int i, j;
int ret, tmp, est;
- uint8 tmpres[3];
+ uint8_t tmpres[3];
est = ((data_size * 3) / 4) + 1;
(*result) = gnutls_malloc (est);
@@ -396,7 +396,7 @@ _gnutls_base64_decode (const uint8 * data, size_t data_size, uint8 ** result)
* returns the size of the data copied.
*/
inline static int
-cpydata (const uint8 * data, int data_size, uint8 ** result)
+cpydata (const uint8_t * data, int data_size, uint8_t ** result)
{
int i, j;
@@ -423,14 +423,14 @@ cpydata (const uint8 * data, int data_size, uint8 ** result)
#define ENDSTR2 "-----\r"
int
_gnutls_fbase64_decode (const char *header, const opaque * data,
- size_t data_size, uint8 ** result)
+ size_t data_size, uint8_t ** result)
{
int ret;
static const char top[] = "-----BEGIN ";
static const char bottom[] = "\n-----END ";
- uint8 *rdata;
+ uint8_t *rdata;
int rdata_size;
- uint8 *kdata;
+ uint8_t *kdata;
int kdata_size;
char pem_header[128];
diff --git a/lib/x509_b64.h b/lib/x509_b64.h
index d104deddf8..bbebacd7aa 100644
--- a/lib/x509_b64.h
+++ b/lib/x509_b64.h
@@ -22,14 +22,14 @@
*
*/
-int _gnutls_base64_encode (const uint8 * data, size_t data_size,
- uint8 ** result);
-int _gnutls_fbase64_encode (const char *msg, const uint8 * data,
- int data_size, uint8 ** result);
-int _gnutls_base64_decode (const uint8 * data, size_t data_size,
- uint8 ** result);
-int _gnutls_fbase64_decode (const char *header, const uint8 * data,
- size_t data_size, uint8 ** result);
+int _gnutls_base64_encode (const uint8_t * data, size_t data_size,
+ uint8_t ** result);
+int _gnutls_fbase64_encode (const char *msg, const uint8_t * data,
+ int data_size, uint8_t ** result);
+int _gnutls_base64_decode (const uint8_t * data, size_t data_size,
+ uint8_t ** result);
+int _gnutls_fbase64_decode (const char *header, const uint8_t * data,
+ size_t data_size, uint8_t ** result);
#define B64SIZE( data_size) ((data_size%3==0)?((data_size*4)/3):(4+((data_size/3)*4)))