Use standard unsigned integer types

This commit is contained in:
Andreas Steffen
2016-03-24 18:52:48 +01:00
parent b210369314
commit b12c53ce77
584 changed files with 3430 additions and 3430 deletions
+2 -2
View File
@@ -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;
+3 -3
View File
@@ -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;
+8 -8
View File
@@ -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);
+2 -2
View File
@@ -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.
+8 -8
View File
@@ -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;
+8 -8
View File
@@ -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;
+6 -6
View File
@@ -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;
+3 -3
View File
@@ -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) ||
+3 -3
View File
@@ -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;
+5 -5
View File
@@ -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)
{
+2 -2
View File
@@ -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
+4 -4
View File
@@ -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 */