aboutsummaryrefslogtreecommitdiffstats
path: root/src/libtls
diff options
context:
space:
mode:
Diffstat (limited to 'src/libtls')
-rw-r--r--src/libtls/tests/suites/test_socket.c4
-rw-r--r--src/libtls/tls.c6
-rw-r--r--src/libtls/tls_aead.c16
-rw-r--r--src/libtls/tls_aead.h4
-rw-r--r--src/libtls/tls_aead_expl.c16
-rw-r--r--src/libtls/tls_aead_impl.c16
-rw-r--r--src/libtls/tls_aead_null.c12
-rw-r--r--src/libtls/tls_crypto.c6
-rw-r--r--src/libtls/tls_fragmentation.c6
-rw-r--r--src/libtls/tls_peer.c10
-rw-r--r--src/libtls/tls_protection.c4
-rw-r--r--src/libtls/tls_server.c8
12 files changed, 54 insertions, 54 deletions
diff --git a/src/libtls/tests/suites/test_socket.c b/src/libtls/tests/suites/test_socket.c
index 42a4607b7..d105dd372 100644
--- a/src/libtls/tests/suites/test_socket.c
+++ b/src/libtls/tests/suites/test_socket.c
@@ -267,7 +267,7 @@ END_TEARDOWN
*/
typedef struct {
tls_version_t version;
- u_int16_t port;
+ uint16_t port;
char *addr;
chunk_t data;
int fd;
@@ -411,7 +411,7 @@ static void run_echo_client(echo_server_config_t *config)
/**
* Common test wrapper function for different test variants
*/
-static void test_tls(tls_version_t version, u_int16_t port, bool cauth, u_int i)
+static void test_tls(tls_version_t version, uint16_t port, bool cauth, u_int i)
{
echo_server_config_t *config;
tls_cipher_suite_t *suites;
diff --git a/src/libtls/tls.c b/src/libtls/tls.c
index 08a06f5ef..ea39f7fd1 100644
--- a/src/libtls/tls.c
+++ b/src/libtls/tls.c
@@ -83,9 +83,9 @@ ENUM_END(tls_extension_names, TLS_EXT_RENEGOTIATION_INFO);
* TLS record
*/
typedef struct __attribute__((packed)) {
- u_int8_t type;
- u_int16_t version;
- u_int16_t length;
+ uint8_t type;
+ uint16_t version;
+ uint16_t length;
char data[];
} tls_record_t;
diff --git a/src/libtls/tls_aead.c b/src/libtls/tls_aead.c
index 67cfd3a75..f1daa6f45 100644
--- a/src/libtls/tls_aead.c
+++ b/src/libtls/tls_aead.c
@@ -44,18 +44,18 @@ struct private_tls_aead_t {
* Associated header data to create signature over
*/
typedef struct __attribute__((__packed__)) {
- u_int64_t seq;
- u_int8_t type;
- u_int16_t version;
- u_int16_t length;
+ uint64_t seq;
+ uint8_t type;
+ uint16_t version;
+ uint16_t length;
} sigheader_t;
METHOD(tls_aead_t, encrypt, bool,
private_tls_aead_t *this, tls_version_t version, tls_content_type_t type,
- u_int64_t seq, chunk_t *data)
+ uint64_t seq, chunk_t *data)
{
chunk_t assoc, encrypted, iv, plain;
- u_int8_t icvlen;
+ uint8_t icvlen;
sigheader_t hdr;
iv_gen_t *gen;
@@ -92,10 +92,10 @@ METHOD(tls_aead_t, encrypt, bool,
METHOD(tls_aead_t, decrypt, bool,
private_tls_aead_t *this, tls_version_t version, tls_content_type_t type,
- u_int64_t seq, chunk_t *data)
+ uint64_t seq, chunk_t *data)
{
chunk_t assoc, iv;
- u_int8_t icvlen;
+ uint8_t icvlen;
sigheader_t hdr;
iv.len = this->aead->get_iv_size(this->aead);
diff --git a/src/libtls/tls_aead.h b/src/libtls/tls_aead.h
index 1d5ba92b5..8b5cda5a7 100644
--- a/src/libtls/tls_aead.h
+++ b/src/libtls/tls_aead.h
@@ -50,7 +50,7 @@ struct tls_aead_t {
* @return TRUE if successfully encrypted
*/
bool (*encrypt)(tls_aead_t *this, tls_version_t version,
- tls_content_type_t type, u_int64_t seq, chunk_t *data);
+ tls_content_type_t type, uint64_t seq, chunk_t *data);
/**
* Decrypt and verify a TLS record.
@@ -65,7 +65,7 @@ struct tls_aead_t {
* @return TRUE if successfully decrypted
*/
bool (*decrypt)(tls_aead_t *this, tls_version_t version,
- tls_content_type_t type, u_int64_t seq, chunk_t *data);
+ tls_content_type_t type, uint64_t seq, chunk_t *data);
/**
* Get the authentication key size.
diff --git a/src/libtls/tls_aead_expl.c b/src/libtls/tls_aead_expl.c
index 80b0db38c..201c9bcf8 100644
--- a/src/libtls/tls_aead_expl.c
+++ b/src/libtls/tls_aead_expl.c
@@ -49,18 +49,18 @@ struct private_tls_aead_t {
* Associated header data to create signature over
*/
typedef struct __attribute__((__packed__)) {
- u_int64_t seq;
- u_int8_t type;
- u_int16_t version;
- u_int16_t length;
+ uint64_t seq;
+ uint8_t type;
+ uint16_t version;
+ uint16_t length;
} sigheader_t;
METHOD(tls_aead_t, encrypt, bool,
private_tls_aead_t *this, tls_version_t version, tls_content_type_t type,
- u_int64_t seq, chunk_t *data)
+ uint64_t seq, chunk_t *data)
{
chunk_t assoc, mac, padding, iv;
- u_int8_t bs, padlen;
+ uint8_t bs, padlen;
sigheader_t hdr;
hdr.type = type;
@@ -100,10 +100,10 @@ METHOD(tls_aead_t, encrypt, bool,
METHOD(tls_aead_t, decrypt, bool,
private_tls_aead_t *this, tls_version_t version, tls_content_type_t type,
- u_int64_t seq, chunk_t *data)
+ uint64_t seq, chunk_t *data)
{
chunk_t assoc, mac, iv;
- u_int8_t bs, padlen;
+ uint8_t bs, padlen;
sigheader_t hdr;
size_t i;
diff --git a/src/libtls/tls_aead_impl.c b/src/libtls/tls_aead_impl.c
index d529ceba7..8f83cb456 100644
--- a/src/libtls/tls_aead_impl.c
+++ b/src/libtls/tls_aead_impl.c
@@ -47,18 +47,18 @@ struct private_tls_aead_t {
* Associated header data to create signature over
*/
typedef struct __attribute__((__packed__)) {
- u_int64_t seq;
- u_int8_t type;
- u_int16_t version;
- u_int16_t length;
+ uint64_t seq;
+ uint8_t type;
+ uint16_t version;
+ uint16_t length;
} sigheader_t;
METHOD(tls_aead_t, encrypt, bool,
private_tls_aead_t *this, tls_version_t version,
- tls_content_type_t type, u_int64_t seq, chunk_t *data)
+ tls_content_type_t type, uint64_t seq, chunk_t *data)
{
chunk_t assoc, mac, padding;
- u_int8_t bs, padlen;
+ uint8_t bs, padlen;
sigheader_t hdr;
hdr.type = type;
@@ -95,10 +95,10 @@ METHOD(tls_aead_t, encrypt, bool,
METHOD(tls_aead_t, decrypt, bool,
private_tls_aead_t *this, tls_version_t version,
- tls_content_type_t type, u_int64_t seq, chunk_t *data)
+ tls_content_type_t type, uint64_t seq, chunk_t *data)
{
chunk_t assoc, mac, iv;
- u_int8_t bs, padlen;
+ uint8_t bs, padlen;
sigheader_t hdr;
size_t i;
diff --git a/src/libtls/tls_aead_null.c b/src/libtls/tls_aead_null.c
index 595b64000..cb4c10633 100644
--- a/src/libtls/tls_aead_null.c
+++ b/src/libtls/tls_aead_null.c
@@ -37,15 +37,15 @@ struct private_tls_aead_t {
* Associated header data to create signature over
*/
typedef struct __attribute__((__packed__)) {
- u_int64_t seq;
- u_int8_t type;
- u_int16_t version;
- u_int16_t length;
+ uint64_t seq;
+ uint8_t type;
+ uint16_t version;
+ uint16_t length;
} sigheader_t;
METHOD(tls_aead_t, encrypt, bool,
private_tls_aead_t *this, tls_version_t version,
- tls_content_type_t type, u_int64_t seq, chunk_t *data)
+ tls_content_type_t type, uint64_t seq, chunk_t *data)
{
chunk_t assoc, mac;
sigheader_t hdr;
@@ -67,7 +67,7 @@ METHOD(tls_aead_t, encrypt, bool,
METHOD(tls_aead_t, decrypt, bool,
private_tls_aead_t *this, tls_version_t version,
- tls_content_type_t type, u_int64_t seq, chunk_t *data)
+ tls_content_type_t type, uint64_t seq, chunk_t *data)
{
chunk_t assoc, mac;
sigheader_t hdr;
diff --git a/src/libtls/tls_crypto.c b/src/libtls/tls_crypto.c
index 2cffeb820..6bbd95873 100644
--- a/src/libtls/tls_crypto.c
+++ b/src/libtls/tls_crypto.c
@@ -1340,7 +1340,7 @@ METHOD(tls_crypto_t, set_protection, void,
METHOD(tls_crypto_t, append_handshake, void,
private_tls_crypto_t *this, tls_handshake_type_t type, chunk_t data)
{
- u_int32_t header;
+ uint32_t header;
/* reconstruct handshake header */
header = htonl(data.len | (type << 24));
@@ -1407,7 +1407,7 @@ METHOD(tls_crypto_t, sign, bool,
{
signature_scheme_t scheme;
bio_reader_t *reader;
- u_int8_t hash, alg;
+ uint8_t hash, alg;
chunk_t sig;
bool done = FALSE;
@@ -1487,7 +1487,7 @@ METHOD(tls_crypto_t, verify, bool,
if (this->tls->get_version(this->tls) >= TLS_1_2)
{
signature_scheme_t scheme = SIGN_UNKNOWN;
- u_int8_t hash, alg;
+ uint8_t hash, alg;
chunk_t sig;
if (!reader->read_uint8(reader, &hash) ||
diff --git a/src/libtls/tls_fragmentation.c b/src/libtls/tls_fragmentation.c
index a97ca1eaa..3607aa3cb 100644
--- a/src/libtls/tls_fragmentation.c
+++ b/src/libtls/tls_fragmentation.c
@@ -127,7 +127,7 @@ static bool send_close_notify(private_tls_fragmentation_t *this)
static status_t process_alert(private_tls_fragmentation_t *this,
bio_reader_t *reader)
{
- u_int8_t level, description;
+ uint8_t level, description;
if (!reader->read_uint8(reader, &level) ||
!reader->read_uint8(reader, &description))
@@ -147,8 +147,8 @@ static status_t process_handshake(private_tls_fragmentation_t *this,
while (reader->remaining(reader))
{
bio_reader_t *msg;
- u_int8_t type;
- u_int32_t len;
+ uint8_t type;
+ uint32_t len;
status_t status;
chunk_t data;
diff --git a/src/libtls/tls_peer.c b/src/libtls/tls_peer.c
index 8087e2e2d..2ba6dd2a6 100644
--- a/src/libtls/tls_peer.c
+++ b/src/libtls/tls_peer.c
@@ -141,8 +141,8 @@ struct private_tls_peer_t {
static status_t process_server_hello(private_tls_peer_t *this,
bio_reader_t *reader)
{
- u_int8_t compression;
- u_int16_t version, cipher;
+ uint8_t compression;
+ uint16_t version, cipher;
chunk_t random, session, ext = chunk_empty;
tls_cipher_suite_t suite = 0;
@@ -434,8 +434,8 @@ static status_t process_ec_key_exchange(private_tls_peer_t *this,
{
diffie_hellman_group_t group;
public_key_t *public;
- u_int8_t type;
- u_int16_t curve;
+ uint8_t type;
+ uint16_t curve;
chunk_t pub, chunk;
chunk = reader->peek(reader);
@@ -833,7 +833,7 @@ static private_key_t *find_private_key(private_tls_peer_t *this)
private_key_t *key = NULL;
bio_reader_t *reader;
key_type_t type;
- u_int8_t cert;
+ uint8_t cert;
if (!this->peer)
{
diff --git a/src/libtls/tls_protection.c b/src/libtls/tls_protection.c
index e73fedc5d..cea3eca14 100644
--- a/src/libtls/tls_protection.c
+++ b/src/libtls/tls_protection.c
@@ -47,12 +47,12 @@ struct private_tls_protection_t {
/**
* Sequence number of incoming records
*/
- u_int64_t seq_in;
+ uint64_t seq_in;
/**
* Sequence number for outgoing records
*/
- u_int64_t seq_out;
+ uint64_t seq_out;
/**
* AEAD transform for inbound traffic
diff --git a/src/libtls/tls_server.c b/src/libtls/tls_server.c
index cfbe02037..422211afa 100644
--- a/src/libtls/tls_server.c
+++ b/src/libtls/tls_server.c
@@ -213,7 +213,7 @@ static bool select_suite_and_key(private_tls_server_t *this,
static status_t process_client_hello(private_tls_server_t *this,
bio_reader_t *reader)
{
- u_int16_t version, extension;
+ uint16_t version, extension;
chunk_t random, session, ciphers, compression, ext = chunk_empty;
bio_reader_t *extensions;
tls_cipher_suite_t *suites;
@@ -304,12 +304,12 @@ static status_t process_client_hello(private_tls_server_t *this,
}
else
{
- count = ciphers.len / sizeof(u_int16_t);
+ count = ciphers.len / sizeof(uint16_t);
suites = alloca(count * sizeof(tls_cipher_suite_t));
DBG2(DBG_TLS, "received %d TLS cipher suites:", count);
for (i = 0; i < count; i++)
{
- suites[i] = untoh16(&ciphers.ptr[i * sizeof(u_int16_t)]);
+ suites[i] = untoh16(&ciphers.ptr[i * sizeof(uint16_t)]);
DBG2(DBG_TLS, " %N", tls_cipher_suite_names, suites[i]);
}
if (!select_suite_and_key(this, suites, count))
@@ -831,7 +831,7 @@ static tls_named_curve_t ec_group_to_curve(private_tls_server_t *this,
bool peer_supports_curve(private_tls_server_t *this, tls_named_curve_t curve)
{
bio_reader_t *reader;
- u_int16_t current;
+ uint16_t current;
if (!this->curves_received)
{ /* none received, assume yes */