aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan')
-rw-r--r--src/libstrongswan/asn1/asn1.c6
-rw-r--r--src/libstrongswan/asn1/asn1.h4
-rw-r--r--src/libstrongswan/bio/bio_reader.c58
-rw-r--r--src/libstrongswan/bio/bio_reader.h26
-rw-r--r--src/libstrongswan/bio/bio_writer.c14
-rw-r--r--src/libstrongswan/bio/bio_writer.h12
-rw-r--r--src/libstrongswan/collections/array.c20
-rw-r--r--src/libstrongswan/collections/array.h2
-rw-r--r--src/libstrongswan/credentials/auth_cfg.h2
-rw-r--r--src/libstrongswan/credentials/containers/pkcs12.c10
-rw-r--r--src/libstrongswan/credentials/containers/pkcs12.h2
-rw-r--r--src/libstrongswan/crypto/hashers/hasher.h2
-rw-r--r--src/libstrongswan/crypto/iv/iv_gen.h6
-rw-r--r--src/libstrongswan/crypto/iv/iv_gen_null.c4
-rw-r--r--src/libstrongswan/crypto/iv/iv_gen_rand.c4
-rw-r--r--src/libstrongswan/crypto/iv/iv_gen_seq.c28
-rw-r--r--src/libstrongswan/crypto/mac.h2
-rw-r--r--src/libstrongswan/crypto/mgf1/mgf1.c2
-rw-r--r--src/libstrongswan/crypto/nonce_gen.h2
-rw-r--r--src/libstrongswan/crypto/pkcs5.c12
-rw-r--r--src/libstrongswan/crypto/prf_plus.c4
-rw-r--r--src/libstrongswan/crypto/prf_plus.h2
-rw-r--r--src/libstrongswan/crypto/prfs/mac_prf.c2
-rw-r--r--src/libstrongswan/crypto/prfs/prf.h2
-rw-r--r--src/libstrongswan/crypto/proposal/proposal_keywords.c2
-rw-r--r--src/libstrongswan/crypto/proposal/proposal_keywords.h8
-rw-r--r--src/libstrongswan/crypto/rngs/rng.c4
-rw-r--r--src/libstrongswan/crypto/rngs/rng.h4
-rw-r--r--src/libstrongswan/crypto/signers/mac_signer.c8
-rw-r--r--src/libstrongswan/crypto/signers/signer.h2
-rw-r--r--src/libstrongswan/eap/eap.h12
-rw-r--r--src/libstrongswan/ipsec/ipsec_types.h20
-rw-r--r--src/libstrongswan/networking/host.c20
-rw-r--r--src/libstrongswan/networking/host.h12
-rw-r--r--src/libstrongswan/networking/packet.c6
-rw-r--r--src/libstrongswan/networking/packet.h4
-rw-r--r--src/libstrongswan/networking/tun_device.c16
-rw-r--r--src/libstrongswan/networking/tun_device.h4
-rw-r--r--src/libstrongswan/pen/pen.h6
-rw-r--r--src/libstrongswan/plugins/aes/aes_crypter.c82
-rw-r--r--src/libstrongswan/plugins/aesni/aesni_ccm.c8
-rw-r--r--src/libstrongswan/plugins/aesni/aesni_cmac.c2
-rw-r--r--src/libstrongswan/plugins/aesni/aesni_ctr.c2
-rw-r--r--src/libstrongswan/plugins/aesni/aesni_gcm.c2
-rw-r--r--src/libstrongswan/plugins/aesni/aesni_xcbc.c2
-rw-r--r--src/libstrongswan/plugins/af_alg/af_alg_hasher.c2
-rw-r--r--src/libstrongswan/plugins/af_alg/af_alg_ops.c2
-rw-r--r--src/libstrongswan/plugins/af_alg/af_alg_ops.h2
-rw-r--r--src/libstrongswan/plugins/af_alg/af_alg_prf.c2
-rw-r--r--src/libstrongswan/plugins/af_alg/af_alg_signer.c2
-rw-r--r--src/libstrongswan/plugins/agent/agent_private_key.c20
-rw-r--r--src/libstrongswan/plugins/blowfish/blowfish.h2
-rw-r--r--src/libstrongswan/plugins/blowfish/blowfish_crypter.c6
-rw-r--r--src/libstrongswan/plugins/ccm/ccm_aead.c6
-rw-r--r--src/libstrongswan/plugins/chapoly/chapoly_aead.c8
-rw-r--r--src/libstrongswan/plugins/chapoly/chapoly_drv_portable.c42
-rw-r--r--src/libstrongswan/plugins/chapoly/chapoly_drv_ssse3.c66
-rw-r--r--src/libstrongswan/plugins/cmac/cmac.c16
-rw-r--r--src/libstrongswan/plugins/ctr/ctr_ipsec_crypter.c2
-rw-r--r--src/libstrongswan/plugins/des/des_crypter.c14
-rw-r--r--src/libstrongswan/plugins/dnskey/dnskey_builder.c8
-rw-r--r--src/libstrongswan/plugins/fips_prf/fips_prf.c26
-rw-r--r--src/libstrongswan/plugins/gcm/gcm_aead.c4
-rw-r--r--src/libstrongswan/plugins/gcrypt/gcrypt_crypter.c2
-rw-r--r--src/libstrongswan/plugins/gcrypt/gcrypt_hasher.c2
-rw-r--r--src/libstrongswan/plugins/gcrypt/gcrypt_rng.c2
-rw-r--r--src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c2
-rw-r--r--src/libstrongswan/plugins/hmac/hmac.c8
-rw-r--r--src/libstrongswan/plugins/md4/md4_hasher.c48
-rw-r--r--src/libstrongswan/plugins/md5/md5_hasher.c52
-rw-r--r--src/libstrongswan/plugins/nonce/nonce_nonceg.c2
-rw-r--r--src/libstrongswan/plugins/ntru/ntru_drbg.c14
-rw-r--r--src/libstrongswan/plugins/ntru/ntru_drbg.h8
-rw-r--r--src/libstrongswan/plugins/ntru/ntru_ke.c4
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_crypter.c2
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_hasher.c2
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_hmac.c2
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_rng.c2
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_sha1_prf.c4
-rw-r--r--src/libstrongswan/plugins/padlock/padlock_rng.c2
-rw-r--r--src/libstrongswan/plugins/padlock/padlock_sha1_hasher.c10
-rw-r--r--src/libstrongswan/plugins/pem/pem_builder.c2
-rw-r--r--src/libstrongswan/plugins/pgp/pgp_builder.c6
-rw-r--r--src/libstrongswan/plugins/pgp/pgp_cert.c8
-rw-r--r--src/libstrongswan/plugins/pgp/pgp_utils.c10
-rw-r--r--src/libstrongswan/plugins/pgp/pgp_utils.h2
-rw-r--r--src/libstrongswan/plugins/pkcs11/pkcs11_hasher.c2
-rw-r--r--src/libstrongswan/plugins/pkcs11/pkcs11_rng.c2
-rw-r--r--src/libstrongswan/plugins/pkcs12/pkcs12_decode.c4
-rw-r--r--src/libstrongswan/plugins/plugin_feature.c2
-rw-r--r--src/libstrongswan/plugins/plugin_feature.h2
-rw-r--r--src/libstrongswan/plugins/random/random_rng.c2
-rw-r--r--src/libstrongswan/plugins/rc2/rc2_crypter.c20
-rw-r--r--src/libstrongswan/plugins/rdrand/rdrand_rng.c76
-rw-r--r--src/libstrongswan/plugins/sha1/sha1_hasher.c34
-rw-r--r--src/libstrongswan/plugins/sha1/sha1_prf.c16
-rw-r--r--src/libstrongswan/plugins/sha2/sha2_hasher.c58
-rw-r--r--src/libstrongswan/plugins/winhttp/winhttp_fetcher.c2
-rw-r--r--src/libstrongswan/plugins/xcbc/xcbc.c16
-rw-r--r--src/libstrongswan/processing/jobs/job.h2
-rw-r--r--src/libstrongswan/processing/scheduler.c4
-rw-r--r--src/libstrongswan/processing/scheduler.h4
-rw-r--r--src/libstrongswan/selectors/traffic_selector.c80
-rw-r--r--src/libstrongswan/selectors/traffic_selector.h36
-rw-r--r--src/libstrongswan/settings/settings.c14
-rw-r--r--src/libstrongswan/settings/settings.h10
-rw-r--r--src/libstrongswan/tests/suites/test_array.c2
-rw-r--r--src/libstrongswan/tests/suites/test_asn1.c6
-rw-r--r--src/libstrongswan/tests/suites/test_bio_reader.c20
-rw-r--r--src/libstrongswan/tests/suites/test_chunk.c10
-rw-r--r--src/libstrongswan/tests/suites/test_host.c6
-rw-r--r--src/libstrongswan/tests/suites/test_iv_gen.c32
-rw-r--r--src/libstrongswan/tests/suites/test_ntru.c8
-rw-r--r--src/libstrongswan/tests/suites/test_printf.c12
-rw-r--r--src/libstrongswan/tests/suites/test_traffic_selector.c40
-rw-r--r--src/libstrongswan/tests/suites/test_utils.c18
-rw-r--r--src/libstrongswan/tests/utils/test_rng.c2
-rw-r--r--src/libstrongswan/utils/chunk.c62
-rw-r--r--src/libstrongswan/utils/chunk.h14
-rw-r--r--src/libstrongswan/utils/cpu_feature.c2
-rw-r--r--src/libstrongswan/utils/integrity_checker.c10
-rw-r--r--src/libstrongswan/utils/integrity_checker.h8
-rw-r--r--src/libstrongswan/utils/leak_detective.c8
-rw-r--r--src/libstrongswan/utils/utils.c2
-rw-r--r--src/libstrongswan/utils/utils/align.c6
-rw-r--r--src/libstrongswan/utils/utils/align.h2
-rw-r--r--src/libstrongswan/utils/utils/byteorder.h26
-rw-r--r--src/libstrongswan/utils/utils/memory.c2
-rw-r--r--src/libstrongswan/utils/utils/memory.h2
-rw-r--r--src/libstrongswan/utils/utils/time.c2
-rw-r--r--src/libstrongswan/utils/utils/types.h10
131 files changed, 789 insertions, 789 deletions
diff --git a/src/libstrongswan/asn1/asn1.c b/src/libstrongswan/asn1/asn1.c
index 628bb99e6..2ee414abf 100644
--- a/src/libstrongswan/asn1/asn1.c
+++ b/src/libstrongswan/asn1/asn1.c
@@ -592,15 +592,15 @@ bool asn1_parse_simple_object(chunk_t *object, asn1_t type, u_int level, const c
/*
* Described in header
*/
-u_int64_t asn1_parse_integer_uint64(chunk_t blob)
+uint64_t asn1_parse_integer_uint64(chunk_t blob)
{
- u_int64_t val = 0;
+ uint64_t val = 0;
int i;
for (i = 0; i < blob.len; i++)
{ /* if it is longer than 8 bytes, we just use the 8 LSBs */
val <<= 8;
- val |= (u_int64_t)blob.ptr[i];
+ val |= (uint64_t)blob.ptr[i];
}
return val;
}
diff --git a/src/libstrongswan/asn1/asn1.h b/src/libstrongswan/asn1/asn1.h
index 8ac005610..f0b3e17e8 100644
--- a/src/libstrongswan/asn1/asn1.h
+++ b/src/libstrongswan/asn1/asn1.h
@@ -172,13 +172,13 @@ bool asn1_parse_simple_object(chunk_t *object, asn1_t type, u_int level0,
const char* name);
/**
- * Converts an ASN.1 INTEGER object to an u_int64_t. If the INTEGER is longer
+ * Converts an ASN.1 INTEGER object to an uint64_t. If the INTEGER is longer
* than 8 bytes only the 8 LSBs are returned.
*
* @param blob body of an ASN.1 coded integer object
* @return converted integer
*/
-u_int64_t asn1_parse_integer_uint64(chunk_t blob);
+uint64_t asn1_parse_integer_uint64(chunk_t blob);
/**
* Print the value of an ASN.1 simple object
diff --git a/src/libstrongswan/bio/bio_reader.c b/src/libstrongswan/bio/bio_reader.c
index 29b9e7279..6e35999ce 100644
--- a/src/libstrongswan/bio/bio_reader.c
+++ b/src/libstrongswan/bio/bio_reader.c
@@ -43,7 +43,7 @@ struct private_bio_reader_t {
chunk_t cleanup;
};
-METHOD(bio_reader_t, remaining, u_int32_t,
+METHOD(bio_reader_t, remaining, uint32_t,
private_bio_reader_t *this)
{
return this->buf.len;
@@ -76,16 +76,16 @@ static inline chunk_t chunk_skip_end(chunk_t chunk, size_t bytes, bool from_end)
/**
* Returns a pointer to the data to read, optionally from the end
*/
-static inline u_char *get_ptr_end(private_bio_reader_t *this, u_int32_t len,
+static inline u_char *get_ptr_end(private_bio_reader_t *this, uint32_t len,
bool from_end)
{
return from_end ? this->buf.ptr + (this->buf.len - len) : this->buf.ptr;
}
/**
- * Read an u_int8_t from the buffer, optionally from the end of the buffer
+ * Read an uint8_t from the buffer, optionally from the end of the buffer
*/
-static bool read_uint8_internal(private_bio_reader_t *this, u_int8_t *res,
+static bool read_uint8_internal(private_bio_reader_t *this, uint8_t *res,
bool from_end)
{
if (this->buf.len < 1)
@@ -100,9 +100,9 @@ static bool read_uint8_internal(private_bio_reader_t *this, u_int8_t *res,
}
/**
- * Read an u_int16_t from the buffer, optionally from the end
+ * Read an uint16_t from the buffer, optionally from the end
*/
-static bool read_uint16_internal(private_bio_reader_t *this, u_int16_t *res,
+static bool read_uint16_internal(private_bio_reader_t *this, uint16_t *res,
bool from_end)
{
if (this->buf.len < 2)
@@ -117,9 +117,9 @@ static bool read_uint16_internal(private_bio_reader_t *this, u_int16_t *res,
}
/**
- * Read an u_int32_t (only 24-bit) from the buffer, optionally from the end
+ * Read an uint32_t (only 24-bit) from the buffer, optionally from the end
*/
-static bool read_uint24_internal(private_bio_reader_t *this, u_int32_t *res,
+static bool read_uint24_internal(private_bio_reader_t *this, uint32_t *res,
bool from_end)
{
if (this->buf.len < 3)
@@ -134,9 +134,9 @@ static bool read_uint24_internal(private_bio_reader_t *this, u_int32_t *res,
}
/**
- * Read an u_int32_t from the buffer, optionally from the end
+ * Read an uint32_t from the buffer, optionally from the end
*/
-static bool read_uint32_internal(private_bio_reader_t *this, u_int32_t *res,
+static bool read_uint32_internal(private_bio_reader_t *this, uint32_t *res,
bool from_end)
{
if (this->buf.len < 4)
@@ -151,9 +151,9 @@ static bool read_uint32_internal(private_bio_reader_t *this, u_int32_t *res,
}
/**
- * Read an u_int64_t from the buffer, optionally from the end
+ * Read an uint64_t from the buffer, optionally from the end
*/
-static bool read_uint64_internal(private_bio_reader_t *this, u_int64_t *res,
+static bool read_uint64_internal(private_bio_reader_t *this, uint64_t *res,
bool from_end)
{
if (this->buf.len < 8)
@@ -170,7 +170,7 @@ static bool read_uint64_internal(private_bio_reader_t *this, u_int64_t *res,
/**
* Read a chunk of data from the buffer, optionally from the end
*/
-static bool read_data_internal(private_bio_reader_t *this, u_int32_t len,
+static bool read_data_internal(private_bio_reader_t *this, uint32_t len,
chunk_t *res, bool from_end)
{
if (this->buf.len < len)
@@ -185,73 +185,73 @@ static bool read_data_internal(private_bio_reader_t *this, u_int32_t len,
}
METHOD(bio_reader_t, read_uint8, bool,
- private_bio_reader_t *this, u_int8_t *res)
+ private_bio_reader_t *this, uint8_t *res)
{
return read_uint8_internal(this, res, FALSE);
}
METHOD(bio_reader_t, read_uint16, bool,
- private_bio_reader_t *this, u_int16_t *res)
+ private_bio_reader_t *this, uint16_t *res)
{
return read_uint16_internal(this, res, FALSE);
}
METHOD(bio_reader_t, read_uint24, bool,
- private_bio_reader_t *this, u_int32_t *res)
+ private_bio_reader_t *this, uint32_t *res)
{
return read_uint24_internal(this, res, FALSE);
}
METHOD(bio_reader_t, read_uint32, bool,
- private_bio_reader_t *this, u_int32_t *res)
+ private_bio_reader_t *this, uint32_t *res)
{
return read_uint32_internal(this, res, FALSE);
}
METHOD(bio_reader_t, read_uint64, bool,
- private_bio_reader_t *this, u_int64_t *res)
+ private_bio_reader_t *this, uint64_t *res)
{
return read_uint64_internal(this, res, FALSE);
}
METHOD(bio_reader_t, read_data, bool,
- private_bio_reader_t *this, u_int32_t len, chunk_t *res)
+ private_bio_reader_t *this, uint32_t len, chunk_t *res)
{
return read_data_internal(this, len, res, FALSE);
}
METHOD(bio_reader_t, read_uint8_end, bool,
- private_bio_reader_t *this, u_int8_t *res)
+ private_bio_reader_t *this, uint8_t *res)
{
return read_uint8_internal(this, res, TRUE);
}
METHOD(bio_reader_t, read_uint16_end, bool,
- private_bio_reader_t *this, u_int16_t *res)
+ private_bio_reader_t *this, uint16_t *res)
{
return read_uint16_internal(this, res, TRUE);
}
METHOD(bio_reader_t, read_uint24_end, bool,
- private_bio_reader_t *this, u_int32_t *res)
+ private_bio_reader_t *this, uint32_t *res)
{
return read_uint24_internal(this, res, TRUE);
}
METHOD(bio_reader_t, read_uint32_end, bool,
- private_bio_reader_t *this, u_int32_t *res)
+ private_bio_reader_t *this, uint32_t *res)
{
return read_uint32_internal(this, res, TRUE);
}
METHOD(bio_reader_t, read_uint64_end, bool,
- private_bio_reader_t *this, u_int64_t *res)
+ private_bio_reader_t *this, uint64_t *res)
{
return read_uint64_internal(this, res, TRUE);
}
METHOD(bio_reader_t, read_data_end, bool,
- private_bio_reader_t *this, u_int32_t len, chunk_t *res)
+ private_bio_reader_t *this, uint32_t len, chunk_t *res)
{
return read_data_internal(this, len, res, TRUE);
}
@@ -259,7 +259,7 @@ METHOD(bio_reader_t, read_data_end, bool,
METHOD(bio_reader_t, read_data8, bool,
private_bio_reader_t *this, chunk_t *res)
{
- u_int8_t len;
+ uint8_t len;
if (!read_uint8(this, &len))
{
@@ -271,7 +271,7 @@ METHOD(bio_reader_t, read_data8, bool,
METHOD(bio_reader_t, read_data16, bool,
private_bio_reader_t *this, chunk_t *res)
{
- u_int16_t len;
+ uint16_t len;
if (!read_uint16(this, &len))
{
@@ -283,7 +283,7 @@ METHOD(bio_reader_t, read_data16, bool,
METHOD(bio_reader_t, read_data24, bool,
private_bio_reader_t *this, chunk_t *res)
{
- u_int32_t len;
+ uint32_t len;
if (!read_uint24(this, &len))
{
@@ -295,7 +295,7 @@ METHOD(bio_reader_t, read_data24, bool,
METHOD(bio_reader_t, read_data32, bool,
private_bio_reader_t *this, chunk_t *res)
{
- u_int32_t len;
+ uint32_t len;
if (!read_uint32(this, &len))
{
diff --git a/src/libstrongswan/bio/bio_reader.h b/src/libstrongswan/bio/bio_reader.h
index 475422428..358993c4f 100644
--- a/src/libstrongswan/bio/bio_reader.h
+++ b/src/libstrongswan/bio/bio_reader.h
@@ -40,7 +40,7 @@ struct bio_reader_t {
*
* @return number of remaining bytes in buffer
*/
- u_int32_t (*remaining)(bio_reader_t *this);
+ uint32_t (*remaining)(bio_reader_t *this);
/**
* Peek the remaining data, not consuming any bytes.
@@ -55,7 +55,7 @@ struct bio_reader_t {
* @param res pointer to result
* @return TRUE if integer read successfully
*/
- bool (*read_uint8)(bio_reader_t *this, u_int8_t *res);
+ bool (*read_uint8)(bio_reader_t *this, uint8_t *res);
/**
* Read a 16-bit integer from the buffer, advance.
@@ -63,7 +63,7 @@ struct bio_reader_t {
* @param res pointer to result
* @return TRUE if integer read successfully
*/
- bool (*read_uint16)(bio_reader_t *this, u_int16_t *res);
+ bool (*read_uint16)(bio_reader_t *this, uint16_t *res);
/**
* Read a 24-bit integer from the buffer, advance.
@@ -71,7 +71,7 @@ struct bio_reader_t {
* @param res pointer to result
* @return TRUE if integer read successfully
*/
- bool (*read_uint24)(bio_reader_t *this, u_int32_t *res);
+ bool (*read_uint24)(bio_reader_t *this, uint32_t *res);
/**
* Read a 32-bit integer from the buffer, advance.
@@ -79,7 +79,7 @@ struct bio_reader_t {
* @param res pointer to result
* @return TRUE if integer read successfully
*/
- bool (*read_uint32)(bio_reader_t *this, u_int32_t *res);
+ bool (*read_uint32)(bio_reader_t *this, uint32_t *res);
/**
* Read a 64-bit integer from the buffer, advance.
@@ -87,7 +87,7 @@ struct bio_reader_t {
* @param res pointer to result
* @return TRUE if integer read successfully
*/
- bool (*read_uint64)(bio_reader_t *this, u_int64_t *res);
+ bool (*read_uint64)(bio_reader_t *this, uint64_t *res);
/**
* Read a chunk of len bytes, advance.
@@ -96,7 +96,7 @@ struct bio_reader_t {
* @param res pointer to result, not cloned
* @return TRUE if data read successfully
*/
- bool (*read_data)(bio_reader_t *this, u_int32_t len, chunk_t *res);
+ bool (*read_data)(bio_reader_t *this, uint32_t len, chunk_t *res);
/**
* Read a 8-bit integer from the end of the buffer, reduce remaining.
@@ -104,7 +104,7 @@ struct bio_reader_t {
* @param res pointer to result
* @return TRUE if integer read successfully
*/
- bool (*read_uint8_end)(bio_reader_t *this, u_int8_t *res);
+ bool (*read_uint8_end)(bio_reader_t *this, uint8_t *res);
/**
* Read a 16-bit integer from the end of the buffer, reduce remaining.
@@ -112,7 +112,7 @@ struct bio_reader_t {
* @param res pointer to result
* @return TRUE if integer read successfully
*/
- bool (*read_uint16_end)(bio_reader_t *this, u_int16_t *res);
+ bool (*read_uint16_end)(bio_reader_t *this, uint16_t *res);
/**
* Read a 24-bit integer from the end of the buffer, reduce remaining.
@@ -120,7 +120,7 @@ struct bio_reader_t {
* @param res pointer to result
* @return TRUE if integer read successfully
*/
- bool (*read_uint24_end)(bio_reader_t *this, u_int32_t *res);
+ bool (*read_uint24_end)(bio_reader_t *this, uint32_t *res);
/**
* Read a 32-bit integer from the end of the buffer, reduce remaining.
@@ -128,7 +128,7 @@ struct bio_reader_t {
* @param res pointer to result
* @return TRUE if integer read successfully
*/
- bool (*read_uint32_end)(bio_reader_t *this, u_int32_t *res);
+ bool (*read_uint32_end)(bio_reader_t *this, uint32_t *res);
/**
* Read a 64-bit integer from the end of the buffer, reduce remaining.
@@ -136,7 +136,7 @@ struct bio_reader_t {
* @param res pointer to result
* @return TRUE if integer read successfully
*/
- bool (*read_uint64_end)(bio_reader_t *this, u_int64_t *res);
+ bool (*read_uint64_end)(bio_reader_t *this, uint64_t *res);
/**
* Read a chunk of len bytes from the end of the buffer, reduce remaining.
@@ -145,7 +145,7 @@ struct bio_reader_t {
* @param res ponter to result, not cloned
* @return TRUE if data read successfully
*/
- bool (*read_data_end)(bio_reader_t *this, u_int32_t len, chunk_t *res);
+ bool (*read_data_end)(bio_reader_t *this, uint32_t len, chunk_t *res);
/**
* Read a chunk of bytes with a 8-bit length header, advance.
diff --git a/src/libstrongswan/bio/bio_writer.c b/src/libstrongswan/bio/bio_writer.c
index 152d9ce22..a21b376cf 100644
--- a/src/libstrongswan/bio/bio_writer.c
+++ b/src/libstrongswan/bio/bio_writer.c
@@ -65,7 +65,7 @@ static inline void increase(private_bio_writer_t *this, size_t required)
}
METHOD(bio_writer_t, write_uint8, void,
- private_bio_writer_t *this, u_int8_t value)
+ private_bio_writer_t *this, uint8_t value)
{
increase(this, 1);
this->buf.ptr[this->used] = value;
@@ -73,7 +73,7 @@ METHOD(bio_writer_t, write_uint8, void,
}
METHOD(bio_writer_t, write_uint16, void,
- private_bio_writer_t *this, u_int16_t value)
+ private_bio_writer_t *this, uint16_t value)
{
increase(this, 2);
htoun16(this->buf.ptr + this->used, value);
@@ -81,7 +81,7 @@ METHOD(bio_writer_t, write_uint16, void,
}
METHOD(bio_writer_t, write_uint24, void,
- private_bio_writer_t *this, u_int32_t value)
+ private_bio_writer_t *this, uint32_t value)
{
increase(this, 3);
value = htonl(value);
@@ -90,7 +90,7 @@ METHOD(bio_writer_t, write_uint24, void,
}
METHOD(bio_writer_t, write_uint32, void,
- private_bio_writer_t *this, u_int32_t value)
+ private_bio_writer_t *this, uint32_t value)
{
increase(this, 4);
htoun32(this->buf.ptr + this->used, value);
@@ -98,7 +98,7 @@ METHOD(bio_writer_t, write_uint32, void,
}
METHOD(bio_writer_t, write_uint64, void,
- private_bio_writer_t *this, u_int64_t value)
+ private_bio_writer_t *this, uint64_t value)
{
increase(this, 8);
htoun64(this->buf.ptr + this->used, value);
@@ -166,7 +166,7 @@ METHOD(bio_writer_t, wrap16, void,
METHOD(bio_writer_t, wrap24, void,
private_bio_writer_t *this)
{
- u_int32_t len;
+ uint32_t len;
increase(this, 3);
memmove(this->buf.ptr + 3, this->buf.ptr, this->used);
@@ -221,7 +221,7 @@ METHOD(bio_writer_t, destroy, void,
/**
* See header
*/
-bio_writer_t *bio_writer_create(u_int32_t bufsize)
+bio_writer_t *bio_writer_create(uint32_t bufsize)
{
private_bio_writer_t *this;
diff --git a/src/libstrongswan/bio/bio_writer.h b/src/libstrongswan/bio/bio_writer.h
index 2ac4f3556..b6e3db730 100644
--- a/src/libstrongswan/bio/bio_writer.h
+++ b/src/libstrongswan/bio/bio_writer.h
@@ -40,35 +40,35 @@ struct bio_writer_t {
*
* @param value value to append
*/
- void (*write_uint8)(bio_writer_t *this, u_int8_t value);
+ void (*write_uint8)(bio_writer_t *this, uint8_t value);
/**
* Append a 16-bit integer to the buffer.
*
* @param value value to append
*/
- void (*write_uint16)(bio_writer_t *this, u_int16_t value);
+ void (*write_uint16)(bio_writer_t *this, uint16_t value);
/**
* Append a 24-bit integer to the buffer.
*
* @param value value to append
*/
- void (*write_uint24)(bio_writer_t *this, u_int32_t value);
+ void (*write_uint24)(bio_writer_t *this, uint32_t value);
/**
* Append a 32-bit integer to the buffer.
*
* @param value value to append
*/
- void (*write_uint32)(bio_writer_t *this, u_int32_t value);
+ void (*write_uint32)(bio_writer_t *this, uint32_t value);
/**
* Append a 64-bit integer to the buffer.
*
* @param value value to append
*/
- void (*write_uint64)(bio_writer_t *this, u_int64_t value);
+ void (*write_uint64)(bio_writer_t *this, uint64_t value);
/**
* Append a chunk of data without a length header.
@@ -166,6 +166,6 @@ struct bio_writer_t {
*
* @param bufsize initially allocated buffer size
*/
-bio_writer_t *bio_writer_create(u_int32_t bufsize);
+bio_writer_t *bio_writer_create(uint32_t bufsize);
#endif /** BIO_WRITER_H_ @}*/
diff --git a/src/libstrongswan/collections/array.c b/src/libstrongswan/collections/array.c
index a45a68aaf..69e7df99e 100644
--- a/src/libstrongswan/collections/array.c
+++ b/src/libstrongswan/collections/array.c
@@ -42,13 +42,13 @@
*/
struct array_t {
/** number of elements currently in array (not counting head/tail) */
- u_int32_t count;
+ uint32_t count;
/** size of each element, 0 for a pointer based array */
- u_int16_t esize;
+ uint16_t esize;
/** allocated but unused elements at array front */
- u_int8_t head;
+ uint8_t head;
/** allocated but unused elements at array end */
- u_int8_t tail;
+ uint8_t tail;
/** array elements */
void *data;
};
@@ -64,7 +64,7 @@ struct array_t {
/**
* Get the actual size of a number of elements
*/
-static size_t get_size(array_t *array, u_int32_t num)
+static size_t get_size(array_t *array, uint32_t num)
{
if (array->esize)
{
@@ -76,7 +76,7 @@ static size_t get_size(array_t *array, u_int32_t num)
/**
* Increase allocated but unused tail room to at least "room"
*/
-static void make_tail_room(array_t *array, u_int8_t room)
+static void make_tail_room(array_t *array, uint8_t room)
{
if (array->tail < room)
{
@@ -89,11 +89,11 @@ static void make_tail_room(array_t *array, u_int8_t room)
/**
* Increase allocated but unused head room to at least "room"
*/
-static void make_head_room(array_t *array, u_int8_t room)
+static void make_head_room(array_t *array, uint8_t room)
{
if (array->head < room)
{
- u_int8_t increase = room - array->head;
+ uint8_t increase = room - array->head;
array->data = realloc(array->data,
get_size(array, array->count + array->tail + room));
@@ -158,7 +158,7 @@ static void remove_head(array_t *array, int idx)
array->head++;
}
-array_t *array_create(u_int esize, u_int8_t reserve)
+array_t *array_create(u_int esize, uint8_t reserve)
{
array_t *array;
@@ -186,7 +186,7 @@ void array_compress(array_t *array)
{
if (array)
{
- u_int32_t tail;
+ uint32_t tail;
tail = array->tail;
if (array->head)
diff --git a/src/libstrongswan/collections/array.h b/src/libstrongswan/collections/array.h
index c3be1a15d..d8a16b5df 100644
--- a/src/libstrongswan/collections/array.h
+++ b/src/libstrongswan/collections/array.h
@@ -68,7 +68,7 @@ typedef void (*array_callback_t)(void *data, int idx, void *user);
* @param reserve number of items to allocate space for
* @return array instance
*/
-array_t *array_create(u_int esize, u_int8_t reserve);
+array_t *array_create(u_int esize, uint8_t reserve);
/**
* Get the number of elements currently in the array.
diff --git a/src/libstrongswan/credentials/auth_cfg.h b/src/libstrongswan/credentials/auth_cfg.h
index 6940069de..7191dc1bc 100644
--- a/src/libstrongswan/credentials/auth_cfg.h
+++ b/src/libstrongswan/credentials/auth_cfg.h
@@ -78,7 +78,7 @@ enum auth_rule_t {
AUTH_RULE_EAP_IDENTITY,
/** EAP type to propose for peer authentication, eap_type_t */
AUTH_RULE_EAP_TYPE,
- /** EAP vendor for vendor specific type, u_int32_t */
+ /** EAP vendor for vendor specific type, uint32_t */
AUTH_RULE_EAP_VENDOR,
/** XAUTH backend name to use, char* */
AUTH_RULE_XAUTH_BACKEND,
diff --git a/src/libstrongswan/credentials/containers/pkcs12.c b/src/libstrongswan/credentials/containers/pkcs12.c
index 7b812d27d..9e7815d04 100644
--- a/src/libstrongswan/credentials/containers/pkcs12.c
+++ b/src/libstrongswan/credentials/containers/pkcs12.c
@@ -42,8 +42,8 @@ static inline void copy_chunk(chunk_t dst, chunk_t src)
*/
static void add_chunks(chunk_t a, chunk_t b)
{
- u_int16_t sum;
- u_int8_t rem = 0;
+ uint16_t sum;
+ uint8_t rem = 0;
ssize_t i, j;
for (i = a.len - 1, j = b.len -1; i >= 0 && j >= 0; i--, j--)
@@ -64,12 +64,12 @@ static void add_chunks(chunk_t a, chunk_t b)
* Do the actual key derivation with the given hasher, password and id.
*/
static bool derive_key(hash_algorithm_t hash, chunk_t unicode, chunk_t salt,
- u_int64_t iterations, char id, chunk_t result)
+ uint64_t iterations, char id, chunk_t result)
{
chunk_t out = result, D, S, P = chunk_empty, I, Ai, B, Ij;
hasher_t *hasher;
size_t Slen, v, u;
- u_int64_t i;
+ uint64_t i;
bool success = FALSE;
hasher = lib->crypto->create_hasher(lib->crypto, hash);
@@ -149,7 +149,7 @@ end:
* Described in header
*/
bool pkcs12_derive_key(hash_algorithm_t hash, chunk_t password, chunk_t salt,
- u_int64_t iterations, pkcs12_key_type_t type, chunk_t key)
+ uint64_t iterations, pkcs12_key_type_t type, chunk_t key)
{
chunk_t unicode = chunk_empty;
bool success;
diff --git a/src/libstrongswan/credentials/containers/pkcs12.h b/src/libstrongswan/credentials/containers/pkcs12.h
index f22ef045a..fc4fb39ce 100644
--- a/src/libstrongswan/credentials/containers/pkcs12.h
+++ b/src/libstrongswan/credentials/containers/pkcs12.h
@@ -73,6 +73,6 @@ struct pkcs12_t {
* @return TRUE on success
*/
bool pkcs12_derive_key(hash_algorithm_t hash, chunk_t password, chunk_t salt,
- u_int64_t iterations, pkcs12_key_type_t type, chunk_t key);
+ uint64_t iterations, pkcs12_key_type_t type, chunk_t key);
#endif /** PKCS12_H_ @}*/
diff --git a/src/libstrongswan/crypto/hashers/hasher.h b/src/libstrongswan/crypto/hashers/hasher.h
index 272502cf0..2d28b207d 100644
--- a/src/libstrongswan/crypto/hashers/hasher.h
+++ b/src/libstrongswan/crypto/hashers/hasher.h
@@ -90,7 +90,7 @@ struct hasher_t {
* @return TRUE if hash created successfully
*/
bool (*get_hash)(hasher_t *this, chunk_t data,
- u_int8_t *hash) __attribute__((warn_unused_result));
+ uint8_t *hash) __attribute__((warn_unused_result));
/**
* Hash data and allocate space for the hash.
diff --git a/src/libstrongswan/crypto/iv/iv_gen.h b/src/libstrongswan/crypto/iv/iv_gen.h
index 81b0701ce..292fc329f 100644
--- a/src/libstrongswan/crypto/iv/iv_gen.h
+++ b/src/libstrongswan/crypto/iv/iv_gen.h
@@ -38,8 +38,8 @@ struct iv_gen_t {
* @param buffer pointer where the generated IV will be written
* @return TRUE if IV allocation was successful, FALSE otherwise
*/
- bool (*get_iv)(iv_gen_t *this, u_int64_t seq, size_t size,
- u_int8_t *buffer) __attribute__((warn_unused_result));
+ bool (*get_iv)(iv_gen_t *this, uint64_t seq, size_t size,
+ uint8_t *buffer) __attribute__((warn_unused_result));
/**
* Generates an IV and allocates space for it.
@@ -49,7 +49,7 @@ struct iv_gen_t {
* @param chunk chunk which will hold the generated IV
* @return TRUE if IV allocation was successful, FALSE otherwise
*/
- bool (*allocate_iv)(iv_gen_t *this, u_int64_t seq, size_t size,
+ bool (*allocate_iv)(iv_gen_t *this, uint64_t seq, size_t size,
chunk_t *chunk) __attribute__((warn_unused_result));
/**
diff --git a/src/libstrongswan/crypto/iv/iv_gen_null.c b/src/libstrongswan/crypto/iv/iv_gen_null.c
index b13de0674..3b8f93986 100644
--- a/src/libstrongswan/crypto/iv/iv_gen_null.c
+++ b/src/libstrongswan/crypto/iv/iv_gen_null.c
@@ -29,13 +29,13 @@ struct private_iv_gen_t {
};
METHOD(iv_gen_t, get_iv, bool,
- private_iv_gen_t *this, u_int64_t seq, size_t size, u_int8_t *buffer)
+ private_iv_gen_t *this, uint64_t seq, size_t size, uint8_t *buffer)
{
return size == 0;
}
METHOD(iv_gen_t, allocate_iv, bool,
- private_iv_gen_t *this, u_int64_t seq, size_t size, chunk_t *chunk)
+ private_iv_gen_t *this, uint64_t seq, size_t size, chunk_t *chunk)
{
*chunk = chunk_empty;
return size == 0;
diff --git a/src/libstrongswan/crypto/iv/iv_gen_rand.c b/src/libstrongswan/crypto/iv/iv_gen_rand.c
index 2bed63fcc..1474b3a12 100644
--- a/src/libstrongswan/crypto/iv/iv_gen_rand.c
+++ b/src/libstrongswan/crypto/iv/iv_gen_rand.c
@@ -36,7 +36,7 @@ struct private_iv_gen_t {
};
METHOD(iv_gen_t, get_iv, bool,
- private_iv_gen_t *this, u_int64_t seq, size_t size, u_int8_t *buffer)
+ private_iv_gen_t *this, uint64_t seq, size_t size, uint8_t *buffer)
{
if (!this->rng)
{
@@ -46,7 +46,7 @@ METHOD(iv_gen_t, get_iv, bool,
}
METHOD(iv_gen_t, allocate_iv, bool,
- private_iv_gen_t *this, u_int64_t seq, size_t size, chunk_t *chunk)
+ private_iv_gen_t *this, uint64_t seq, size_t size, chunk_t *chunk)
{
if (!this->rng)
{
diff --git a/src/libstrongswan/crypto/iv/iv_gen_seq.c b/src/libstrongswan/crypto/iv/iv_gen_seq.c
index 9f99c5192..56620291c 100644
--- a/src/libstrongswan/crypto/iv/iv_gen_seq.c
+++ b/src/libstrongswan/crypto/iv/iv_gen_seq.c
@@ -18,7 +18,7 @@
/**
* Magic value for the initial IV state
*/
-#define SEQ_IV_INIT_STATE (~(u_int64_t)0)
+#define SEQ_IV_INIT_STATE (~(uint64_t)0)
#define SEQ_IV_HIGH_MASK (1ULL << 63)
typedef struct private_iv_gen_t private_iv_gen_t;
@@ -36,30 +36,30 @@ struct private_iv_gen_t {
/**
* Previously passed sequence number in lower space to enforce uniqueness
*/
- u_int64_t prevl;
+ uint64_t prevl;
/**
* Previously passed sequence number in upper space to enforce uniqueness
*/
- u_int64_t prevh;
+ uint64_t prevh;
/**
* Salt to mask counter
*/
- u_int8_t *salt;
+ uint8_t *salt;
};
METHOD(iv_gen_t, get_iv, bool,
- private_iv_gen_t *this, u_int64_t seq, size_t size, u_int8_t *buffer)
+ private_iv_gen_t *this, uint64_t seq, size_t size, uint8_t *buffer)
{
- u_int8_t iv[sizeof(u_int64_t)];
+ uint8_t iv[sizeof(uint64_t)];
size_t len = size;
if (!this->salt)
{
return FALSE;
}
- if (size < sizeof(u_int64_t))
+ if (size < sizeof(uint64_t))
{
return FALSE;
}
@@ -83,19 +83,19 @@ METHOD(iv_gen_t, get_iv, bool,
{
this->prevl = seq;
}
- if (len > sizeof(u_int64_t))
+ if (len > sizeof(uint64_t))
{
- len = sizeof(u_int64_t);
+ len = sizeof(uint64_t);
memset(buffer, 0, size - len);
}
htoun64(iv, seq);
- memxor(iv, this->salt, sizeof(u_int64_t));
- memcpy(buffer + size - len, iv + sizeof(u_int64_t) - len, len);
+ memxor(iv, this->salt, sizeof(uint64_t));
+ memcpy(buffer + size - len, iv + sizeof(uint64_t) - len, len);
return TRUE;
}
METHOD(iv_gen_t, allocate_iv, bool,
- private_iv_gen_t *this, u_int64_t seq, size_t size, chunk_t *chunk)
+ private_iv_gen_t *this, uint64_t seq, size_t size, chunk_t *chunk)
{
*chunk = chunk_alloc(size);
if (!get_iv(this, seq, chunk->len, chunk->ptr))
@@ -131,8 +131,8 @@ iv_gen_t *iv_gen_seq_create()
rng = lib->crypto->create_rng(lib->crypto, RNG_STRONG);
if (rng)
{
- this->salt = malloc(sizeof(u_int64_t));
- if (!rng->get_bytes(rng, sizeof(u_int64_t), this->salt))
+ this->salt = malloc(sizeof(uint64_t));
+ if (!rng->get_bytes(rng, sizeof(uint64_t), this->salt))
{
free(this->salt);
this->salt = NULL;
diff --git a/src/libstrongswan/crypto/mac.h b/src/libstrongswan/crypto/mac.h
index f7b43ba39..f23c6750f 100644
--- a/src/libstrongswan/crypto/mac.h
+++ b/src/libstrongswan/crypto/mac.h
@@ -47,7 +47,7 @@ struct mac_t {
* @return TRUE if mac generated successfully
*/
bool (*get_mac)(mac_t *this, chunk_t data,
- u_int8_t *out) __attribute__((warn_unused_result));
+ uint8_t *out) __attribute__((warn_unused_result));
/**
* Get the size of the resulting MAC.
diff --git a/src/libstrongswan/crypto/mgf1/mgf1.c b/src/libstrongswan/crypto/mgf1/mgf1.c
index 4bbcd6e99..5116dfefa 100644
--- a/src/libstrongswan/crypto/mgf1/mgf1.c
+++ b/src/libstrongswan/crypto/mgf1/mgf1.c
@@ -39,7 +39,7 @@ struct private_mgf1_t {
/**
* Counter
*/
- u_int32_t counter;
+ uint32_t counter;
/**
* Set if counter has reached 2^32
diff --git a/src/libstrongswan/crypto/nonce_gen.h b/src/libstrongswan/crypto/nonce_gen.h
index 7dae4f776..98d159e12 100644
--- a/src/libstrongswan/crypto/nonce_gen.h
+++ b/src/libstrongswan/crypto/nonce_gen.h
@@ -38,7 +38,7 @@ struct nonce_gen_t {
* @return TRUE if nonce allocation was successful, FALSE otherwise
*/
bool (*get_nonce)(nonce_gen_t *this, size_t size,
- u_int8_t *buffer) __attribute__((warn_unused_result));
+ uint8_t *buffer) __attribute__((warn_unused_result));
/**
* Generates a nonce and allocates space for it.
diff --git a/src/libstrongswan/crypto/pkcs5.c b/src/libstrongswan/crypto/pkcs5.c
index 478926f2f..8a1452425 100644
--- a/src/libstrongswan/crypto/pkcs5.c
+++ b/src/libstrongswan/crypto/pkcs5.c
@@ -41,7 +41,7 @@ struct private_pkcs5_t {
/**
* Iterations for key derivation
*/
- u_int64_t iterations;
+ uint64_t iterations;
/**
* Encryption algorithm
@@ -110,7 +110,7 @@ struct private_pkcs5_t {
*/
static bool verify_padding(crypter_t *crypter, chunk_t *blob)
{
- u_int8_t padding, count;
+ uint8_t padding, count;
padding = count = blob->ptr[blob->len - 1];
@@ -181,10 +181,10 @@ static bool pkcs12_kdf(private_pkcs5_t *this, chunk_t password, chunk_t keymat)
* Function F of PBKDF2
*/
static bool pbkdf2_f(chunk_t block, prf_t *prf, chunk_t seed,
- u_int64_t iterations)
+ uint64_t iterations)
{
chunk_t u;
- u_int64_t i;
+ uint64_t i;
u = chunk_alloca(prf->get_block_size(prf));
if (!prf->get_bytes(prf, seed, u.ptr))
@@ -212,7 +212,7 @@ static bool pbkdf2(private_pkcs5_t *this, chunk_t password, chunk_t key)
prf_t *prf;
chunk_t keymat, block, seed;
size_t blocks;
- u_int32_t i = 0;
+ uint32_t i = 0;
prf = this->data.pbes2.prf;
@@ -247,7 +247,7 @@ static bool pbkdf1(private_pkcs5_t *this, chunk_t password, chunk_t key)
{
hasher_t *hasher;
chunk_t hash;
- u_int64_t i;
+ uint64_t i;
hasher = this->data.pbes1.hasher;
diff --git a/src/libstrongswan/crypto/prf_plus.c b/src/libstrongswan/crypto/prf_plus.c
index 94be1d5bf..6b7f8f851 100644
--- a/src/libstrongswan/crypto/prf_plus.c
+++ b/src/libstrongswan/crypto/prf_plus.c
@@ -44,7 +44,7 @@ struct private_prf_plus_t {
/**
* Octet which will be appended to the seed, 0 if not used
*/
- u_int8_t counter;
+ uint8_t counter;
/**
* Already given out bytes in current buffer.
@@ -58,7 +58,7 @@ struct private_prf_plus_t {
};
METHOD(prf_plus_t, get_bytes, bool,
- private_prf_plus_t *this, size_t length, u_int8_t *buffer)
+ private_prf_plus_t *this, size_t length, uint8_t *buffer)
{
size_t round, written = 0;
diff --git a/src/libstrongswan/crypto/prf_plus.h b/src/libstrongswan/crypto/prf_plus.h
index f994dce16..2c4b8852d 100644
--- a/src/libstrongswan/crypto/prf_plus.h
+++ b/src/libstrongswan/crypto/prf_plus.h
@@ -39,7 +39,7 @@ struct prf_plus_t {
* @return TRUE if bytes generated successfully
*/
bool (*get_bytes)(prf_plus_t *this, size_t length,
- u_int8_t *buffer) __attribute__((warn_unused_result));
+ uint8_t *buffer) __attribute__((warn_unused_result));
/**
* Allocate pseudo random bytes.
diff --git a/src/libstrongswan/crypto/prfs/mac_prf.c b/src/libstrongswan/crypto/prfs/mac_prf.c
index b5f6be982..3f8eb7e5c 100644
--- a/src/libstrongswan/crypto/prfs/mac_prf.c
+++ b/src/libstrongswan/crypto/prfs/mac_prf.c
@@ -36,7 +36,7 @@ struct private_prf_t {
};
METHOD(prf_t, get_bytes, bool,
- private_prf_t *this, chunk_t seed, u_int8_t *buffer)
+ private_prf_t *this, chunk_t seed, uint8_t *buffer)
{
return this->mac->get_mac(this->mac, seed, buffer);
}
diff --git a/src/libstrongswan/crypto/prfs/prf.h b/src/libstrongswan/crypto/prfs/prf.h
index 46e23b244..bf443e5f4 100644
--- a/src/libstrongswan/crypto/prfs/prf.h
+++ b/src/libstrongswan/crypto/prfs/prf.h
@@ -80,7 +80,7 @@ struct prf_t {
* @return TRUE if bytes generated successfully
*/
bool (*get_bytes)(prf_t *this, chunk_t seed,
- u_int8_t *buffer) __attribute__((warn_unused_result));
+ uint8_t *buffer) __attribute__((warn_unused_result));
/**
* Generates pseudo random bytes and allocate space for them.
diff --git a/src/libstrongswan/crypto/proposal/proposal_keywords.c b/src/libstrongswan/crypto/proposal/proposal_keywords.c
index bbb97d088..282d40e7b 100644
--- a/src/libstrongswan/crypto/proposal/proposal_keywords.c
+++ b/src/libstrongswan/crypto/proposal/proposal_keywords.c
@@ -134,7 +134,7 @@ METHOD(proposal_keywords_t, get_token, const proposal_token_t*,
METHOD(proposal_keywords_t, register_token, void,
private_proposal_keywords_t *this, const char *name, transform_type_t type,
- u_int16_t algorithm, u_int16_t keysize)
+ uint16_t algorithm, uint16_t keysize)
{
proposal_token_t *token;
diff --git a/src/libstrongswan/crypto/proposal/proposal_keywords.h b/src/libstrongswan/crypto/proposal/proposal_keywords.h
index 5cdbafc51..856abdce6 100644
--- a/src/libstrongswan/crypto/proposal/proposal_keywords.h
+++ b/src/libstrongswan/crypto/proposal/proposal_keywords.h
@@ -69,12 +69,12 @@ struct proposal_token_t {
/**
* The IKE id of the algorithm.
*/
- u_int16_t algorithm;
+ uint16_t algorithm;
/**
* The key size associated with the specific algorithm.
*/
- u_int16_t keysize;
+ uint16_t keysize;
};
/**
@@ -100,8 +100,8 @@ struct proposal_keywords_t {
* @param keysize the key size associated with the specific algorithm
*/
void (*register_token)(proposal_keywords_t *this, const char *name,
- transform_type_t type, u_int16_t algorithm,
- u_int16_t keysize);
+ transform_type_t type, uint16_t algorithm,
+ uint16_t keysize);
/**
* Register an algorithm name parser.
diff --git a/src/libstrongswan/crypto/rngs/rng.c b/src/libstrongswan/crypto/rngs/rng.c
index f8fd50d3f..1f39dedb8 100644
--- a/src/libstrongswan/crypto/rngs/rng.c
+++ b/src/libstrongswan/crypto/rngs/rng.c
@@ -25,9 +25,9 @@ ENUM(rng_quality_names, RNG_WEAK, RNG_TRUE,
/*
* Described in header.
*/
-bool rng_get_bytes_not_zero(rng_t *rng, size_t len, u_int8_t *buffer, bool all)
+bool rng_get_bytes_not_zero(rng_t *rng, size_t len, uint8_t *buffer, bool all)
{
- u_int8_t *pos = buffer, *check = buffer + (all ? len : min(1, len));
+ uint8_t *pos = buffer, *check = buffer + (all ? len : min(1, len));
if (!rng->get_bytes(rng, len, pos))
{
diff --git a/src/libstrongswan/crypto/rngs/rng.h b/src/libstrongswan/crypto/rngs/rng.h
index aee829d71..0ca2cb114 100644
--- a/src/libstrongswan/crypto/rngs/rng.h
+++ b/src/libstrongswan/crypto/rngs/rng.h
@@ -57,7 +57,7 @@ struct rng_t {
* @return TRUE if bytes successfully written
*/
bool (*get_bytes)(rng_t *this, size_t len,
- u_int8_t *buffer) __attribute__((warn_unused_result));
+ uint8_t *buffer) __attribute__((warn_unused_result));
/**
* Generates random bytes and allocate space for them.
@@ -85,7 +85,7 @@ struct rng_t {
* @param all TRUE if all bytes have to be non-zero, FALSE for first
* @return TRUE if bytes successfully written
*/
-bool rng_get_bytes_not_zero(rng_t *rng, size_t len, u_int8_t *buffer,
+bool rng_get_bytes_not_zero(rng_t *rng, size_t len, uint8_t *buffer,
bool all) __attribute__((warn_unused_result));
/**
diff --git a/src/libstrongswan/crypto/signers/mac_signer.c b/src/libstrongswan/crypto/signers/mac_signer.c
index 1094c4473..4426782b4 100644
--- a/src/libstrongswan/crypto/signers/mac_signer.c
+++ b/src/libstrongswan/crypto/signers/mac_signer.c
@@ -41,11 +41,11 @@ struct private_signer_t {
};
METHOD(signer_t, get_signature, bool,
- private_signer_t *this, chunk_t data, u_int8_t *buffer)
+ private_signer_t *this, chunk_t data, uint8_t *buffer)
{
if (buffer)
{
- u_int8_t mac[this->mac->get_mac_size(this->mac)];
+ uint8_t mac[this->mac->get_mac_size(this->mac)];
if (!this->mac->get_mac(this->mac, data, mac))
{
@@ -62,7 +62,7 @@ METHOD(signer_t, allocate_signature, bool,
{
if (chunk)
{
- u_int8_t mac[this->mac->get_mac_size(this->mac)];
+ uint8_t mac[this->mac->get_mac_size(this->mac)];
if (!this->mac->get_mac(this->mac, data, mac))
{
@@ -78,7 +78,7 @@ METHOD(signer_t, allocate_signature, bool,
METHOD(signer_t, verify_signature, bool,
private_signer_t *this, chunk_t data, chunk_t signature)
{
- u_int8_t mac[this->mac->get_mac_size(this->mac)];
+ uint8_t mac[this->mac->get_mac_size(this->mac)];
if (signature.len != this->truncation)
{
diff --git a/src/libstrongswan/crypto/signers/signer.h b/src/libstrongswan/crypto/signers/signer.h
index e0cf7eb5a..01b702da1 100644
--- a/src/libstrongswan/crypto/signers/signer.h
+++ b/src/libstrongswan/crypto/signers/signer.h
@@ -96,7 +96,7 @@ struct signer_t {
* @return TRUE if signature created successfully
*/
bool (*get_signature)(signer_t *this, chunk_t data,
- u_int8_t *buffer) __attribute__((warn_unused_result));
+ uint8_t *buffer) __attribute__((warn_unused_result));
/**
* Generate a signature and allocate space for it.
diff --git a/src/libstrongswan/eap/eap.h b/src/libstrongswan/eap/eap.h
index 08d88ba88..2d4a238cd 100644
--- a/src/libstrongswan/eap/eap.h
+++ b/src/libstrongswan/eap/eap.h
@@ -99,18 +99,18 @@ struct eap_vendor_type_t {
/**
* Vendor Id
*/
- u_int32_t vendor;
+ uint32_t vendor;
};
/**
* EAP packet format
*/
typedef struct __attribute__((packed)) {
- u_int8_t code;
- u_int8_t identifier;
- u_int16_t length;
- u_int8_t type;
- u_int8_t data;
+ uint8_t code;
+ uint8_t identifier;
+ uint16_t length;
+ uint8_t type;
+ uint8_t data;
} eap_packet_t;
/**
diff --git a/src/libstrongswan/ipsec/ipsec_types.h b/src/libstrongswan/ipsec/ipsec_types.h
index fa122af30..cbc0d089b 100644
--- a/src/libstrongswan/ipsec/ipsec_types.h
+++ b/src/libstrongswan/ipsec/ipsec_types.h
@@ -123,22 +123,22 @@ struct ipsec_sa_cfg_t {
/** mode of SA (tunnel, transport) */
ipsec_mode_t mode;
/** unique ID */
- u_int32_t reqid;
+ uint32_t reqid;
/** number of policies of the same kind (in/out/fwd) attached to SA */
- u_int32_t policy_count;
+ uint32_t policy_count;
/** details about ESP/AH */
struct {
/** TRUE if this protocol is used */
bool use;
/** SPI for ESP/AH */
- u_int32_t spi;
+ uint32_t spi;
} esp, ah;
/** details about IPComp */
struct {
/** the IPComp transform used */
- u_int16_t transform;
+ uint16_t transform;
/** CPI for IPComp */
- u_int16_t cpi;
+ uint16_t cpi;
} ipcomp;
};
@@ -150,11 +150,11 @@ struct ipsec_sa_cfg_t {
struct lifetime_cfg_t {
struct {
/** Limit before the SA gets invalid. */
- u_int64_t life;
+ uint64_t life;
/** Limit before the SA gets rekeyed. */
- u_int64_t rekey;
+ uint64_t rekey;
/** The range of a random value subtracted from rekey. */
- u_int64_t jitter;
+ uint64_t jitter;
} time, bytes, packets;
};
@@ -163,9 +163,9 @@ struct lifetime_cfg_t {
*/
struct mark_t {
/** Mark value */
- u_int32_t value;
+ uint32_t value;
/** Mark mask */
- u_int32_t mask;
+ uint32_t mask;
};
/**
diff --git a/src/libstrongswan/networking/host.c b/src/libstrongswan/networking/host.c
index 2e464b0ad..b71d2da16 100644
--- a/src/libstrongswan/networking/host.c
+++ b/src/libstrongswan/networking/host.c
@@ -79,7 +79,7 @@ METHOD(host_t, get_sockaddr_len, socklen_t*,
METHOD(host_t, is_anyaddr, bool,
private_host_t *this)
{
- static const u_int8_t zeroes[IPV6_LEN];
+ static const uint8_t zeroes[IPV6_LEN];
switch (this->address.sa_family)
{
@@ -119,7 +119,7 @@ int host_printf_hook(printf_hook_data_t *data, printf_hook_spec_t *spec,
else
{
void *address;
- u_int16_t port;
+ uint16_t port;
int len;
address = &this->address6.sin6_addr;
@@ -191,7 +191,7 @@ METHOD(host_t, get_family, int,
return this->address.sa_family;
}
-METHOD(host_t, get_port, u_int16_t,
+METHOD(host_t, get_port, uint16_t,
private_host_t *this)
{
switch (this->address.sa_family)
@@ -212,7 +212,7 @@ METHOD(host_t, get_port, u_int16_t,
}
METHOD(host_t, set_port, void,
- private_host_t *this, u_int16_t port)
+ private_host_t *this, uint16_t port)
{
switch (this->address.sa_family)
{
@@ -334,7 +334,7 @@ static private_host_t *host_create_empty(void)
/*
* Create a %any host with port
*/
-static host_t *host_create_any_port(int family, u_int16_t port)
+static host_t *host_create_any_port(int family, uint16_t port)
{
host_t *this;
@@ -347,7 +347,7 @@ static host_t *host_create_any_port(int family, u_int16_t port)
* Described in header.
*/
host_t *host_create_from_string_and_family(char *string, int family,
- u_int16_t port)
+ uint16_t port)
{
union {
struct sockaddr_in v4;
@@ -415,7 +415,7 @@ host_t *host_create_from_string_and_family(char *string, int family,
/*
* Described in header.
*/
-host_t *host_create_from_string(char *string, u_int16_t port)
+host_t *host_create_from_string(char *string, uint16_t port)
{
return host_create_from_string_and_family(string, AF_UNSPEC, port);
}
@@ -455,7 +455,7 @@ host_t *host_create_from_sockaddr(sockaddr_t *sockaddr)
/*
* Described in header.
*/
-host_t *host_create_from_dns(char *string, int af, u_int16_t port)
+host_t *host_create_from_dns(char *string, int af, uint16_t port)
{
host_t *this;
@@ -474,7 +474,7 @@ host_t *host_create_from_dns(char *string, int af, u_int16_t port)
/*
* Described in header.
*/
-host_t *host_create_from_chunk(int family, chunk_t address, u_int16_t port)
+host_t *host_create_from_chunk(int family, chunk_t address, uint16_t port)
{
private_host_t *this;
@@ -646,7 +646,7 @@ host_t *host_create_netmask(int family, int netbits)
if (bytes < len)
{
memset(target + bytes, 0x00, len - bytes);
- target[bytes] = (u_int8_t)(0xff << bits);
+ target[bytes] = (uint8_t)(0xff << bits);
}
return &this->public;
}
diff --git a/src/libstrongswan/networking/host.h b/src/libstrongswan/networking/host.h
index db6f4dd49..a777f9f97 100644
--- a/src/libstrongswan/networking/host.h
+++ b/src/libstrongswan/networking/host.h
@@ -99,14 +99,14 @@ struct host_t {
*
* @return port number
*/
- u_int16_t (*get_port) (host_t *this);
+ uint16_t (*get_port) (host_t *this);
/**
* Set the port of this host
*
* @param port port number
*/
- void (*set_port) (host_t *this, u_int16_t port);
+ void (*set_port) (host_t *this, uint16_t port);
/**
* Compare the ips of two hosts hosts.
@@ -137,7 +137,7 @@ struct host_t {
* @param port port number
* @return host_t, NULL if string not an address.
*/
-host_t *host_create_from_string(char *string, u_int16_t port);
+host_t *host_create_from_string(char *string, uint16_t port);
/**
* Same as host_create_from_string(), but with the option to enforce a family.
@@ -148,7 +148,7 @@ host_t *host_create_from_string(char *string, u_int16_t port);
* @return host_t, NULL if string not an address.
*/
host_t *host_create_from_string_and_family(char *string, int family,
- u_int16_t port);
+ uint16_t port);
/**
* Constructor to create a host_t from a DNS name.
@@ -158,7 +158,7 @@ host_t *host_create_from_string_and_family(char *string, int family,
* @param port port number
* @return host_t, NULL lookup failed
*/
-host_t *host_create_from_dns(char *string, int family, u_int16_t port);
+host_t *host_create_from_dns(char *string, int family, uint16_t port);
/**
* Constructor to create a host_t object from an address chunk.
@@ -170,7 +170,7 @@ host_t *host_create_from_dns(char *string, int family, u_int16_t port);
* @param port port number
* @return host_t, NULL if family not supported/chunk invalid
*/
-host_t *host_create_from_chunk(int family, chunk_t address, u_int16_t port);
+host_t *host_create_from_chunk(int family, chunk_t address, uint16_t port);
/**
* Constructor to create a host_t object from a sockaddr struct
diff --git a/src/libstrongswan/networking/packet.c b/src/libstrongswan/networking/packet.c
index 4ff7fc48b..f76a85a4b 100644
--- a/src/libstrongswan/networking/packet.c
+++ b/src/libstrongswan/networking/packet.c
@@ -42,7 +42,7 @@ struct private_packet_t {
/**
* DSCP value on packet
*/
- u_int8_t dscp;
+ uint8_t dscp;
/**
* message data
@@ -94,13 +94,13 @@ METHOD(packet_t, set_data, void,
this->adjusted_data = this->data = data;
}
-METHOD(packet_t, get_dscp, u_int8_t,
+METHOD(packet_t, get_dscp, uint8_t,
private_packet_t *this)
{
return this->dscp;
}
METHOD(packet_t, set_dscp, void,
- private_packet_t *this, u_int8_t value)
+ private_packet_t *this, uint8_t value)
{
this->dscp = value;
}
diff --git a/src/libstrongswan/networking/packet.h b/src/libstrongswan/networking/packet.h
index 1492dd0b9..8699d4abe 100644
--- a/src/libstrongswan/networking/packet.h
+++ b/src/libstrongswan/networking/packet.h
@@ -85,14 +85,14 @@ struct packet_t {
*
* @return DSCP value
*/
- u_int8_t (*get_dscp)(packet_t *this);
+ uint8_t (*get_dscp)(packet_t *this);
/**
* Set the DiffServ Code Point to use on this packet.
*
* @param value DSCP value
*/
- void (*set_dscp)(packet_t *this, u_int8_t value);
+ void (*set_dscp)(packet_t *this, uint8_t value);
/**
* Increase the offset where the actual packet data starts.
diff --git a/src/libstrongswan/networking/tun_device.c b/src/libstrongswan/networking/tun_device.c
index 81d215677..de925553f 100644
--- a/src/libstrongswan/networking/tun_device.c
+++ b/src/libstrongswan/networking/tun_device.c
@@ -96,7 +96,7 @@ struct private_tun_device_t {
/**
* Netmask for address
*/
- u_int8_t netmask;
+ uint8_t netmask;
};
/**
@@ -105,7 +105,7 @@ struct private_tun_device_t {
#if __FreeBSD__ >= 10
static bool set_address_and_mask(struct in_aliasreq *ifra, host_t *addr,
- u_int8_t netmask)
+ uint8_t netmask)
{
host_t *mask;
@@ -132,7 +132,7 @@ static bool set_address_and_mask(struct in_aliasreq *ifra, host_t *addr,
* on FreeBSD 10 an newer.
*/
static bool set_address_impl(private_tun_device_t *this, host_t *addr,
- u_int8_t netmask)
+ uint8_t netmask)
{
struct in_aliasreq ifra;
@@ -171,7 +171,7 @@ static bool set_address_impl(private_tun_device_t *this, host_t *addr,
* Set the address using the classic SIOCSIFADDR etc. commands on other systems.
*/
static bool set_address_impl(private_tun_device_t *this, host_t *addr,
- u_int8_t netmask)
+ uint8_t netmask)
{
struct ifreq ifr;
host_t *mask;
@@ -218,7 +218,7 @@ static bool set_address_impl(private_tun_device_t *this, host_t *addr,
#endif /* __FreeBSD__ */
METHOD(tun_device_t, set_address, bool,
- private_tun_device_t *this, host_t *addr, u_int8_t netmask)
+ private_tun_device_t *this, host_t *addr, uint8_t netmask)
{
if (!set_address_impl(this, addr, netmask))
{
@@ -231,7 +231,7 @@ METHOD(tun_device_t, set_address, bool,
}
METHOD(tun_device_t, get_address, host_t*,
- private_tun_device_t *this, u_int8_t *netmask)
+ private_tun_device_t *this, uint8_t *netmask)
{
if (netmask && this->address)
{
@@ -326,7 +326,7 @@ METHOD(tun_device_t, write_packet, bool,
#ifdef __APPLE__
/* UTUN's expect the packets to be prepended by a 32-bit protocol number
* instead of parsing the packet again, we assume IPv4 for now */
- u_int32_t proto = htonl(AF_INET);
+ uint32_t proto = htonl(AF_INET);
packet = chunk_cata("cc", chunk_from_thing(proto), packet);
#endif
s = write(this->tunfd, packet.ptr, packet.len);
@@ -364,7 +364,7 @@ METHOD(tun_device_t, read_packet, bool,
data.len = len;
#ifdef __APPLE__
/* UTUN's prepend packets with a 32-bit protocol number */
- data = chunk_skip(data, sizeof(u_int32_t));
+ data = chunk_skip(data, sizeof(uint32_t));
#endif
*packet = chunk_clone(data);
return TRUE;
diff --git a/src/libstrongswan/networking/tun_device.h b/src/libstrongswan/networking/tun_device.h
index 880369ba7..4f9eacb07 100644
--- a/src/libstrongswan/networking/tun_device.h
+++ b/src/libstrongswan/networking/tun_device.h
@@ -60,7 +60,7 @@ struct tun_device_t {
* @param netmask the netmask to use
* @return TRUE if operation successful
*/
- bool (*set_address)(tun_device_t *this, host_t *addr, u_int8_t netmask);
+ bool (*set_address)(tun_device_t *this, host_t *addr, uint8_t netmask);
/**
* Get the IP address previously assigned to using set_address().
@@ -68,7 +68,7 @@ struct tun_device_t {
* @param netmask pointer receiving the configured netmask, or NULL
* @return address previously set, NULL if none
*/
- host_t* (*get_address)(tun_device_t *this, u_int8_t *netmask);
+ host_t* (*get_address)(tun_device_t *this, uint8_t *netmask);
/**
* Bring the TUN device up
diff --git a/src/libstrongswan/pen/pen.h b/src/libstrongswan/pen/pen.h
index 2c5592330..50e63f7be 100644
--- a/src/libstrongswan/pen/pen.h
+++ b/src/libstrongswan/pen/pen.h
@@ -59,7 +59,7 @@ enum pen_t {
*/
struct pen_type_t {
pen_t vendor_id;
- u_int32_t type;
+ uint32_t type;
};
/**
@@ -69,7 +69,7 @@ struct pen_type_t {
* @param type type to create a pen_type_t
* @return created pen_type_t
*/
-static inline pen_type_t pen_type_create(pen_t vendor_id, u_int32_t type)
+static inline pen_type_t pen_type_create(pen_t vendor_id, uint32_t type)
{
pen_type_t pen_type = { vendor_id, type };
return pen_type;
@@ -96,7 +96,7 @@ static inline bool pen_type_equals(pen_type_t a, pen_type_t b)
* @return TRUE if vendor_id and type matches pen_type
*/
static inline bool pen_type_is(pen_type_t pen_type,
- pen_t vendor_id, u_int32_t type)
+ pen_t vendor_id, uint32_t type)
{
return pen_type.vendor_id == vendor_id && pen_type.type == type;
}
diff --git a/src/libstrongswan/plugins/aes/aes_crypter.c b/src/libstrongswan/plugins/aes/aes_crypter.c
index f9775c8b8..8829ba162 100644
--- a/src/libstrongswan/plugins/aes/aes_crypter.c
+++ b/src/libstrongswan/plugins/aes/aes_crypter.c
@@ -49,27 +49,27 @@ struct private_aes_crypter_t {
/**
* Number of words in the key input block.
*/
- u_int32_t aes_Nkey;
+ uint32_t aes_Nkey;
/**
* The number of cipher rounds.
*/
- u_int32_t aes_Nrnd;
+ uint32_t aes_Nrnd;
/**
* The encryption key schedule.
*/
- u_int32_t aes_e_key[AES_KS_LENGTH];
+ uint32_t aes_e_key[AES_KS_LENGTH];
/**
* The decryption key schedule.
*/
- u_int32_t aes_d_key[AES_KS_LENGTH];
+ uint32_t aes_d_key[AES_KS_LENGTH];
/**
* Key size of this AES cypher object.
*/
- u_int32_t key_size;
+ uint32_t key_size;
};
/**
@@ -88,7 +88,7 @@ struct private_aes_crypter_t {
*/
#define bval(x,n) ((unsigned char)((x) >> 8 * (n)))
#define bytes2word(b0, b1, b2, b3) \
- ((u_int32_t)(b3) << 24 | (u_int32_t)(b2) << 16 | (u_int32_t)(b1) << 8 | (b0))
+ ((uint32_t)(b3) << 24 | (uint32_t)(b2) << 16 | (uint32_t)(b1) << 8 | (b0))
/* little endian processor without data alignment restrictions: AES_LE_OK */
@@ -105,15 +105,15 @@ struct private_aes_crypter_t {
#ifdef AES_LE_OK
/* little endian processor without data alignment restrictions */
-#define word_in(x) *(u_int32_t*)(x)
-#define const_word_in(x) *(const u_int32_t*)(x)
-#define word_out(x,v) *(u_int32_t*)(x) = (v)
-#define const_word_out(x,v) *(const u_int32_t*)(x) = (v)
+#define word_in(x) *(uint32_t*)(x)
+#define const_word_in(x) *(const uint32_t*)(x)
+#define word_out(x,v) *(uint32_t*)(x) = (v)
+#define const_word_out(x,v) *(const uint32_t*)(x) = (v)
#else
/* slower but generic big endian or with data alignment restrictions */
/* some additional "const" touches to stop "gcc -Wcast-qual" complains --jjo */
-#define word_in(x) ((u_int32_t)(((unsigned char *)(x))[0])|((u_int32_t)(((unsigned char *)(x))[1])<<8)|((u_int32_t)(((unsigned char *)(x))[2])<<16)|((u_int32_t)(((unsigned char *)(x))[3])<<24))
-#define const_word_in(x) ((const u_int32_t)(((const unsigned char *)(x))[0])|((const u_int32_t)(((const unsigned char *)(x))[1])<<8)|((const u_int32_t)(((const unsigned char *)(x))[2])<<16)|((const u_int32_t)(((const unsigned char *)(x))[3])<<24))
+#define word_in(x) ((uint32_t)(((unsigned char *)(x))[0])|((uint32_t)(((unsigned char *)(x))[1])<<8)|((uint32_t)(((unsigned char *)(x))[2])<<16)|((uint32_t)(((unsigned char *)(x))[3])<<24))
+#define const_word_in(x) ((const uint32_t)(((const unsigned char *)(x))[0])|((const uint32_t)(((const unsigned char *)(x))[1])<<8)|((const uint32_t)(((const unsigned char *)(x))[2])<<16)|((const uint32_t)(((const unsigned char *)(x))[3])<<24))
#define word_out(x,v) ((unsigned char *)(x))[0]=(v),((unsigned char *)(x))[1]=((v)>>8),((unsigned char *)(x))[2]=((v)>>16),((unsigned char *)(x))[3]=((v)>>24)
#define const_word_out(x,v) ((const unsigned char *)(x))[0]=(v),((const unsigned char *)(x))[1]=((v)>>8),((const unsigned char *)(x))[2]=((v)>>16),((const unsigned char *)(x))[3]=((v)>>24)
#endif
@@ -156,7 +156,7 @@ struct private_aes_crypter_t {
// this table can be a table of bytes if the key schedule
// code is adjusted accordingly
-static const u_int32_t rcon_tab[29] =
+static const uint32_t rcon_tab[29] =
{
w0(01), w0(02), w0(04), w0(08),
w0(10), w0(20), w0(40), w0(80),
@@ -320,7 +320,7 @@ static const u_int32_t rcon_tab[29] =
#undef r
#define r r0
-static const u_int32_t ft_tab[4][256] =
+static const uint32_t ft_tab[4][256] =
{ { f_table },
#undef r
#define r r1
@@ -335,7 +335,7 @@ static const u_int32_t ft_tab[4][256] =
#undef r
#define r r0
-static const u_int32_t it_tab[4][256] =
+static const uint32_t it_tab[4][256] =
{ { i_table },
#undef r
#define r r1
@@ -386,7 +386,7 @@ static const u_int32_t it_tab[4][256] =
#undef r
#define r(p,q,r,s) w0(q)
-static const u_int32_t fl_tab[4][256] =
+static const uint32_t fl_tab[4][256] =
{ { f_table },
#undef r
#define r(p,q,r,s) w1(q)
@@ -401,7 +401,7 @@ static const u_int32_t fl_tab[4][256] =
#undef w
#define w w0
-static const u_int32_t il_tab[4][256] =
+static const uint32_t il_tab[4][256] =
{ { li_table },
#undef w
#define w w1
@@ -483,7 +483,7 @@ static const u_int32_t il_tab[4][256] =
#undef r
#define r r0
-static const u_int32_t im_tab[4][256] =
+static const uint32_t im_tab[4][256] =
{ { m_table },
#undef r
#define r r1
@@ -717,8 +717,8 @@ static const u_int32_t im_tab[4][256] =
static void encrypt_block(const private_aes_crypter_t *this,
const unsigned char in_blk[], unsigned char out_blk[])
{
- u_int32_t locals(b0, b1);
- const u_int32_t *kp = this->aes_e_key;
+ uint32_t locals(b0, b1);
+ const uint32_t *kp = this->aes_e_key;
state_in(b0, in_blk, kp); kp += nc;
@@ -754,8 +754,8 @@ static void encrypt_block(const private_aes_crypter_t *this,
static void decrypt_block(const private_aes_crypter_t *this,
const unsigned char in_blk[], unsigned char out_blk[])
{
- u_int32_t locals(b0, b1);
- const u_int32_t *kp = this->aes_d_key;
+ uint32_t locals(b0, b1);
+ const uint32_t *kp = this->aes_d_key;
state_in(b0, in_blk, kp); kp += nc;
@@ -789,8 +789,8 @@ METHOD(crypter_t, decrypt, bool,
private_aes_crypter_t *this, chunk_t data, chunk_t iv, chunk_t *decrypted)
{
int pos;
- const u_int32_t *iv_i;
- u_int8_t *in, *out;
+ const uint32_t *iv_i;
+ uint8_t *in, *out;
if (decrypted)
{
@@ -811,16 +811,16 @@ METHOD(crypter_t, decrypt, bool,
decrypt_block(this, in, out);
if (pos==0)
{
- iv_i=(const u_int32_t*) (iv.ptr);
+ iv_i=(const uint32_t*) (iv.ptr);
}
else
{
- iv_i=(const u_int32_t*) (in-16);
+ iv_i=(const uint32_t*) (in-16);
}
- *((u_int32_t *)(&out[ 0])) ^= iv_i[0];
- *((u_int32_t *)(&out[ 4])) ^= iv_i[1];
- *((u_int32_t *)(&out[ 8])) ^= iv_i[2];
- *((u_int32_t *)(&out[12])) ^= iv_i[3];
+ *((uint32_t *)(&out[ 0])) ^= iv_i[0];
+ *((uint32_t *)(&out[ 4])) ^= iv_i[1];
+ *((uint32_t *)(&out[ 8])) ^= iv_i[2];
+ *((uint32_t *)(&out[12])) ^= iv_i[3];
in-=16;
out-=16;
pos-=16;
@@ -832,8 +832,8 @@ METHOD(crypter_t, encrypt, bool,
private_aes_crypter_t *this, chunk_t data, chunk_t iv, chunk_t *encrypted)
{
int pos;
- const u_int32_t *iv_i;
- u_int8_t *in, *out;
+ const uint32_t *iv_i;
+ uint8_t *in, *out;
in = data.ptr;
out = data.ptr;
@@ -848,16 +848,16 @@ METHOD(crypter_t, encrypt, bool,
{
if (pos==0)
{
- iv_i=(const u_int32_t*) iv.ptr;
+ iv_i=(const uint32_t*) iv.ptr;
}
else
{
- iv_i=(const u_int32_t*) (out-16);
+ iv_i=(const uint32_t*) (out-16);
}
- *((u_int32_t *)(&out[ 0])) = iv_i[0]^*((const u_int32_t *)(&in[ 0]));
- *((u_int32_t *)(&out[ 4])) = iv_i[1]^*((const u_int32_t *)(&in[ 4]));
- *((u_int32_t *)(&out[ 8])) = iv_i[2]^*((const u_int32_t *)(&in[ 8]));
- *((u_int32_t *)(&out[12])) = iv_i[3]^*((const u_int32_t *)(&in[12]));
+ *((uint32_t *)(&out[ 0])) = iv_i[0]^*((const uint32_t *)(&in[ 0]));
+ *((uint32_t *)(&out[ 4])) = iv_i[1]^*((const uint32_t *)(&in[ 4]));
+ *((uint32_t *)(&out[ 8])) = iv_i[2]^*((const uint32_t *)(&in[ 8]));
+ *((uint32_t *)(&out[12])) = iv_i[3]^*((const uint32_t *)(&in[12]));
encrypt_block(this, out, out);
in+=16;
out+=16;
@@ -887,8 +887,8 @@ METHOD(crypter_t, get_key_size, size_t,
METHOD(crypter_t, set_key, bool,
private_aes_crypter_t *this, chunk_t key)
{
- u_int32_t *kf, *kt, rci, f = 0;
- u_int8_t *in_key = key.ptr;
+ uint32_t *kf, *kt, rci, f = 0;
+ uint8_t *in_key = key.ptr;
this->aes_Nrnd = (this->aes_Nkey > (nc) ? this->aes_Nkey : (nc)) + 6;
@@ -948,7 +948,7 @@ METHOD(crypter_t, set_key, bool,
if(!f)
{
- u_int32_t i;
+ uint32_t i;
kt = this->aes_d_key + nc * this->aes_Nrnd;
kf = this->aes_e_key;
diff --git a/src/libstrongswan/plugins/aesni/aesni_ccm.c b/src/libstrongswan/plugins/aesni/aesni_ccm.c
index d523bc17a..12074860e 100644
--- a/src/libstrongswan/plugins/aesni/aesni_ccm.c
+++ b/src/libstrongswan/plugins/aesni/aesni_ccm.c
@@ -83,7 +83,7 @@ struct private_aesni_ccm_t {
* First block with control information
*/
typedef struct __attribute__((packed)) {
- BITFIELD4(u_int8_t,
+ BITFIELD4(uint8_t,
/* size of p length field q, as q-1 */
q_len: 3,
/* size of our ICV t, as (t-2)/2 */
@@ -105,7 +105,7 @@ typedef struct __attribute__((packed)) {
* Counter block
*/
typedef struct __attribute__((packed)) {
- BITFIELD3(u_int8_t,
+ BITFIELD3(uint8_t,
/* size of p length field q, as q-1 */
q_len: 3,
zero: 3,
@@ -140,7 +140,7 @@ static void build_b0(private_aesni_ccm_t *this, size_t len, size_t alen,
/**
* Build a counter block for counter i
*/
-static void build_ctr(private_aesni_ccm_t *this, u_int32_t i, u_char *iv,
+static void build_ctr(private_aesni_ccm_t *this, uint32_t i, u_char *iv,
void *out)
{
ctr_t *ctr = out;
@@ -157,7 +157,7 @@ static void build_ctr(private_aesni_ccm_t *this, u_int32_t i, u_char *iv,
* Calculate the ICV for the b0 and associated data
*/
static __m128i icv_header(private_aesni_ccm_t *this, size_t len, u_char *iv,
- u_int16_t alen, u_char *assoc)
+ uint16_t alen, u_char *assoc)
{
__m128i *ks, b, t, c;
u_int i, round, blocks, rem;
diff --git a/src/libstrongswan/plugins/aesni/aesni_cmac.c b/src/libstrongswan/plugins/aesni/aesni_cmac.c
index d6a87e6d7..07580c822 100644
--- a/src/libstrongswan/plugins/aesni/aesni_cmac.c
+++ b/src/libstrongswan/plugins/aesni/aesni_cmac.c
@@ -65,7 +65,7 @@ struct private_mac_t {
};
METHOD(mac_t, get_mac, bool,
- private_mac_t *this, chunk_t data, u_int8_t *out)
+ private_mac_t *this, chunk_t data, uint8_t *out)
{
__m128i *ks, t, l, *bi;
u_int blocks, rem, i;
diff --git a/src/libstrongswan/plugins/aesni/aesni_ctr.c b/src/libstrongswan/plugins/aesni/aesni_ctr.c
index 989813814..d9a555a85 100644
--- a/src/libstrongswan/plugins/aesni/aesni_ctr.c
+++ b/src/libstrongswan/plugins/aesni/aesni_ctr.c
@@ -61,7 +61,7 @@ struct private_aesni_ctr_t {
struct {
char nonce[4];
char iv[8];
- u_int32_t counter;
+ uint32_t counter;
} __attribute__((packed, aligned(sizeof(__m128i)))) state;
};
diff --git a/src/libstrongswan/plugins/aesni/aesni_gcm.c b/src/libstrongswan/plugins/aesni/aesni_gcm.c
index 53c0b144e..330dc6cd3 100644
--- a/src/libstrongswan/plugins/aesni/aesni_gcm.c
+++ b/src/libstrongswan/plugins/aesni/aesni_gcm.c
@@ -316,7 +316,7 @@ static __m128i icv_tailer(private_aesni_gcm_t *this, __m128i y,
__m128i b;
htoun64(&b, alen * 8);
- htoun64((u_char*)&b + sizeof(u_int64_t), dlen * 8);
+ htoun64((u_char*)&b + sizeof(uint64_t), dlen * 8);
return ghash(this->h, y, b);
}
diff --git a/src/libstrongswan/plugins/aesni/aesni_xcbc.c b/src/libstrongswan/plugins/aesni/aesni_xcbc.c
index 24a75cec0..974c5fedc 100644
--- a/src/libstrongswan/plugins/aesni/aesni_xcbc.c
+++ b/src/libstrongswan/plugins/aesni/aesni_xcbc.c
@@ -70,7 +70,7 @@ struct private_aesni_mac_t {
};
METHOD(mac_t, get_mac, bool,
- private_aesni_mac_t *this, chunk_t data, u_int8_t *out)
+ private_aesni_mac_t *this, chunk_t data, uint8_t *out)
{
__m128i *ks, e, *bi;
u_int blocks, rem, i;
diff --git a/src/libstrongswan/plugins/af_alg/af_alg_hasher.c b/src/libstrongswan/plugins/af_alg/af_alg_hasher.c
index 611975533..62fea51cc 100644
--- a/src/libstrongswan/plugins/af_alg/af_alg_hasher.c
+++ b/src/libstrongswan/plugins/af_alg/af_alg_hasher.c
@@ -107,7 +107,7 @@ METHOD(hasher_t, reset, bool,
}
METHOD(hasher_t, get_hash, bool,
- private_af_alg_hasher_t *this, chunk_t chunk, u_int8_t *hash)
+ private_af_alg_hasher_t *this, chunk_t chunk, uint8_t *hash)
{
return this->ops->hash(this->ops, chunk, hash, this->size);
}
diff --git a/src/libstrongswan/plugins/af_alg/af_alg_ops.c b/src/libstrongswan/plugins/af_alg/af_alg_ops.c
index 331d1e801..7e129300f 100644
--- a/src/libstrongswan/plugins/af_alg/af_alg_ops.c
+++ b/src/libstrongswan/plugins/af_alg/af_alg_ops.c
@@ -108,7 +108,7 @@ METHOD(af_alg_ops_t, hash, bool,
}
METHOD(af_alg_ops_t, crypt, bool,
- private_af_alg_ops_t *this, u_int32_t type, chunk_t iv, chunk_t data,
+ private_af_alg_ops_t *this, uint32_t type, chunk_t iv, chunk_t data,
char *out)
{
struct msghdr msg = {};
diff --git a/src/libstrongswan/plugins/af_alg/af_alg_ops.h b/src/libstrongswan/plugins/af_alg/af_alg_ops.h
index e34f22977..51342d71c 100644
--- a/src/libstrongswan/plugins/af_alg/af_alg_ops.h
+++ b/src/libstrongswan/plugins/af_alg/af_alg_ops.h
@@ -64,7 +64,7 @@ struct af_alg_ops_t {
* @param out buffer write processed data to
* @return TRUE if successful
*/
- bool (*crypt)(af_alg_ops_t *this, u_int32_t type, chunk_t iv, chunk_t data,
+ bool (*crypt)(af_alg_ops_t *this, uint32_t type, chunk_t iv, chunk_t data,
char *out);
/**
diff --git a/src/libstrongswan/plugins/af_alg/af_alg_prf.c b/src/libstrongswan/plugins/af_alg/af_alg_prf.c
index 2b7d51376..8c3627a22 100644
--- a/src/libstrongswan/plugins/af_alg/af_alg_prf.c
+++ b/src/libstrongswan/plugins/af_alg/af_alg_prf.c
@@ -106,7 +106,7 @@ static size_t lookup_alg(pseudo_random_function_t algo, char **name, bool *xcbc)
}
METHOD(prf_t, get_bytes, bool,
- private_af_alg_prf_t *this, chunk_t seed, u_int8_t *buffer)
+ private_af_alg_prf_t *this, chunk_t seed, uint8_t *buffer)
{
return this->ops->hash(this->ops, seed, buffer, this->block_size);
}
diff --git a/src/libstrongswan/plugins/af_alg/af_alg_signer.c b/src/libstrongswan/plugins/af_alg/af_alg_signer.c
index 1403144ab..e54b457e7 100644
--- a/src/libstrongswan/plugins/af_alg/af_alg_signer.c
+++ b/src/libstrongswan/plugins/af_alg/af_alg_signer.c
@@ -109,7 +109,7 @@ static size_t lookup_alg(integrity_algorithm_t algo, char **name,
}
METHOD(signer_t, get_signature, bool,
- private_af_alg_signer_t *this, chunk_t data, u_int8_t *buffer)
+ private_af_alg_signer_t *this, chunk_t data, uint8_t *buffer)
{
return this->ops->hash(this->ops, data, buffer, this->block_size);
}
diff --git a/src/libstrongswan/plugins/agent/agent_private_key.c b/src/libstrongswan/plugins/agent/agent_private_key.c
index c2e82a9f1..bb55c45c0 100644
--- a/src/libstrongswan/plugins/agent/agent_private_key.c
+++ b/src/libstrongswan/plugins/agent/agent_private_key.c
@@ -98,18 +98,18 @@ static u_char read_byte(chunk_t *blob)
}
/**
- * read a u_int32_t from a blob
+ * read a uint32_t from a blob
*/
-static u_int32_t read_uint32(chunk_t *blob)
+static uint32_t read_uint32(chunk_t *blob)
{
- u_int32_t val;
+ uint32_t val;
- if (blob->len < sizeof(u_int32_t))
+ if (blob->len < sizeof(uint32_t))
{
return 0;
}
- val = ntohl(*(u_int32_t*)blob->ptr);
- *blob = chunk_skip(*blob, sizeof(u_int32_t));
+ val = ntohl(*(uint32_t*)blob->ptr);
+ *blob = chunk_skip(*blob, sizeof(uint32_t));
return val;
}
@@ -182,7 +182,7 @@ static bool read_key(private_agent_private_key_t *this, public_key_t *pubkey)
blob = chunk_create(buf, sizeof(buf));
blob.len = read(this->socket, blob.ptr, blob.len);
- if (blob.len < sizeof(u_int32_t) + sizeof(u_char) ||
+ if (blob.len < sizeof(uint32_t) + sizeof(u_char) ||
read_uint32(&blob) != blob.len ||
read_byte(&blob) != SSH_AGENT_ID_RESPONSE)
{
@@ -236,7 +236,7 @@ METHOD(private_key_t, sign, bool,
private_agent_private_key_t *this, signature_scheme_t scheme,
chunk_t data, chunk_t *signature)
{
- u_int32_t len, flags;
+ uint32_t len, flags;
char buf[2048];
chunk_t blob;
@@ -247,7 +247,7 @@ METHOD(private_key_t, sign, bool,
return FALSE;
}
- len = htonl(1 + sizeof(u_int32_t) * 3 + this->key.len + data.len);
+ len = htonl(1 + sizeof(uint32_t) * 3 + this->key.len + data.len);
buf[0] = SSH_AGENT_SIGN_REQUEST;
if (write(this->socket, &len, sizeof(len)) != sizeof(len) ||
write(this->socket, &buf, 1) != 1)
@@ -281,7 +281,7 @@ METHOD(private_key_t, sign, bool,
blob = chunk_create(buf, sizeof(buf));
blob.len = read(this->socket, blob.ptr, blob.len);
- if (blob.len < sizeof(u_int32_t) + sizeof(u_char) ||
+ if (blob.len < sizeof(uint32_t) + sizeof(u_char) ||
read_uint32(&blob) != blob.len ||
read_byte(&blob) != SSH_AGENT_SIGN_RESPONSE)
{
diff --git a/src/libstrongswan/plugins/blowfish/blowfish.h b/src/libstrongswan/plugins/blowfish/blowfish.h
index 9aa30df4b..ad853afd8 100644
--- a/src/libstrongswan/plugins/blowfish/blowfish.h
+++ b/src/libstrongswan/plugins/blowfish/blowfish.h
@@ -98,7 +98,7 @@ extern "C" {
#else
#include <sys/types.h>
#endif
-#define BF_LONG u_int32_t
+#define BF_LONG uint32_t
#endif
#define BF_ROUNDS 16
diff --git a/src/libstrongswan/plugins/blowfish/blowfish_crypter.c b/src/libstrongswan/plugins/blowfish/blowfish_crypter.c
index 253f9b4a4..1708e078d 100644
--- a/src/libstrongswan/plugins/blowfish/blowfish_crypter.c
+++ b/src/libstrongswan/plugins/blowfish/blowfish_crypter.c
@@ -84,14 +84,14 @@ struct private_blowfish_crypter_t {
/**
* Key size of this Blowfish cipher object.
*/
- u_int32_t key_size;
+ uint32_t key_size;
};
METHOD(crypter_t, decrypt, bool,
private_blowfish_crypter_t *this, chunk_t data, chunk_t iv,
chunk_t *decrypted)
{
- u_int8_t *in, *out;
+ uint8_t *in, *out;
if (decrypted)
{
@@ -116,7 +116,7 @@ METHOD(crypter_t, encrypt, bool,
private_blowfish_crypter_t *this, chunk_t data, chunk_t iv,
chunk_t *encrypted)
{
- u_int8_t *in, *out;
+ uint8_t *in, *out;
if (encrypted)
{
diff --git a/src/libstrongswan/plugins/ccm/ccm_aead.c b/src/libstrongswan/plugins/ccm/ccm_aead.c
index 676d67681..9cf9bedf5 100644
--- a/src/libstrongswan/plugins/ccm/ccm_aead.c
+++ b/src/libstrongswan/plugins/ccm/ccm_aead.c
@@ -60,7 +60,7 @@ struct private_ccm_aead_t {
* First block with control information
*/
typedef struct __attribute__((packed)) {
- BITFIELD4(u_int8_t,
+ BITFIELD4(uint8_t,
/* size of p length field q, as q-1 */
q_len: 3,
/* size of our ICV t, as (t-2)/2 */
@@ -82,7 +82,7 @@ typedef struct __attribute__((packed)) {
* Counter block
*/
typedef struct __attribute__((packed)) {
- BITFIELD3(u_int8_t,
+ BITFIELD3(uint8_t,
/* size of p length field q, as q-1 */
q_len: 3,
zero: 3,
@@ -117,7 +117,7 @@ static void build_b0(private_ccm_aead_t *this, chunk_t plain, chunk_t assoc,
/**
* Build a counter block for counter i
*/
-static void build_ctr(private_ccm_aead_t *this, u_int32_t i, chunk_t iv,
+static void build_ctr(private_ccm_aead_t *this, uint32_t i, chunk_t iv,
char *out)
{
ctr_t *ctr = (ctr_t*)out;
diff --git a/src/libstrongswan/plugins/chapoly/chapoly_aead.c b/src/libstrongswan/plugins/chapoly/chapoly_aead.c
index 50ad84b21..39d51e9f8 100644
--- a/src/libstrongswan/plugins/chapoly/chapoly_aead.c
+++ b/src/libstrongswan/plugins/chapoly/chapoly_aead.c
@@ -84,8 +84,8 @@ static bool poly_head(private_chapoly_aead_t *this, u_char *assoc, size_t len)
static bool poly_tail(private_chapoly_aead_t *this, size_t alen, size_t clen)
{
struct {
- u_int64_t alen;
- u_int64_t clen;
+ uint64_t alen;
+ uint64_t clen;
} b;
b.alen = htole64(alen);
@@ -190,7 +190,7 @@ METHOD(aead_t, encrypt, bool,
{
u_char *out;
- if (sizeof(plain.len) > sizeof(u_int32_t) && plain.len > P_MAX)
+ if (sizeof(plain.len) > sizeof(uint32_t) && plain.len > P_MAX)
{
return FALSE;
}
@@ -220,7 +220,7 @@ METHOD(aead_t, decrypt, bool,
return FALSE;
}
encr.len -= POLY_ICV_SIZE;
- if (sizeof(encr.len) > sizeof(u_int32_t) && encr.len > P_MAX)
+ if (sizeof(encr.len) > sizeof(uint32_t) && encr.len > P_MAX)
{
return FALSE;
}
diff --git a/src/libstrongswan/plugins/chapoly/chapoly_drv_portable.c b/src/libstrongswan/plugins/chapoly/chapoly_drv_portable.c
index dfed4d53d..59962b819 100644
--- a/src/libstrongswan/plugins/chapoly/chapoly_drv_portable.c
+++ b/src/libstrongswan/plugins/chapoly/chapoly_drv_portable.c
@@ -39,30 +39,30 @@ struct private_chapoly_drv_portable_t {
/**
* ChaCha20 state matrix
*/
- u_int32_t m[16];
+ uint32_t m[16];
/**
* Poly1305 update key
*/
- u_int32_t r[5];
+ uint32_t r[5];
/**
* Poly1305 state
*/
- u_int32_t h[5];
+ uint32_t h[5];
/**
* Poly1305 finalize key
*/
- u_int32_t s[4];
+ uint32_t s[4];
};
/**
* XOR a 32-bit integer into an unaligned destination
*/
-static inline void xor32u(void *p, u_int32_t x)
+static inline void xor32u(void *p, uint32_t x)
{
- u_int32_t y;
+ uint32_t y;
memcpy(&y, p, sizeof(y));
y ^= x;
@@ -72,7 +72,7 @@ static inline void xor32u(void *p, u_int32_t x)
/**
* Multiply two 64-bit words
*/
-static inline u_int64_t mlt(u_int64_t a, u_int64_t b)
+static inline uint64_t mlt(uint64_t a, uint64_t b)
{
return a * b;
}
@@ -80,7 +80,7 @@ static inline u_int64_t mlt(u_int64_t a, u_int64_t b)
/**
* Shift a 64-bit unsigned integer v right by n bits, clamp to 32 bit
*/
-static inline u_int32_t sr(u_int64_t v, u_char n)
+static inline uint32_t sr(uint64_t v, u_char n)
{
return v >> n;
}
@@ -88,13 +88,13 @@ static inline u_int32_t sr(u_int64_t v, u_char n)
/**
* Circular left shift by n bits
*/
-static inline u_int32_t rotl32(u_int32_t v, u_char n)
+static inline uint32_t rotl32(uint32_t v, u_char n)
{
return (v << n) | (v >> (sizeof(v) * 8 - n));
}
/**
- * AND two values, using a native integer size >= sizeof(u_int32_t)
+ * AND two values, using a native integer size >= sizeof(uint32_t)
*/
static inline u_long and(u_long v, u_long mask)
{
@@ -106,8 +106,8 @@ static inline u_long and(u_long v, u_long mask)
*/
static void chacha_block_xor(private_chapoly_drv_portable_t *this, void *data)
{
- u_int32_t x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, xa, xb, xc, xd, xe, xf;
- u_int32_t *out = data;
+ uint32_t x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, xa, xb, xc, xd, xe, xf;
+ uint32_t *out = data;
u_int i;
x0 = this->m[ 0];
@@ -246,10 +246,10 @@ METHOD(chapoly_drv_t, init, bool,
METHOD(chapoly_drv_t, poly, bool,
private_chapoly_drv_portable_t *this, u_char *data, u_int blocks)
{
- u_int32_t r0, r1, r2, r3, r4;
- u_int32_t s1, s2, s3, s4;
- u_int32_t h0, h1, h2, h3, h4;
- u_int64_t d0, d1, d2, d3, d4;
+ uint32_t r0, r1, r2, r3, r4;
+ uint32_t s1, s2, s3, s4;
+ uint32_t h0, h1, h2, h3, h4;
+ uint64_t d0, d1, d2, d3, d4;
u_int i;
r0 = this->r[0];
@@ -345,10 +345,10 @@ METHOD(chapoly_drv_t, decrypt, bool,
METHOD(chapoly_drv_t, finish, bool,
private_chapoly_drv_portable_t *this, u_char *mac)
{
- u_int32_t h0, h1, h2, h3, h4;
- u_int32_t g0, g1, g2, g3, g4;
- u_int32_t mask;
- u_int64_t f = 0;
+ uint32_t h0, h1, h2, h3, h4;
+ uint32_t g0, g1, g2, g3, g4;
+ uint32_t mask;
+ uint64_t f = 0;
/* fully carry h */
h0 = this->h[0];
@@ -371,7 +371,7 @@ METHOD(chapoly_drv_t, finish, bool,
g4 = h4 + (g3 >> 26) - (1 << 26); g3 &= 0x3ffffff;
/* select h if h < p, or h + -p if h >= p */
- mask = (g4 >> ((sizeof(u_int32_t) * 8) - 1)) - 1;
+ mask = (g4 >> ((sizeof(uint32_t) * 8) - 1)) - 1;
g0 &= mask;
g1 &= mask;
g2 &= mask;
diff --git a/src/libstrongswan/plugins/chapoly/chapoly_drv_ssse3.c b/src/libstrongswan/plugins/chapoly/chapoly_drv_ssse3.c
index df88e7d77..3981ed522 100644
--- a/src/libstrongswan/plugins/chapoly/chapoly_drv_ssse3.c
+++ b/src/libstrongswan/plugins/chapoly/chapoly_drv_ssse3.c
@@ -45,30 +45,30 @@ struct private_chapoly_drv_ssse3_t {
/**
* Poly1305 update key
*/
- u_int32_t r[5];
+ uint32_t r[5];
/**
* Poly1305 update key r^2
*/
- u_int32_t u[5];
+ uint32_t u[5];
/**
* Poly1305 state
*/
- u_int32_t h[5];
+ uint32_t h[5];
/**
* Poly1305 finalize key
*/
- u_int32_t s[4];
+ uint32_t s[4];
};
/**
* Read a 32-bit integer from an unaligned address
*/
-static inline u_int32_t ru32(void *p)
+static inline uint32_t ru32(void *p)
{
- u_int32_t ret;
+ uint32_t ret;
memcpy(&ret, p, sizeof(ret));
return ret;
@@ -77,7 +77,7 @@ static inline u_int32_t ru32(void *p)
/**
* Write a 32-bit word to an unaligned address
*/
-static inline void wu32(void *p, u_int32_t v)
+static inline void wu32(void *p, uint32_t v)
{
memcpy(p, &v, sizeof(v));
}
@@ -85,13 +85,13 @@ static inline void wu32(void *p, u_int32_t v)
/**
* Shift a 64-bit unsigned integer v right by n bits, clamp to 32 bit
*/
-static inline u_int32_t sr(u_int64_t v, u_char n)
+static inline uint32_t sr(uint64_t v, u_char n)
{
return v >> n;
}
/**
- * AND two values, using a native integer size >= sizeof(u_int32_t)
+ * AND two values, using a native integer size >= sizeof(uint32_t)
*/
static inline u_long and(u_long v, u_long mask)
{
@@ -189,7 +189,7 @@ static void chacha_4block_xor(private_chapoly_drv_ssse3_t *this, void *data)
{
__m128i x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, xa, xb, xc, xd, xe, xf;
__m128i r8, r16, ctrinc, t, *out = data;
- u_int32_t *m = (u_int32_t*)this->m;
+ uint32_t *m = (uint32_t*)this->m;
u_int i;
r8 = _mm_set_epi8(14, 13, 12, 15, 10, 9, 8, 11, 6, 5, 4, 7, 2, 1, 0, 3);
@@ -364,7 +364,7 @@ METHOD(chapoly_drv_t, set_key, bool,
/**
* r[127:64] = h[95:64] * a, r[63:0] = h[31:0] * b
*/
-static inline __m128i mul2(__m128i h, u_int32_t a, u_int32_t b)
+static inline __m128i mul2(__m128i h, uint32_t a, uint32_t b)
{
return _mm_mul_epu32(h, _mm_set_epi32(0, a, 0, b));
}
@@ -374,7 +374,7 @@ static inline __m128i mul2(__m128i h, u_int32_t a, u_int32_t b)
* z = x[127:64] + x[63:0] + y[127:64] + y[63:0]
*/
static inline void sum2(__m128i a, __m128i b, __m128i x, __m128i y,
- u_int64_t *c, u_int64_t *z)
+ uint64_t *c, uint64_t *z)
{
__m128i r, s;
@@ -392,10 +392,10 @@ static inline void sum2(__m128i a, __m128i b, __m128i x, __m128i y,
* r = a[127:64] + b[127:64] + c[127:64] + d[127:64] + e[127:64]
* + a[63:0] + b[63:0] + c[63:0] + d[63:0] + e[63:0]
*/
-static inline u_int64_t sum5(__m128i a, __m128i b, __m128i c,
+static inline uint64_t sum5(__m128i a, __m128i b, __m128i c,
__m128i d, __m128i e)
{
- u_int64_t r;
+ uint64_t r;
a = _mm_add_epi64(a, b);
c = _mm_add_epi64(c, d);
@@ -414,10 +414,10 @@ static inline u_int64_t sum5(__m128i a, __m128i b, __m128i c,
static void make_u(private_chapoly_drv_ssse3_t *this)
{
__m128i r01, r23, r44, x0, x1, y0, y1, z0;
- u_int32_t r0, r1, r2, r3, r4;
- u_int32_t u0, u1, u2, u3, u4;
- u_int32_t s1, s2, s3, s4;
- u_int64_t d0, d1, d2, d3, d4;
+ uint32_t r0, r1, r2, r3, r4;
+ uint32_t u0, u1, u2, u3, u4;
+ uint32_t s1, s2, s3, s4;
+ uint64_t d0, d1, d2, d3, d4;
r0 = this->r[0];
r1 = this->r[1];
@@ -513,12 +513,12 @@ METHOD(chapoly_drv_t, init, bool,
*/
static void poly2(private_chapoly_drv_ssse3_t *this, u_char *data, u_int dblks)
{
- u_int32_t r0, r1, r2, r3, r4, u0, u1, u2, u3, u4;
- u_int32_t s1, s2, s3, s4, v1, v2, v3, v4;
+ uint32_t r0, r1, r2, r3, r4, u0, u1, u2, u3, u4;
+ uint32_t s1, s2, s3, s4, v1, v2, v3, v4;
__m128i hc0, hc1, hc2, hc3, hc4;
- u_int32_t h0, h1, h2, h3, h4;
- u_int32_t c0, c1, c2, c3, c4;
- u_int64_t d0, d1, d2, d3, d4;
+ uint32_t h0, h1, h2, h3, h4;
+ uint32_t c0, c1, c2, c3, c4;
+ uint64_t d0, d1, d2, d3, d4;
u_int i;
r0 = this->r[0];
@@ -622,13 +622,13 @@ static void poly2(private_chapoly_drv_ssse3_t *this, u_char *data, u_int dblks)
*/
static void poly1(private_chapoly_drv_ssse3_t *this, u_char *data)
{
- u_int32_t r0, r1, r2, r3, r4;
- u_int32_t s1, s2, s3, s4;
- u_int32_t h0, h1, h2, h3, h4;
- u_int64_t d0, d1, d2, d3, d4;
+ uint32_t r0, r1, r2, r3, r4;
+ uint32_t s1, s2, s3, s4;
+ uint32_t h0, h1, h2, h3, h4;
+ uint64_t d0, d1, d2, d3, d4;
__m128i h01, h23, h44;
__m128i x0, x1, y0, y1, z0;
- u_int32_t t0, t1;
+ uint32_t t0, t1;
r0 = this->r[0];
r1 = this->r[1];
@@ -764,10 +764,10 @@ METHOD(chapoly_drv_t, decrypt, bool,
METHOD(chapoly_drv_t, finish, bool,
private_chapoly_drv_ssse3_t *this, u_char *mac)
{
- u_int32_t h0, h1, h2, h3, h4;
- u_int32_t g0, g1, g2, g3, g4;
- u_int32_t mask;
- u_int64_t f = 0;
+ uint32_t h0, h1, h2, h3, h4;
+ uint32_t g0, g1, g2, g3, g4;
+ uint32_t mask;
+ uint64_t f = 0;
/* fully carry h */
h0 = this->h[0];
@@ -790,7 +790,7 @@ METHOD(chapoly_drv_t, finish, bool,
g4 = h4 + (g3 >> 26) - (1 << 26); g3 &= 0x3ffffff;
/* select h if h < p, or h + -p if h >= p */
- mask = (g4 >> ((sizeof(u_int32_t) * 8) - 1)) - 1;
+ mask = (g4 >> ((sizeof(uint32_t) * 8) - 1)) - 1;
g0 &= mask;
g1 &= mask;
g2 &= mask;
diff --git a/src/libstrongswan/plugins/cmac/cmac.c b/src/libstrongswan/plugins/cmac/cmac.c
index 4f222ff4e..22f077f58 100644
--- a/src/libstrongswan/plugins/cmac/cmac.c
+++ b/src/libstrongswan/plugins/cmac/cmac.c
@@ -39,7 +39,7 @@ struct private_mac_t {
/**
* Block size, in bytes
*/
- u_int8_t b;
+ uint8_t b;
/**
* Crypter with key K
@@ -49,22 +49,22 @@ struct private_mac_t {
/**
* K1
*/
- u_int8_t *k1;
+ uint8_t *k1;
/**
* K2
*/
- u_int8_t *k2;
+ uint8_t *k2;
/**
* T
*/
- u_int8_t *t;
+ uint8_t *t;
/**
* remaining, unprocessed bytes in append mode
*/
- u_int8_t *remaining;
+ uint8_t *remaining;
/**
* number of bytes in remaining
@@ -127,7 +127,7 @@ static bool update(private_mac_t *this, chunk_t data)
/**
* process last block M_last
*/
-static bool final(private_mac_t *this, u_int8_t *out)
+static bool final(private_mac_t *this, uint8_t *out)
{
chunk_t iv;
@@ -179,7 +179,7 @@ static bool final(private_mac_t *this, u_int8_t *out)
}
METHOD(mac_t, get_mac, bool,
- private_mac_t *this, chunk_t data, u_int8_t *out)
+ private_mac_t *this, chunk_t data, uint8_t *out)
{
/* update T, do not process last block */
if (!update(this, data))
@@ -316,7 +316,7 @@ mac_t *cmac_create(encryption_algorithm_t algo, size_t key_size)
{
private_mac_t *this;
crypter_t *crypter;
- u_int8_t b;
+ uint8_t b;
crypter = lib->crypto->create_crypter(lib->crypto, algo, key_size);
if (!crypter)
diff --git a/src/libstrongswan/plugins/ctr/ctr_ipsec_crypter.c b/src/libstrongswan/plugins/ctr/ctr_ipsec_crypter.c
index 59d201a6f..854030b8c 100644
--- a/src/libstrongswan/plugins/ctr/ctr_ipsec_crypter.c
+++ b/src/libstrongswan/plugins/ctr/ctr_ipsec_crypter.c
@@ -38,7 +38,7 @@ struct private_ctr_ipsec_crypter_t {
struct {
char nonce[4];
char iv[8];
- u_int32_t counter;
+ uint32_t counter;
} __attribute__((packed)) state;
};
diff --git a/src/libstrongswan/plugins/des/des_crypter.c b/src/libstrongswan/plugins/des/des_crypter.c
index 6010f9d8b..d236bd429 100644
--- a/src/libstrongswan/plugins/des/des_crypter.c
+++ b/src/libstrongswan/plugins/des/des_crypter.c
@@ -96,7 +96,7 @@ struct private_des_crypter_t {
#define DES_ENCRYPT 1
#define DES_DECRYPT 0
-#define DES_LONG u_int32_t
+#define DES_LONG uint32_t
#if defined(WIN32) || defined(WIN16)
#ifndef MSDOS
@@ -1420,7 +1420,7 @@ METHOD(crypter_t, decrypt, bool,
private_des_crypter_t *this, chunk_t data, chunk_t iv, chunk_t *decrypted)
{
des_cblock ivb;
- u_int8_t *out;
+ uint8_t *out;
out = data.ptr;
if (decrypted)
@@ -1439,7 +1439,7 @@ METHOD(crypter_t, encrypt, bool,
private_des_crypter_t *this, chunk_t data, chunk_t iv, chunk_t *encrypted)
{
des_cblock ivb;
- u_int8_t *out;
+ uint8_t *out;
out = data.ptr;
if (encrypted)
@@ -1456,7 +1456,7 @@ METHOD(crypter_t, encrypt, bool,
METHOD(crypter_t, decrypt_ecb, bool,
private_des_crypter_t *this, chunk_t data, chunk_t iv, chunk_t *decrypted)
{
- u_int8_t *out;
+ uint8_t *out;
out = data.ptr;
if (decrypted)
@@ -1472,7 +1472,7 @@ METHOD(crypter_t, decrypt_ecb, bool,
METHOD(crypter_t, encrypt_ecb, bool,
private_des_crypter_t *this, chunk_t data, chunk_t iv, chunk_t *encrypted)
{
- u_int8_t *out;
+ uint8_t *out;
out = data.ptr;
if (encrypted)
@@ -1489,7 +1489,7 @@ METHOD(crypter_t, decrypt3, bool,
private_des_crypter_t *this, chunk_t data, chunk_t iv, chunk_t *decrypted)
{
des_cblock ivb;
- u_int8_t *out;
+ uint8_t *out;
out = data.ptr;
if (decrypted)
@@ -1508,7 +1508,7 @@ METHOD(crypter_t, encrypt3, bool,
private_des_crypter_t *this, chunk_t data, chunk_t iv, chunk_t *encrypted)
{
des_cblock ivb;
- u_int8_t *out;
+ uint8_t *out;
out = data.ptr;
if (encrypted)
diff --git a/src/libstrongswan/plugins/dnskey/dnskey_builder.c b/src/libstrongswan/plugins/dnskey/dnskey_builder.c
index 71040437d..fd2471a48 100644
--- a/src/libstrongswan/plugins/dnskey/dnskey_builder.c
+++ b/src/libstrongswan/plugins/dnskey/dnskey_builder.c
@@ -26,10 +26,10 @@ typedef enum dnskey_algorithm_t dnskey_algorithm_t;
* Header of a DNSKEY resource record
*/
struct dnskey_rr_t {
- u_int16_t flags;
- u_int8_t protocol;
- u_int8_t algorithm;
- u_int8_t data[];
+ uint16_t flags;
+ uint8_t protocol;
+ uint8_t algorithm;
+ uint8_t data[];
} __attribute__((__packed__));
/**
diff --git a/src/libstrongswan/plugins/fips_prf/fips_prf.c b/src/libstrongswan/plugins/fips_prf/fips_prf.c
index 92977909e..47676b32f 100644
--- a/src/libstrongswan/plugins/fips_prf/fips_prf.c
+++ b/src/libstrongswan/plugins/fips_prf/fips_prf.c
@@ -31,7 +31,7 @@ struct private_fips_prf_t {
/**
* key of prf function, "b" long
*/
- u_int8_t *key;
+ uint8_t *key;
/**
* size of "b" in bytes
@@ -46,19 +46,19 @@ struct private_fips_prf_t {
/**
* G function, either SHA1 or DES
*/
- bool (*g)(private_fips_prf_t *this, chunk_t c, u_int8_t res[]);
+ bool (*g)(private_fips_prf_t *this, chunk_t c, uint8_t res[]);
};
/**
* sum = (a + b) mod 2 ^ (length * 8)
*/
-static void add_mod(size_t length, u_int8_t a[], u_int8_t b[], u_int8_t sum[])
+static void add_mod(size_t length, uint8_t a[], uint8_t b[], uint8_t sum[])
{
int i, c = 0;
for(i = length - 1; i >= 0; i--)
{
- u_int32_t tmp;
+ uint32_t tmp;
tmp = a[i] + b[i] + c;
sum[i] = 0xff & tmp;
@@ -69,7 +69,7 @@ static void add_mod(size_t length, u_int8_t a[], u_int8_t b[], u_int8_t sum[])
/**
* calculate "chunk mod 2^(length*8)" and save it into buffer
*/
-static void chunk_mod(size_t length, chunk_t chunk, u_int8_t buffer[])
+static void chunk_mod(size_t length, chunk_t chunk, uint8_t buffer[])
{
if (chunk.len < length)
{
@@ -105,14 +105,14 @@ static void chunk_mod(size_t length, chunk_t chunk, u_int8_t buffer[])
* 0x8e, 0x20, 0xd7, 0x37, 0xa3, 0x27, 0x51, 0x16
*/
METHOD(prf_t, get_bytes, bool,
- private_fips_prf_t *this, chunk_t seed, u_int8_t w[])
+ private_fips_prf_t *this, chunk_t seed, uint8_t w[])
{
int i;
- u_int8_t xval[this->b];
- u_int8_t xseed[this->b];
- u_int8_t sum[this->b];
- u_int8_t *xkey = this->key;
- u_int8_t one[this->b];
+ uint8_t xval[this->b];
+ uint8_t xseed[this->b];
+ uint8_t sum[this->b];
+ uint8_t *xkey = this->key;
+ uint8_t one[this->b];
if (!w)
{
@@ -175,9 +175,9 @@ METHOD(prf_t, set_key, bool,
/**
* Implementation of the G() function based on SHA1
*/
-static bool g_sha1(private_fips_prf_t *this, chunk_t c, u_int8_t res[])
+static bool g_sha1(private_fips_prf_t *this, chunk_t c, uint8_t res[])
{
- u_int8_t buf[64];
+ uint8_t buf[64];
if (c.len < sizeof(buf))
{
diff --git a/src/libstrongswan/plugins/gcm/gcm_aead.c b/src/libstrongswan/plugins/gcm/gcm_aead.c
index 6e1694a34..e9a072461 100644
--- a/src/libstrongswan/plugins/gcm/gcm_aead.c
+++ b/src/libstrongswan/plugins/gcm/gcm_aead.c
@@ -67,11 +67,11 @@ struct private_gcm_aead_t {
#if ULONG_MAX == 18446744073709551615UL && defined(htobe64)
# define htobeword htobe64
# define bewordtoh be64toh
-# define SHIFT_WORD_TYPE u_int64_t
+# define SHIFT_WORD_TYPE uint64_t
#else
# define htobeword htonl
# define bewordtoh ntohl
-# define SHIFT_WORD_TYPE u_int32_t
+# define SHIFT_WORD_TYPE uint32_t
#endif
/**
diff --git a/src/libstrongswan/plugins/gcrypt/gcrypt_crypter.c b/src/libstrongswan/plugins/gcrypt/gcrypt_crypter.c
index a737cb13d..80a8dc90d 100644
--- a/src/libstrongswan/plugins/gcrypt/gcrypt_crypter.c
+++ b/src/libstrongswan/plugins/gcrypt/gcrypt_crypter.c
@@ -52,7 +52,7 @@ struct private_gcrypt_crypter_t {
struct {
char nonce[4];
char iv[8];
- u_int32_t counter;
+ uint32_t counter;
} __attribute__((packed)) ctr;
};
diff --git a/src/libstrongswan/plugins/gcrypt/gcrypt_hasher.c b/src/libstrongswan/plugins/gcrypt/gcrypt_hasher.c
index af7993101..199c1d6c9 100644
--- a/src/libstrongswan/plugins/gcrypt/gcrypt_hasher.c
+++ b/src/libstrongswan/plugins/gcrypt/gcrypt_hasher.c
@@ -51,7 +51,7 @@ METHOD(hasher_t, reset, bool,
}
METHOD(hasher_t, get_hash, bool,
- private_gcrypt_hasher_t *this, chunk_t chunk, u_int8_t *hash)
+ private_gcrypt_hasher_t *this, chunk_t chunk, uint8_t *hash)
{
gcry_md_write(this->hd, chunk.ptr, chunk.len);
if (hash)
diff --git a/src/libstrongswan/plugins/gcrypt/gcrypt_rng.c b/src/libstrongswan/plugins/gcrypt/gcrypt_rng.c
index dc34a8d66..bf11758b1 100644
--- a/src/libstrongswan/plugins/gcrypt/gcrypt_rng.c
+++ b/src/libstrongswan/plugins/gcrypt/gcrypt_rng.c
@@ -36,7 +36,7 @@ struct private_gcrypt_rng_t {
};
METHOD(rng_t, get_bytes, bool,
- private_gcrypt_rng_t *this, size_t bytes, u_int8_t *buffer)
+ private_gcrypt_rng_t *this, size_t bytes, uint8_t *buffer)
{
switch (this->quality)
{
diff --git a/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c b/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c
index 052b10741..e5d418ea4 100644
--- a/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c
+++ b/src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c
@@ -142,7 +142,7 @@ chunk_t gmp_mpz_to_chunk(const mpz_t value)
static void mpz_clear_sensitive(mpz_t z)
{
size_t len = mpz_size(z) * GMP_LIMB_BITS / BITS_PER_BYTE;
- u_int8_t *zeros = alloca(len);
+ uint8_t *zeros = alloca(len);
memset(zeros, 0, len);
/* overwrite mpz_t with zero bytes before clearing it */
diff --git a/src/libstrongswan/plugins/hmac/hmac.c b/src/libstrongswan/plugins/hmac/hmac.c
index 96a14aed9..c777b47cd 100644
--- a/src/libstrongswan/plugins/hmac/hmac.c
+++ b/src/libstrongswan/plugins/hmac/hmac.c
@@ -38,7 +38,7 @@ struct private_mac_t {
/**
* Block size, as in RFC.
*/
- u_int8_t b;
+ uint8_t b;
/**
* Hash function.
@@ -57,7 +57,7 @@ struct private_mac_t {
};
METHOD(mac_t, get_mac, bool,
- private_mac_t *this, chunk_t data, u_int8_t *out)
+ private_mac_t *this, chunk_t data, uint8_t *out)
{
/* H(K XOR opad, H(K XOR ipad, text))
*
@@ -66,7 +66,7 @@ METHOD(mac_t, get_mac, bool,
*
*/
- u_int8_t buffer[this->h->get_hash_size(this->h)];
+ uint8_t buffer[this->h->get_hash_size(this->h)];
chunk_t inner;
if (out == NULL)
@@ -96,7 +96,7 @@ METHOD(mac_t, set_key, bool,
private_mac_t *this, chunk_t key)
{
int i;
- u_int8_t buffer[this->b];
+ uint8_t buffer[this->b];
memset(buffer, 0, this->b);
diff --git a/src/libstrongswan/plugins/md4/md4_hasher.c b/src/libstrongswan/plugins/md4/md4_hasher.c
index 06c9ec2f8..ada6c05da 100644
--- a/src/libstrongswan/plugins/md4/md4_hasher.c
+++ b/src/libstrongswan/plugins/md4/md4_hasher.c
@@ -39,7 +39,7 @@
#define S33 11
#define S34 15
-static u_int8_t PADDING[64] = {
+static uint8_t PADDING[64] = {
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
@@ -65,11 +65,11 @@ static u_int8_t PADDING[64] = {
(a) = ROTATE_LEFT ((a), (s)); \
}
#define GG(a, b, c, d, x, s) { \
- (a) += G ((b), (c), (d)) + (x) + (u_int32_t)0x5a827999; \
+ (a) += G ((b), (c), (d)) + (x) + (uint32_t)0x5a827999; \
(a) = ROTATE_LEFT ((a), (s)); \
}
#define HH(a, b, c, d, x, s) { \
- (a) += H ((b), (c), (d)) + (x) + (u_int32_t)0x6ed9eba1; \
+ (a) += H ((b), (c), (d)) + (x) + (uint32_t)0x6ed9eba1; \
(a) = ROTATE_LEFT ((a), (s)); \
}
@@ -87,40 +87,40 @@ struct private_md4_hasher_t {
/*
* State of the hasher.
*/
- u_int32_t state[4];
- u_int32_t count[2];
- u_int8_t buffer[64];
+ uint32_t state[4];
+ uint32_t count[2];
+ uint8_t buffer[64];
};
#if BYTE_ORDER != LITTLE_ENDIAN
-/* Encodes input (u_int32_t) into output (u_int8_t). Assumes len is
+/* Encodes input (uint32_t) into output (uint8_t). Assumes len is
* a multiple of 4.
*/
-static void Encode (u_int8_t *output, u_int32_t *input, size_t len)
+static void Encode (uint8_t *output, uint32_t *input, size_t len)
{
size_t i, j;
for (i = 0, j = 0; j < len; i++, j += 4)
{
- output[j] = (u_int8_t)(input[i] & 0xff);
- output[j+1] = (u_int8_t)((input[i] >> 8) & 0xff);
- output[j+2] = (u_int8_t)((input[i] >> 16) & 0xff);
- output[j+3] = (u_int8_t)((input[i] >> 24) & 0xff);
+ output[j] = (uint8_t)(input[i] & 0xff);
+ output[j+1] = (uint8_t)((input[i] >> 8) & 0xff);
+ output[j+2] = (uint8_t)((input[i] >> 16) & 0xff);
+ output[j+3] = (uint8_t)((input[i] >> 24) & 0xff);
}
}
-/* Decodes input (u_int8_t) into output (u_int32_t). Assumes len is
+/* Decodes input (uint8_t) into output (uint32_t). Assumes len is
* a multiple of 4.
*/
-static void Decode(u_int32_t *output, u_int8_t *input, size_t len)
+static void Decode(uint32_t *output, uint8_t *input, size_t len)
{
size_t i, j;
for (i = 0, j = 0; j < len; i++, j += 4)
{
- output[i] = ((u_int32_t)input[j]) | (((u_int32_t)input[j+1]) << 8) |
- (((u_int32_t)input[j+2]) << 16) | (((u_int32_t)input[j+3]) << 24);
+ output[i] = ((uint32_t)input[j]) | (((uint32_t)input[j+1]) << 8) |
+ (((uint32_t)input[j+2]) << 16) | (((uint32_t)input[j+3]) << 24);
}
}
@@ -132,9 +132,9 @@ static void Decode(u_int32_t *output, u_int8_t *input, size_t len)
/*
* MD4 basic transformation. Transforms state based on block.
*/
-static void MD4Transform(u_int32_t state[4], u_int8_t block[64])
+static void MD4Transform(uint32_t state[4], uint8_t block[64])
{
- u_int32_t a = state[0], b = state[1], c = state[2], d = state[3], x[16];
+ uint32_t a = state[0], b = state[1], c = state[2], d = state[3], x[16];
Decode(x, block, 64);
@@ -202,13 +202,13 @@ static void MD4Transform(u_int32_t state[4], u_int8_t block[64])
* operation, processing another message block, and updating the
* context.
*/
-static void MD4Update(private_md4_hasher_t *this, u_int8_t *input, size_t inputLen)
+static void MD4Update(private_md4_hasher_t *this, uint8_t *input, size_t inputLen)
{
- u_int32_t i;
+ uint32_t i;
size_t index, partLen;
/* Compute number of bytes mod 64 */
- index = (u_int8_t)((this->count[0] >> 3) & 0x3F);
+ index = (uint8_t)((this->count[0] >> 3) & 0x3F);
/* Update number of bits */
if ((this->count[0] += (inputLen << 3)) < (inputLen << 3))
@@ -243,9 +243,9 @@ static void MD4Update(private_md4_hasher_t *this, u_int8_t *input, size_t inputL
/* MD4 finalization. Ends an MD4 message-digest operation, writing the
* the message digest and zeroizing the context.
*/
-static void MD4Final (private_md4_hasher_t *this, u_int8_t digest[16])
+static void MD4Final (private_md4_hasher_t *this, uint8_t digest[16])
{
- u_int8_t bits[8];
+ uint8_t bits[8];
size_t index, padLen;
/* Save number of bits */
@@ -280,7 +280,7 @@ METHOD(hasher_t, reset, bool,
}
METHOD(hasher_t, get_hash, bool,
- private_md4_hasher_t *this, chunk_t chunk, u_int8_t *buffer)
+ private_md4_hasher_t *this, chunk_t chunk, uint8_t *buffer)
{
MD4Update(this, chunk.ptr, chunk.len);
if (buffer != NULL)
diff --git a/src/libstrongswan/plugins/md5/md5_hasher.c b/src/libstrongswan/plugins/md5/md5_hasher.c
index 99b505e58..d14c10ae5 100644
--- a/src/libstrongswan/plugins/md5/md5_hasher.c
+++ b/src/libstrongswan/plugins/md5/md5_hasher.c
@@ -42,7 +42,7 @@
#define S43 15
#define S44 21
-static u_int8_t PADDING[64] = {
+static uint8_t PADDING[64] = {
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
@@ -66,22 +66,22 @@ static u_int8_t PADDING[64] = {
Rotation is separate from addition to prevent recomputation.
*/
#define FF(a, b, c, d, x, s, ac) { \
- (a) += F ((b), (c), (d)) + (x) + (u_int32_t)(ac); \
+ (a) += F ((b), (c), (d)) + (x) + (uint32_t)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
#define GG(a, b, c, d, x, s, ac) { \
- (a) += G ((b), (c), (d)) + (x) + (u_int32_t)(ac); \
+ (a) += G ((b), (c), (d)) + (x) + (uint32_t)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
#define HH(a, b, c, d, x, s, ac) { \
- (a) += H ((b), (c), (d)) + (x) + (u_int32_t)(ac); \
+ (a) += H ((b), (c), (d)) + (x) + (uint32_t)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
#define II(a, b, c, d, x, s, ac) { \
- (a) += I ((b), (c), (d)) + (x) + (u_int32_t)(ac); \
+ (a) += I ((b), (c), (d)) + (x) + (uint32_t)(ac); \
(a) = ROTATE_LEFT ((a), (s)); \
(a) += (b); \
}
@@ -102,41 +102,41 @@ struct private_md5_hasher_t {
/*
* State of the hasher.
*/
- u_int32_t state[5];
- u_int32_t count[2];
- u_int8_t buffer[64];
+ uint32_t state[5];
+ uint32_t count[2];
+ uint8_t buffer[64];
};
#if BYTE_ORDER != LITTLE_ENDIAN
-/* Encodes input (u_int32_t) into output (u_int8_t). Assumes len is
+/* Encodes input (uint32_t) into output (uint8_t). Assumes len is
* a multiple of 4.
*/
-static void Encode (u_int8_t *output, u_int32_t *input, size_t len)
+static void Encode (uint8_t *output, uint32_t *input, size_t len)
{
size_t i, j;
for (i = 0, j = 0; j < len; i++, j += 4)
{
- output[j] = (u_int8_t)(input[i] & 0xff);
- output[j+1] = (u_int8_t)((input[i] >> 8) & 0xff);
- output[j+2] = (u_int8_t)((input[i] >> 16) & 0xff);
- output[j+3] = (u_int8_t)((input[i] >> 24) & 0xff);
+ output[j] = (uint8_t)(input[i] & 0xff);
+ output[j+1] = (uint8_t)((input[i] >> 8) & 0xff);
+ output[j+2] = (uint8_t)((input[i] >> 16) & 0xff);
+ output[j+3] = (uint8_t)((input[i] >> 24) & 0xff);
}
}
-/* Decodes input (u_int8_t) into output (u_int32_t). Assumes len is
+/* Decodes input (uint8_t) into output (uint32_t). Assumes len is
* a multiple of 4.
*/
-static void Decode(u_int32_t *output, u_int8_t *input, size_t len)
+static void Decode(uint32_t *output, uint8_t *input, size_t len)
{
size_t i, j;
for (i = 0, j = 0; j < len; i++, j += 4)
{
- output[i] = ((u_int32_t)input[j]) | (((u_int32_t)input[j+1]) << 8) |
- (((u_int32_t)input[j+2]) << 16) | (((u_int32_t)input[j+3]) << 24);
+ output[i] = ((uint32_t)input[j]) | (((uint32_t)input[j+1]) << 8) |
+ (((uint32_t)input[j+2]) << 16) | (((uint32_t)input[j+3]) << 24);
}
}
@@ -147,9 +147,9 @@ static void Decode(u_int32_t *output, u_int8_t *input, size_t len)
/* MD5 basic transformation. Transforms state based on block.
*/
-static void MD5Transform(u_int32_t state[4], u_int8_t block[64])
+static void MD5Transform(uint32_t state[4], uint8_t block[64])
{
- u_int32_t a = state[0], b = state[1], c = state[2], d = state[3], x[16];
+ uint32_t a = state[0], b = state[1], c = state[2], d = state[3], x[16];
Decode(x, block, 64);
@@ -235,13 +235,13 @@ static void MD5Transform(u_int32_t state[4], u_int8_t block[64])
* operation, processing another message block, and updating the
* context.
*/
-static void MD5Update(private_md5_hasher_t *this, u_int8_t *input, size_t inputLen)
+static void MD5Update(private_md5_hasher_t *this, uint8_t *input, size_t inputLen)
{
- u_int32_t i;
+ uint32_t i;
size_t index, partLen;
/* Compute number of bytes mod 64 */
- index = (u_int8_t)((this->count[0] >> 3) & 0x3F);
+ index = (uint8_t)((this->count[0] >> 3) & 0x3F);
/* Update number of bits */
if ((this->count[0] += (inputLen << 3)) < (inputLen << 3))
@@ -276,9 +276,9 @@ static void MD5Update(private_md5_hasher_t *this, u_int8_t *input, size_t inputL
/* MD5 finalization. Ends an MD5 message-digest operation, writing the
* the message digest and zeroizing the context.
*/
-static void MD5Final (private_md5_hasher_t *this, u_int8_t digest[16])
+static void MD5Final (private_md5_hasher_t *this, uint8_t digest[16])
{
- u_int8_t bits[8];
+ uint8_t bits[8];
size_t index, padLen;
/* Save number of bits */
@@ -313,7 +313,7 @@ METHOD(hasher_t, reset, bool,
}
METHOD(hasher_t, get_hash, bool,
- private_md5_hasher_t *this, chunk_t chunk, u_int8_t *buffer)
+ private_md5_hasher_t *this, chunk_t chunk, uint8_t *buffer)
{
MD5Update(this, chunk.ptr, chunk.len);
if (buffer != NULL)
diff --git a/src/libstrongswan/plugins/nonce/nonce_nonceg.c b/src/libstrongswan/plugins/nonce/nonce_nonceg.c
index 64ed2e08d..22c161df6 100644
--- a/src/libstrongswan/plugins/nonce/nonce_nonceg.c
+++ b/src/libstrongswan/plugins/nonce/nonce_nonceg.c
@@ -36,7 +36,7 @@ struct private_nonce_nonceg_t {
};
METHOD(nonce_gen_t, get_nonce, bool,
- private_nonce_nonceg_t *this, size_t size, u_int8_t *buffer)
+ private_nonce_nonceg_t *this, size_t size, uint8_t *buffer)
{
return this->rng->get_bytes(this->rng, size, buffer);
}
diff --git a/src/libstrongswan/plugins/ntru/ntru_drbg.c b/src/libstrongswan/plugins/ntru/ntru_drbg.c
index ef0d3d9c8..b7a951d00 100644
--- a/src/libstrongswan/plugins/ntru/ntru_drbg.c
+++ b/src/libstrongswan/plugins/ntru/ntru_drbg.c
@@ -35,17 +35,17 @@ struct private_ntru_drbg_t {
/**
* Security strength in bits of the DRBG
*/
- u_int32_t strength;
+ uint32_t strength;
/**
* Number of requests for pseudorandom bits
*/
- u_int32_t reseed_counter;
+ uint32_t reseed_counter;
/**
* Maximum number of requests for pseudorandom bits
*/
- u_int32_t max_requests;
+ uint32_t max_requests;
/**
* True entropy source
@@ -111,7 +111,7 @@ static bool update(private_ntru_drbg_t *this, chunk_t data)
return TRUE;
}
-METHOD(ntru_drbg_t, get_strength, u_int32_t,
+METHOD(ntru_drbg_t, get_strength, uint32_t,
private_ntru_drbg_t *this)
{
return this->strength;
@@ -142,7 +142,7 @@ METHOD(ntru_drbg_t, reseed, bool,
}
METHOD(ntru_drbg_t, generate, bool,
- private_ntru_drbg_t *this, u_int32_t strength, u_int32_t len, u_int8_t *out)
+ private_ntru_drbg_t *this, uint32_t strength, uint32_t len, uint8_t *out)
{
size_t delta;
chunk_t output;
@@ -206,14 +206,14 @@ METHOD(ntru_drbg_t, destroy, void,
/*
* Described in header.
*/
-ntru_drbg_t *ntru_drbg_create(u_int32_t strength, chunk_t pers_str,
+ntru_drbg_t *ntru_drbg_create(uint32_t strength, chunk_t pers_str,
rng_t *entropy)
{
private_ntru_drbg_t *this;
chunk_t seed;
signer_t *hmac;
size_t entropy_len;
- u_int32_t max_requests;
+ uint32_t max_requests;
if (strength > MAX_STRENGTH_BITS)
{
diff --git a/src/libstrongswan/plugins/ntru/ntru_drbg.h b/src/libstrongswan/plugins/ntru/ntru_drbg.h
index 83cef11be..3fee1800b 100644
--- a/src/libstrongswan/plugins/ntru/ntru_drbg.h
+++ b/src/libstrongswan/plugins/ntru/ntru_drbg.h
@@ -36,7 +36,7 @@ struct ntru_drbg_t {
*
* @return configured security strength in bits
*/
- u_int32_t (*get_strength)(ntru_drbg_t *this);
+ uint32_t (*get_strength)(ntru_drbg_t *this);
/**
* Reseed the instantiated DRBG
@@ -54,8 +54,8 @@ struct ntru_drbg_t {
* @param out address of output buffer
* @return TRUE if successful
*/
- bool (*generate)(ntru_drbg_t *this, u_int32_t strength, u_int32_t len,
- u_int8_t *out);
+ bool (*generate)(ntru_drbg_t *this, uint32_t strength, uint32_t len,
+ uint8_t *out);
/**
* Get a reference on an ntru_drbg_t object increasing the count by one
@@ -77,7 +77,7 @@ struct ntru_drbg_t {
* @param pers_str personalization string
* @param entropy entropy source to use
*/
-ntru_drbg_t *ntru_drbg_create(u_int32_t strength, chunk_t pers_str,
+ntru_drbg_t *ntru_drbg_create(uint32_t strength, chunk_t pers_str,
rng_t *entropy);
#endif /** NTRU_DRBG_H_ @}*/
diff --git a/src/libstrongswan/plugins/ntru/ntru_ke.c b/src/libstrongswan/plugins/ntru/ntru_ke.c
index 3b5df81d9..efc660bed 100644
--- a/src/libstrongswan/plugins/ntru/ntru_ke.c
+++ b/src/libstrongswan/plugins/ntru/ntru_ke.c
@@ -66,7 +66,7 @@ struct private_ntru_ke_t {
/**
* Cryptographical strength in bits of the NTRU Parameter Set
*/
- u_int32_t strength;
+ uint32_t strength;
/**
* NTRU Public Key
@@ -247,7 +247,7 @@ ntru_ke_t *ntru_ke_create(diffie_hellman_group_t group, chunk_t g, chunk_t p)
rng_t *entropy;
ntru_drbg_t *drbg;
char *parameter_set;
- u_int32_t strength;
+ uint32_t strength;
parameter_set = lib->settings->get_str(lib->settings,
"%s.plugins.ntru.parameter_set", "optimum", lib->ns);
diff --git a/src/libstrongswan/plugins/openssl/openssl_crypter.c b/src/libstrongswan/plugins/openssl/openssl_crypter.c
index 26f4700b8..a02f78a93 100644
--- a/src/libstrongswan/plugins/openssl/openssl_crypter.c
+++ b/src/libstrongswan/plugins/openssl/openssl_crypter.c
@@ -43,7 +43,7 @@ struct private_openssl_crypter_t {
/**
* Look up an OpenSSL algorithm name and validate its key size
*/
-static char* lookup_algorithm(u_int16_t ikev2_algo, size_t *key_size)
+static char* lookup_algorithm(uint16_t ikev2_algo, size_t *key_size)
{
struct {
/* identifier specified in IKEv2 */
diff --git a/src/libstrongswan/plugins/openssl/openssl_hasher.c b/src/libstrongswan/plugins/openssl/openssl_hasher.c
index 50b14698b..8f7df0f8a 100644
--- a/src/libstrongswan/plugins/openssl/openssl_hasher.c
+++ b/src/libstrongswan/plugins/openssl/openssl_hasher.c
@@ -53,7 +53,7 @@ METHOD(hasher_t, reset, bool,
}
METHOD(hasher_t, get_hash, bool,
- private_openssl_hasher_t *this, chunk_t chunk, u_int8_t *hash)
+ private_openssl_hasher_t *this, chunk_t chunk, uint8_t *hash)
{
if (EVP_DigestUpdate(this->ctx, chunk.ptr, chunk.len) != 1)
{
diff --git a/src/libstrongswan/plugins/openssl/openssl_hmac.c b/src/libstrongswan/plugins/openssl/openssl_hmac.c
index 065187a8c..b99a0c947 100644
--- a/src/libstrongswan/plugins/openssl/openssl_hmac.c
+++ b/src/libstrongswan/plugins/openssl/openssl_hmac.c
@@ -94,7 +94,7 @@ METHOD(mac_t, set_key, bool,
}
METHOD(mac_t, get_mac, bool,
- private_mac_t *this, chunk_t data, u_int8_t *out)
+ private_mac_t *this, chunk_t data, uint8_t *out)
{
if (!this->key_set)
{
diff --git a/src/libstrongswan/plugins/openssl/openssl_rng.c b/src/libstrongswan/plugins/openssl/openssl_rng.c
index c807bb607..f8e98fc0f 100644
--- a/src/libstrongswan/plugins/openssl/openssl_rng.c
+++ b/src/libstrongswan/plugins/openssl/openssl_rng.c
@@ -47,7 +47,7 @@ struct private_openssl_rng_t {
};
METHOD(rng_t, get_bytes, bool,
- private_openssl_rng_t *this, size_t bytes, u_int8_t *buffer)
+ private_openssl_rng_t *this, size_t bytes, uint8_t *buffer)
{
if (this->quality == RNG_WEAK)
{
diff --git a/src/libstrongswan/plugins/openssl/openssl_sha1_prf.c b/src/libstrongswan/plugins/openssl/openssl_sha1_prf.c
index 446c93e2b..f6df03f12 100644
--- a/src/libstrongswan/plugins/openssl/openssl_sha1_prf.c
+++ b/src/libstrongswan/plugins/openssl/openssl_sha1_prf.c
@@ -40,7 +40,7 @@ struct private_openssl_sha1_prf_t {
};
METHOD(prf_t, get_bytes, bool,
- private_openssl_sha1_prf_t *this, chunk_t seed, u_int8_t *bytes)
+ private_openssl_sha1_prf_t *this, chunk_t seed, uint8_t *bytes)
{
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
if (!SHA1_Update(&this->ctx, seed.ptr, seed.len))
@@ -53,7 +53,7 @@ METHOD(prf_t, get_bytes, bool,
if (bytes)
{
- u_int32_t *hash = (u_int32_t*)bytes;
+ uint32_t *hash = (uint32_t*)bytes;
hash[0] = htonl(this->ctx.h0);
hash[1] = htonl(this->ctx.h1);
diff --git a/src/libstrongswan/plugins/padlock/padlock_rng.c b/src/libstrongswan/plugins/padlock/padlock_rng.c
index 517914ab5..6b337d82c 100644
--- a/src/libstrongswan/plugins/padlock/padlock_rng.c
+++ b/src/libstrongswan/plugins/padlock/padlock_rng.c
@@ -81,7 +81,7 @@ METHOD(rng_t, allocate_bytes, bool,
}
METHOD(rng_t, get_bytes, bool,
- private_padlock_rng_t *this, size_t bytes, u_int8_t *buffer)
+ private_padlock_rng_t *this, size_t bytes, uint8_t *buffer)
{
chunk_t chunk;
diff --git a/src/libstrongswan/plugins/padlock/padlock_sha1_hasher.c b/src/libstrongswan/plugins/padlock/padlock_sha1_hasher.c
index 4489b902a..107ade09b 100644
--- a/src/libstrongswan/plugins/padlock/padlock_sha1_hasher.c
+++ b/src/libstrongswan/plugins/padlock/padlock_sha1_hasher.c
@@ -54,9 +54,9 @@ static void padlock_sha1(int len, u_char *in, u_char *out)
/**
* sha1() a buffer of data into digest
*/
-static void sha1(chunk_t data, u_int32_t *digest)
+static void sha1(chunk_t data, uint32_t *digest)
{
- u_int32_t hash[128] PADLOCK_ALIGN;
+ uint32_t hash[128] PADLOCK_ALIGN;
hash[0] = 0x67452301;
hash[1] = 0xefcdab89;
@@ -91,18 +91,18 @@ METHOD(hasher_t, reset, bool,
}
METHOD(hasher_t, get_hash, bool,
- private_padlock_sha1_hasher_t *this, chunk_t chunk, u_int8_t *hash)
+ private_padlock_sha1_hasher_t *this, chunk_t chunk, uint8_t *hash)
{
if (hash)
{
if (this->data.len)
{
append_data(this, chunk);
- sha1(this->data, (u_int32_t*)hash);
+ sha1(this->data, (uint32_t*)hash);
}
else
{ /* hash directly if no previous data found */
- sha1(chunk, (u_int32_t*)hash);
+ sha1(chunk, (uint32_t*)hash);
}
reset(this);
}
diff --git a/src/libstrongswan/plugins/pem/pem_builder.c b/src/libstrongswan/plugins/pem/pem_builder.c
index f0e508abf..719a2a69e 100644
--- a/src/libstrongswan/plugins/pem/pem_builder.c
+++ b/src/libstrongswan/plugins/pem/pem_builder.c
@@ -93,7 +93,7 @@ static status_t pem_decrypt(chunk_t *blob, encryption_algorithm_t alg,
chunk_t hash;
chunk_t decrypted;
chunk_t key = {alloca(key_size), key_size};
- u_int8_t padding, *last_padding_pos, *first_padding_pos;
+ uint8_t padding, *last_padding_pos, *first_padding_pos;
/* build key from passphrase and IV */
hasher = lib->crypto->create_hasher(lib->crypto, HASH_MD5);
diff --git a/src/libstrongswan/plugins/pgp/pgp_builder.c b/src/libstrongswan/plugins/pgp/pgp_builder.c
index 152e83aaa..fe0be45d9 100644
--- a/src/libstrongswan/plugins/pgp/pgp_builder.c
+++ b/src/libstrongswan/plugins/pgp/pgp_builder.c
@@ -26,7 +26,7 @@
*/
static public_key_t *parse_public_key(chunk_t blob)
{
- u_int32_t alg;
+ uint32_t alg;
public_key_t *key;
if (!pgp_read_scalar(&blob, 1, &alg))
@@ -74,7 +74,7 @@ static public_key_t *parse_rsa_public_key(chunk_t blob)
static private_key_t *parse_rsa_private_key(chunk_t blob)
{
chunk_t mpi[6];
- u_int32_t s2k;
+ uint32_t s2k;
int i;
for (i = 0; i < 2; i++)
@@ -143,7 +143,7 @@ static private_key_t *parse_private_key(chunk_t blob)
{
chunk_t packet;
pgp_packet_tag_t tag;
- u_int32_t version, created, days, alg;
+ uint32_t version, created, days, alg;
private_key_t *key;
if (!pgp_read_packet(&blob, &packet, &tag))
diff --git a/src/libstrongswan/plugins/pgp/pgp_cert.c b/src/libstrongswan/plugins/pgp/pgp_cert.c
index 89d7094ad..0ffce4cfc 100644
--- a/src/libstrongswan/plugins/pgp/pgp_cert.c
+++ b/src/libstrongswan/plugins/pgp/pgp_cert.c
@@ -40,17 +40,17 @@ struct private_pgp_cert_t {
/**
* version of the public key
*/
- u_int32_t version;
+ uint32_t version;
/**
* creation time
*/
- u_int32_t created;
+ uint32_t created;
/**
* days the certificate is valid
*/
- u_int32_t valid;
+ uint32_t valid;
/**
* userid of the certificate
@@ -349,7 +349,7 @@ static bool parse_public_key(private_pgp_cert_t *this, chunk_t packet)
*/
static bool parse_signature(private_pgp_cert_t *this, chunk_t packet)
{
- u_int32_t version, len, type, created;
+ uint32_t version, len, type, created;
if (!pgp_read_scalar(&packet, 1, &version))
{
diff --git a/src/libstrongswan/plugins/pgp/pgp_utils.c b/src/libstrongswan/plugins/pgp/pgp_utils.c
index bb15627fd..283bf8c36 100644
--- a/src/libstrongswan/plugins/pgp/pgp_utils.c
+++ b/src/libstrongswan/plugins/pgp/pgp_utils.c
@@ -73,9 +73,9 @@ ENUM_END(pgp_packet_tag_names, PGP_PKT_MOD_DETECT_CODE);
/**
* Read a PGP scalar of bytes length, advance blob
*/
-bool pgp_read_scalar(chunk_t *blob, size_t bytes, u_int32_t *scalar)
+bool pgp_read_scalar(chunk_t *blob, size_t bytes, uint32_t *scalar)
{
- u_int32_t res = 0;
+ uint32_t res = 0;
if (bytes > blob->len)
{
@@ -96,7 +96,7 @@ bool pgp_read_scalar(chunk_t *blob, size_t bytes, u_int32_t *scalar)
*/
bool pgp_read_mpi(chunk_t *blob, chunk_t *mpi)
{
- u_int32_t bits, bytes;
+ uint32_t bits, bytes;
if (!pgp_read_scalar(blob, 2, &bits))
{
@@ -117,7 +117,7 @@ bool pgp_read_mpi(chunk_t *blob, chunk_t *mpi)
/**
* Read length of an PGP old packet length encoding
*/
-static bool pgp_old_packet_length(chunk_t *blob, u_int32_t *length)
+static bool pgp_old_packet_length(chunk_t *blob, uint32_t *length)
{
/* bits 0 and 1 define the packet length type */
u_char type;
@@ -141,7 +141,7 @@ static bool pgp_old_packet_length(chunk_t *blob, u_int32_t *length)
*/
bool pgp_read_packet(chunk_t *blob, chunk_t *data, pgp_packet_tag_t *tag)
{
- u_int32_t len;
+ uint32_t len;
u_char t;
if (!blob->len)
diff --git a/src/libstrongswan/plugins/pgp/pgp_utils.h b/src/libstrongswan/plugins/pgp/pgp_utils.h
index 203a0a85d..180292a7a 100644
--- a/src/libstrongswan/plugins/pgp/pgp_utils.h
+++ b/src/libstrongswan/plugins/pgp/pgp_utils.h
@@ -115,7 +115,7 @@ bool pgp_read_mpi(chunk_t *blob, chunk_t *mpi);
* @param scalar resultin scalar
* @return TRUE if scalar parsed successfully
*/
-bool pgp_read_scalar(chunk_t *blob, size_t bytes, u_int32_t *scalar);
+bool pgp_read_scalar(chunk_t *blob, size_t bytes, uint32_t *scalar);
/**
* Parse a PGP packet.
diff --git a/src/libstrongswan/plugins/pkcs11/pkcs11_hasher.c b/src/libstrongswan/plugins/pkcs11/pkcs11_hasher.c
index 80079b9a9..847f03115 100644
--- a/src/libstrongswan/plugins/pkcs11/pkcs11_hasher.c
+++ b/src/libstrongswan/plugins/pkcs11/pkcs11_hasher.c
@@ -146,7 +146,7 @@ METHOD(hasher_t, reset, bool,
}
METHOD(hasher_t, get_hash, bool,
- private_pkcs11_hasher_t *this, chunk_t chunk, u_int8_t *hash)
+ private_pkcs11_hasher_t *this, chunk_t chunk, uint8_t *hash)
{
CK_RV rv;
CK_ULONG len;
diff --git a/src/libstrongswan/plugins/pkcs11/pkcs11_rng.c b/src/libstrongswan/plugins/pkcs11/pkcs11_rng.c
index d18028b45..753835187 100644
--- a/src/libstrongswan/plugins/pkcs11/pkcs11_rng.c
+++ b/src/libstrongswan/plugins/pkcs11/pkcs11_rng.c
@@ -44,7 +44,7 @@ struct private_pkcs11_rng_t {
};
METHOD(rng_t, get_bytes, bool,
- private_pkcs11_rng_t *this, size_t bytes, u_int8_t *buffer)
+ private_pkcs11_rng_t *this, size_t bytes, uint8_t *buffer)
{
CK_RV rv;
rv = this->lib->f->C_GenerateRandom(this->session, buffer, bytes);
diff --git a/src/libstrongswan/plugins/pkcs12/pkcs12_decode.c b/src/libstrongswan/plugins/pkcs12/pkcs12_decode.c
index 4441b278f..82fc0c0b9 100644
--- a/src/libstrongswan/plugins/pkcs12/pkcs12_decode.c
+++ b/src/libstrongswan/plugins/pkcs12/pkcs12_decode.c
@@ -324,7 +324,7 @@ end:
* Verify the given MAC with available passwords.
*/
static bool verify_mac(hash_algorithm_t hash, chunk_t salt,
- u_int64_t iterations, chunk_t data, chunk_t mac)
+ uint64_t iterations, chunk_t data, chunk_t mac)
{
integrity_algorithm_t integ;
enumerator_t *enumerator;
@@ -450,7 +450,7 @@ static bool parse_PFX(private_pkcs12_t *this, chunk_t blob)
data = chunk_empty;
hash_algorithm_t hash = HASH_UNKNOWN;
container_t *container = NULL;
- u_int64_t iterations = 0;
+ uint64_t iterations = 0;
bool success = FALSE;
parser = asn1_parser_create(PFXObjects, blob);
diff --git a/src/libstrongswan/plugins/plugin_feature.c b/src/libstrongswan/plugins/plugin_feature.c
index 0ea5eeaf8..4c92c412c 100644
--- a/src/libstrongswan/plugins/plugin_feature.c
+++ b/src/libstrongswan/plugins/plugin_feature.c
@@ -57,7 +57,7 @@ ENUM(plugin_feature_names, FEATURE_NONE, FEATURE_CUSTOM,
/**
* See header.
*/
-u_int32_t plugin_feature_hash(plugin_feature_t *feature)
+uint32_t plugin_feature_hash(plugin_feature_t *feature)
{
chunk_t data = chunk_empty;
diff --git a/src/libstrongswan/plugins/plugin_feature.h b/src/libstrongswan/plugins/plugin_feature.h
index 03f1ba8cc..ee7808a94 100644
--- a/src/libstrongswan/plugins/plugin_feature.h
+++ b/src/libstrongswan/plugins/plugin_feature.h
@@ -362,7 +362,7 @@ static inline void plugin_features_add(plugin_feature_t *features,
* @param feature feature to hash
* @return hash value of the feature
*/
-u_int32_t plugin_feature_hash(plugin_feature_t *feature);
+uint32_t plugin_feature_hash(plugin_feature_t *feature);
/**
* Check if feature a matches to feature b.
diff --git a/src/libstrongswan/plugins/random/random_rng.c b/src/libstrongswan/plugins/random/random_rng.c
index 177b3c2e5..3760630ab 100644
--- a/src/libstrongswan/plugins/random/random_rng.c
+++ b/src/libstrongswan/plugins/random/random_rng.c
@@ -41,7 +41,7 @@ struct private_random_rng_t {
};
METHOD(rng_t, get_bytes, bool,
- private_random_rng_t *this, size_t bytes, u_int8_t *buffer)
+ private_random_rng_t *this, size_t bytes, uint8_t *buffer)
{
size_t done;
ssize_t got;
diff --git a/src/libstrongswan/plugins/rc2/rc2_crypter.c b/src/libstrongswan/plugins/rc2/rc2_crypter.c
index 256acf817..d9681e834 100644
--- a/src/libstrongswan/plugins/rc2/rc2_crypter.c
+++ b/src/libstrongswan/plugins/rc2/rc2_crypter.c
@@ -19,11 +19,11 @@ typedef struct private_rc2_crypter_t private_rc2_crypter_t;
#define RC2_BLOCK_SIZE 8
-#define ROL16(x, k) ({ u_int16_t _x = (x); (_x << (k)) | (_x >> (16 - (k))); })
-#define ROR16(x, k) ({ u_int16_t _x = (x); (_x >> (k)) | (_x << (16 - (k))); })
+#define ROL16(x, k) ({ uint16_t _x = (x); (_x << (k)) | (_x >> (16 - (k))); })
+#define ROR16(x, k) ({ uint16_t _x = (x); (_x >> (k)) | (_x << (16 - (k))); })
-#define GET16(x) ({ u_char *_x = (x); (u_int16_t)_x[0] | ((u_int16_t)_x[1] << 8); })
-#define PUT16(x, v) ({ u_char *_x = (x); u_int16_t _v = (v); _x[0] = _v, _x[1] = _v >> 8; })
+#define GET16(x) ({ u_char *_x = (x); (uint16_t)_x[0] | ((uint16_t)_x[1] << 8); })
+#define PUT16(x, v) ({ u_char *_x = (x); uint16_t _v = (v); _x[0] = _v, _x[1] = _v >> 8; })
/**
* Private data of rc2_crypter_t
@@ -38,7 +38,7 @@ struct private_rc2_crypter_t {
/**
* The expanded key in 16-bit words
*/
- u_int16_t K[64];
+ uint16_t K[64];
/**
* Key size in bytes
@@ -95,7 +95,7 @@ static const u_char PITABLE[256] =
*/
static void encrypt_block(private_rc2_crypter_t *this, u_char R[])
{
- register u_int16_t R0, R1, R2, R3, *Kj;
+ register uint16_t R0, R1, R2, R3, *Kj;
int rounds = 3, mix = 5;
R0 = GET16(R);
@@ -139,7 +139,7 @@ static void encrypt_block(private_rc2_crypter_t *this, u_char R[])
*/
static void decrypt_block(private_rc2_crypter_t *this, u_char R[])
{
- register u_int16_t R0, R1, R2, R3, *Kj;
+ register uint16_t R0, R1, R2, R3, *Kj;
int rounds = 3, mix = 5;
R0 = GET16(R);
@@ -185,7 +185,7 @@ static void decrypt_block(private_rc2_crypter_t *this, u_char R[])
METHOD(crypter_t, decrypt, bool,
private_rc2_crypter_t *this, chunk_t data, chunk_t iv, chunk_t *decrypted)
{
- u_int8_t *in, *out, *prev;
+ uint8_t *in, *out, *prev;
if (data.len % RC2_BLOCK_SIZE || iv.len != RC2_BLOCK_SIZE)
{
@@ -222,7 +222,7 @@ METHOD(crypter_t, decrypt, bool,
METHOD(crypter_t, encrypt, bool,
private_rc2_crypter_t *this, chunk_t data, chunk_t iv, chunk_t *encrypted)
{
- u_int8_t *in, *out, *end, *prev;
+ uint8_t *in, *out, *end, *prev;
if (data.len % RC2_BLOCK_SIZE || iv.len != RC2_BLOCK_SIZE)
{
@@ -273,7 +273,7 @@ METHOD(crypter_t, get_key_size, size_t,
METHOD(crypter_t, set_key, bool,
private_rc2_crypter_t *this, chunk_t key)
{
- u_int8_t L[128], T8, TM, idx;
+ uint8_t L[128], T8, TM, idx;
int i;
if (key.len != this->T)
diff --git a/src/libstrongswan/plugins/rdrand/rdrand_rng.c b/src/libstrongswan/plugins/rdrand/rdrand_rng.c
index fa66f3ad7..b7225b6a2 100644
--- a/src/libstrongswan/plugins/rdrand/rdrand_rng.c
+++ b/src/libstrongswan/plugins/rdrand/rdrand_rng.c
@@ -54,7 +54,7 @@ struct private_rdrand_rng_t {
/**
* Get a two byte word using RDRAND
*/
-static bool rdrand16(u_int16_t *out)
+static bool rdrand16(uint16_t *out)
{
u_char res;
int i;
@@ -76,7 +76,7 @@ static bool rdrand16(u_int16_t *out)
/**
* Get a four byte word using RDRAND
*/
-static bool rdrand32(u_int32_t *out)
+static bool rdrand32(uint32_t *out)
{
u_char res;
int i;
@@ -99,7 +99,7 @@ static bool rdrand32(u_int32_t *out)
/**
* Get a eight byte word using RDRAND
*/
-static bool rdrand64(u_int64_t *out)
+static bool rdrand64(uint64_t *out)
{
u_char res;
int i;
@@ -122,9 +122,9 @@ static bool rdrand64(u_int64_t *out)
/**
* Get a one byte word using RDRAND
*/
-static bool rdrand8(u_int8_t *out)
+static bool rdrand8(uint8_t *out)
{
- u_int16_t u16;
+ uint16_t u16;
if (!rdrand16(&u16))
{
@@ -141,15 +141,15 @@ static bool rdrand128(void *out)
{
#ifdef __x86_64__
if (!rdrand64(out) ||
- !rdrand64(out + sizeof(u_int64_t)))
+ !rdrand64(out + sizeof(uint64_t)))
{
return FALSE;
}
#else /* __i386__ */
if (!rdrand32(out) ||
- !rdrand32(out + 1 * sizeof(u_int32_t)) ||
- !rdrand32(out + 2 * sizeof(u_int32_t)) ||
- !rdrand32(out + 3 * sizeof(u_int32_t)))
+ !rdrand32(out + 1 * sizeof(uint32_t)) ||
+ !rdrand32(out + 2 * sizeof(uint32_t)) ||
+ !rdrand32(out + 3 * sizeof(uint32_t)))
{
return FALSE;
}
@@ -165,9 +165,9 @@ static bool reseed()
int i;
#ifdef __x86_64__
- u_int64_t tmp;
+ uint64_t tmp;
- for (i = 0; i < 511 * 16 / sizeof(u_int64_t); i++)
+ for (i = 0; i < 511 * 16 / sizeof(uint64_t); i++)
{
if (!rdrand64(&tmp))
{
@@ -175,9 +175,9 @@ static bool reseed()
}
}
#else /* __i386__ */
- u_int32_t tmp;
+ uint32_t tmp;
- for (i = 0; i < 511 * 16 / sizeof(u_int32_t); i++)
+ for (i = 0; i < 511 * 16 / sizeof(uint32_t); i++)
{
if (!rdrand32(&tmp))
{
@@ -202,48 +202,48 @@ static bool rdrand_chunk(private_rdrand_rng_t *this, chunk_t chunk)
}
/* align to 2 byte */
- if (chunk.len >= sizeof(u_int8_t))
+ if (chunk.len >= sizeof(uint8_t))
{
if ((uintptr_t)chunk.ptr % 2)
{
- if (!rdrand8((u_int8_t*)chunk.ptr))
+ if (!rdrand8((uint8_t*)chunk.ptr))
{
return FALSE;
}
- chunk = chunk_skip(chunk, sizeof(u_int8_t));
+ chunk = chunk_skip(chunk, sizeof(uint8_t));
}
}
/* align to 4 byte */
- if (chunk.len >= sizeof(u_int16_t))
+ if (chunk.len >= sizeof(uint16_t))
{
if ((uintptr_t)chunk.ptr % 4)
{
- if (!rdrand16((u_int16_t*)chunk.ptr))
+ if (!rdrand16((uint16_t*)chunk.ptr))
{
return FALSE;
}
- chunk = chunk_skip(chunk, sizeof(u_int16_t));
+ chunk = chunk_skip(chunk, sizeof(uint16_t));
}
}
#ifdef __x86_64__
/* align to 8 byte */
- if (chunk.len >= sizeof(u_int32_t))
+ if (chunk.len >= sizeof(uint32_t))
{
if ((uintptr_t)chunk.ptr % 8)
{
- if (!rdrand32((u_int32_t*)chunk.ptr))
+ if (!rdrand32((uint32_t*)chunk.ptr))
{
return FALSE;
}
- chunk = chunk_skip(chunk, sizeof(u_int32_t));
+ chunk = chunk_skip(chunk, sizeof(uint32_t));
}
}
/* fill with 8 byte words */
- while (chunk.len >= sizeof(u_int64_t))
+ while (chunk.len >= sizeof(uint64_t))
{
if (this->quality == RNG_STRONG && chunk.len % FORCE_RESEED == 0)
{
@@ -252,27 +252,27 @@ static bool rdrand_chunk(private_rdrand_rng_t *this, chunk_t chunk)
return FALSE;
}
}
- if (!rdrand64((u_int64_t*)chunk.ptr))
+ if (!rdrand64((uint64_t*)chunk.ptr))
{
return FALSE;
}
- chunk = chunk_skip(chunk, sizeof(u_int64_t));
+ chunk = chunk_skip(chunk, sizeof(uint64_t));
}
/* append 4 byte word */
- if (chunk.len >= sizeof(u_int32_t))
+ if (chunk.len >= sizeof(uint32_t))
{
- if (!rdrand32((u_int32_t*)chunk.ptr))
+ if (!rdrand32((uint32_t*)chunk.ptr))
{
return FALSE;
}
- chunk = chunk_skip(chunk, sizeof(u_int32_t));
+ chunk = chunk_skip(chunk, sizeof(uint32_t));
}
#else /* __i386__ */
/* fill with 4 byte words */
- while (chunk.len >= sizeof(u_int32_t))
+ while (chunk.len >= sizeof(uint32_t))
{
if (this->quality == RNG_STRONG && chunk.len % FORCE_RESEED == 0)
{
@@ -281,11 +281,11 @@ static bool rdrand_chunk(private_rdrand_rng_t *this, chunk_t chunk)
return FALSE;
}
}
- if (!rdrand32((u_int32_t*)chunk.ptr))
+ if (!rdrand32((uint32_t*)chunk.ptr))
{
return FALSE;
}
- chunk = chunk_skip(chunk, sizeof(u_int32_t));
+ chunk = chunk_skip(chunk, sizeof(uint32_t));
}
#endif /* __x86_64__ / __i386__ */
@@ -299,23 +299,23 @@ static bool rdrand_chunk(private_rdrand_rng_t *this, chunk_t chunk)
}
/* append 2 byte word */
- if (chunk.len >= sizeof(u_int16_t))
+ if (chunk.len >= sizeof(uint16_t))
{
- if (!rdrand16((u_int16_t*)chunk.ptr))
+ if (!rdrand16((uint16_t*)chunk.ptr))
{
return FALSE;
}
- chunk = chunk_skip(chunk, sizeof(u_int16_t));
+ chunk = chunk_skip(chunk, sizeof(uint16_t));
}
/* append 1 byte word */
- if (chunk.len >= sizeof(u_int8_t))
+ if (chunk.len >= sizeof(uint8_t))
{
- if (!rdrand8((u_int8_t*)chunk.ptr))
+ if (!rdrand8((uint8_t*)chunk.ptr))
{
return FALSE;
}
- chunk = chunk_skip(chunk, sizeof(u_int8_t));
+ chunk = chunk_skip(chunk, sizeof(uint8_t));
}
return TRUE;
@@ -378,7 +378,7 @@ static bool rdrand_mixed(private_rdrand_rng_t *this, chunk_t chunk)
}
METHOD(rng_t, get_bytes, bool,
- private_rdrand_rng_t *this, size_t bytes, u_int8_t *buffer)
+ private_rdrand_rng_t *this, size_t bytes, uint8_t *buffer)
{
switch (this->quality)
{
diff --git a/src/libstrongswan/plugins/sha1/sha1_hasher.c b/src/libstrongswan/plugins/sha1/sha1_hasher.c
index b51a26152..fca65dfa2 100644
--- a/src/libstrongswan/plugins/sha1/sha1_hasher.c
+++ b/src/libstrongswan/plugins/sha1/sha1_hasher.c
@@ -59,20 +59,20 @@ struct private_sha1_hasher_t {
/*
* State of the hasher. Shared with sha1_prf.c, do not change it!!!
*/
- u_int32_t state[5];
- u_int32_t count[2];
- u_int8_t buffer[64];
+ uint32_t state[5];
+ uint32_t count[2];
+ uint8_t buffer[64];
};
/*
* Hash a single 512-bit block. This is the core of the algorithm. *
*/
-static void SHA1Transform(u_int32_t state[5], const unsigned char buffer[64])
+static void SHA1Transform(uint32_t state[5], const unsigned char buffer[64])
{
- u_int32_t a, b, c, d, e;
+ uint32_t a, b, c, d, e;
typedef union {
- u_int8_t c[64];
- u_int32_t l[16];
+ uint8_t c[64];
+ uint32_t l[16];
} CHAR64LONG16;
CHAR64LONG16 block[1]; /* use array to appear as a pointer */
memcpy(block, buffer, 64);
@@ -118,10 +118,10 @@ static void SHA1Transform(u_int32_t state[5], const unsigned char buffer[64])
/**
* Run your data through this. Also used in sha1_prf.
*/
-void SHA1Update(private_sha1_hasher_t* this, u_int8_t *data, u_int32_t len)
+void SHA1Update(private_sha1_hasher_t* this, uint8_t *data, uint32_t len)
{
- u_int32_t i;
- u_int32_t j;
+ uint32_t i;
+ uint32_t j;
j = this->count[0];
if ((this->count[0] += len << 3) < j)
@@ -151,15 +151,15 @@ void SHA1Update(private_sha1_hasher_t* this, u_int8_t *data, u_int32_t len)
/*
* Add padding and return the message digest.
*/
-static void SHA1Final(private_sha1_hasher_t *this, u_int8_t *digest)
+static void SHA1Final(private_sha1_hasher_t *this, uint8_t *digest)
{
- u_int32_t i;
- u_int8_t finalcount[8];
- u_int8_t c;
+ uint32_t i;
+ uint8_t finalcount[8];
+ uint8_t c;
for (i = 0; i < 8; i++)
{
- finalcount[i] = (u_int8_t)((this->count[(i >= 4 ? 0 : 1)]
+ finalcount[i] = (uint8_t)((this->count[(i >= 4 ? 0 : 1)]
>> ((3-(i & 3)) * 8) ) & 255); /* Endian independent */
}
c = 0200;
@@ -172,7 +172,7 @@ static void SHA1Final(private_sha1_hasher_t *this, u_int8_t *digest)
SHA1Update(this, finalcount, 8); /* Should cause a SHA1Transform() */
for (i = 0; i < 20; i++)
{
- digest[i] = (u_int8_t)((this->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);
+ digest[i] = (uint8_t)((this->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);
}
}
@@ -191,7 +191,7 @@ METHOD(hasher_t, reset, bool,
}
METHOD(hasher_t, get_hash, bool,
- private_sha1_hasher_t *this, chunk_t chunk, u_int8_t *buffer)
+ private_sha1_hasher_t *this, chunk_t chunk, uint8_t *buffer)
{
SHA1Update(this, chunk.ptr, chunk.len);
if (buffer != NULL)
diff --git a/src/libstrongswan/plugins/sha1/sha1_prf.c b/src/libstrongswan/plugins/sha1/sha1_prf.c
index cc4924a80..464f4c9ec 100644
--- a/src/libstrongswan/plugins/sha1/sha1_prf.c
+++ b/src/libstrongswan/plugins/sha1/sha1_prf.c
@@ -33,9 +33,9 @@ struct private_sha1_hasher_t {
/*
* State of the hasher. From sha1_hasher.c, do not change it!
*/
- u_int32_t state[5];
- u_int32_t count[2];
- u_int8_t buffer[64];
+ uint32_t state[5];
+ uint32_t count[2];
+ uint8_t buffer[64];
};
/**
@@ -57,12 +57,12 @@ struct private_sha1_prf_t {
/**
* From sha1_hasher.c
*/
-extern void SHA1Update(private_sha1_hasher_t* this, u_int8_t *data, u_int32_t len);
+extern void SHA1Update(private_sha1_hasher_t* this, uint8_t *data, uint32_t len);
METHOD(prf_t, get_bytes, bool,
- private_sha1_prf_t *this, chunk_t seed, u_int8_t *bytes)
+ private_sha1_prf_t *this, chunk_t seed, uint8_t *bytes)
{
- u_int32_t *hash = (u_int32_t*)bytes;
+ uint32_t *hash = (uint32_t*)bytes;
SHA1Update(this->hasher, seed.ptr, seed.len);
@@ -98,14 +98,14 @@ METHOD(prf_t, set_key, bool,
private_sha1_prf_t *this, chunk_t key)
{
int i, rounds;
- u_int32_t *iv = (u_int32_t*)key.ptr;
+ uint32_t *iv = (uint32_t*)key.ptr;
if (!this->hasher->public.hasher_interface.reset(
&this->hasher->public.hasher_interface))
{
return FALSE;
}
- rounds = min(key.len/sizeof(u_int32_t), sizeof(this->hasher->state));
+ rounds = min(key.len/sizeof(uint32_t), sizeof(this->hasher->state));
for (i = 0; i < rounds; i++)
{
this->hasher->state[i] ^= htonl(iv[i]);
diff --git a/src/libstrongswan/plugins/sha2/sha2_hasher.c b/src/libstrongswan/plugins/sha2/sha2_hasher.c
index 1c6dd2533..89e7675e3 100644
--- a/src/libstrongswan/plugins/sha2/sha2_hasher.c
+++ b/src/libstrongswan/plugins/sha2/sha2_hasher.c
@@ -33,9 +33,9 @@ struct private_sha512_hasher_t {
sha2_hasher_t public;
unsigned char sha_out[128]; /* results are here, bytes 0..47/0..63 */
- u_int64_t sha_H[8];
- u_int64_t sha_blocks;
- u_int64_t sha_blocksMSB;
+ uint64_t sha_H[8];
+ uint64_t sha_blocks;
+ uint64_t sha_blocksMSB;
int sha_bufCnt;
};
@@ -52,23 +52,23 @@ struct private_sha256_hasher_t {
sha2_hasher_t public;
unsigned char sha_out[64]; /* results are here, bytes 0...31 */
- u_int32_t sha_H[8];
- u_int64_t sha_blocks;
+ uint32_t sha_H[8];
+ uint64_t sha_blocks;
int sha_bufCnt;
};
-static const u_int32_t sha224_hashInit[8] = {
+static const uint32_t sha224_hashInit[8] = {
0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511,
0x64f98fa7, 0xbefa4fa4
};
-static const u_int32_t sha256_hashInit[8] = {
+static const uint32_t sha256_hashInit[8] = {
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c,
0x1f83d9ab, 0x5be0cd19
};
-static const u_int32_t sha256_K[64] = {
+static const uint32_t sha256_K[64] = {
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1,
0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786,
@@ -82,19 +82,19 @@ static const u_int32_t sha256_K[64] = {
0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
};
-static const u_int64_t sha512_hashInit[8] = {
+static const uint64_t sha512_hashInit[8] = {
0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, 0x3c6ef372fe94f82bULL,
0xa54ff53a5f1d36f1ULL, 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL,
0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL
};
-static const u_int64_t sha384_hashInit[8] = {
+static const uint64_t sha384_hashInit[8] = {
0xcbbb9d5dc1059ed8ULL, 0x629a292a367cd507ULL, 0x9159015a3070dd17ULL,
0x152fecd8f70e5939ULL, 0x67332667ffc00b31ULL, 0x8eb44a8768581511ULL,
0xdb0c2e0d64f98fa7ULL, 0x47b5481dbefa4fa4ULL
};
-static const u_int64_t sha512_K[80] = {
+static const uint64_t sha512_K[80] = {
0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL,
0xe9b5dba58189dbbcULL, 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL,
0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, 0xd807aa98a3030242ULL,
@@ -143,14 +143,14 @@ static void sha256_transform(private_sha256_hasher_t *ctx,
const unsigned char *datap)
{
register int j;
- u_int32_t a, b, c, d, e, f, g, h;
- u_int32_t T1, T2, W[64], Wm2, Wm15;
+ uint32_t a, b, c, d, e, f, g, h;
+ uint32_t T1, T2, W[64], Wm2, Wm15;
/* read the data, big endian byte order */
j = 0;
do {
- W[j] = (((u_int32_t)(datap[0]))<<24) | (((u_int32_t)(datap[1]))<<16) |
- (((u_int32_t)(datap[2]))<<8 ) | ((u_int32_t)(datap[3]));
+ W[j] = (((uint32_t)(datap[0]))<<24) | (((uint32_t)(datap[1]))<<16) |
+ (((uint32_t)(datap[2]))<<8 ) | ((uint32_t)(datap[3]));
datap += 4;
} while(++j < 16);
@@ -229,8 +229,8 @@ static void sha256_write(private_sha256_hasher_t *ctx,
static void sha256_final(private_sha256_hasher_t *ctx)
{
register int j;
- u_int64_t bitLength;
- u_int32_t i;
+ uint64_t bitLength;
+ uint32_t i;
unsigned char padByte, *datap;
bitLength = (ctx->sha_blocks << 9) | (ctx->sha_bufCnt << 3);
@@ -287,16 +287,16 @@ static void sha512_transform(private_sha512_hasher_t *ctx,
const unsigned char *datap)
{
register int j;
- u_int64_t a, b, c, d, e, f, g, h;
- u_int64_t T1, T2, W[80], Wm2, Wm15;
+ uint64_t a, b, c, d, e, f, g, h;
+ uint64_t T1, T2, W[80], Wm2, Wm15;
/* read the data, big endian byte order */
j = 0;
do {
- W[j] = (((u_int64_t)(datap[0]))<<56) | (((u_int64_t)(datap[1]))<<48) |
- (((u_int64_t)(datap[2]))<<40) | (((u_int64_t)(datap[3]))<<32) |
- (((u_int64_t)(datap[4]))<<24) | (((u_int64_t)(datap[5]))<<16) |
- (((u_int64_t)(datap[6]))<<8 ) | ((u_int64_t)(datap[7]));
+ W[j] = (((uint64_t)(datap[0]))<<56) | (((uint64_t)(datap[1]))<<48) |
+ (((uint64_t)(datap[2]))<<40) | (((uint64_t)(datap[3]))<<32) |
+ (((uint64_t)(datap[4]))<<24) | (((uint64_t)(datap[5]))<<16) |
+ (((uint64_t)(datap[6]))<<8 ) | ((uint64_t)(datap[7]));
datap += 8;
} while(++j < 16);
@@ -374,8 +374,8 @@ static void sha512_write(private_sha512_hasher_t *ctx,
static void sha512_final(private_sha512_hasher_t *ctx)
{
register int j;
- u_int64_t bitLength, bitLengthMSB;
- u_int64_t i;
+ uint64_t bitLength, bitLengthMSB;
+ uint64_t i;
unsigned char padByte, *datap;
bitLength = (ctx->sha_blocks << 10) | (ctx->sha_bufCnt << 3);
@@ -469,7 +469,7 @@ METHOD(hasher_t, reset512, bool,
}
METHOD(hasher_t, get_hash224, bool,
- private_sha256_hasher_t *this, chunk_t chunk, u_int8_t *buffer)
+ private_sha256_hasher_t *this, chunk_t chunk, uint8_t *buffer)
{
sha256_write(this, chunk.ptr, chunk.len);
if (buffer != NULL)
@@ -482,7 +482,7 @@ METHOD(hasher_t, get_hash224, bool,
}
METHOD(hasher_t, get_hash256, bool,
- private_sha256_hasher_t *this, chunk_t chunk, u_int8_t *buffer)
+ private_sha256_hasher_t *this, chunk_t chunk, uint8_t *buffer)
{
sha256_write(this, chunk.ptr, chunk.len);
if (buffer != NULL)
@@ -495,7 +495,7 @@ METHOD(hasher_t, get_hash256, bool,
}
METHOD(hasher_t, get_hash384, bool,
- private_sha512_hasher_t *this, chunk_t chunk, u_int8_t *buffer)
+ private_sha512_hasher_t *this, chunk_t chunk, uint8_t *buffer)
{
sha512_write(this, chunk.ptr, chunk.len);
if (buffer != NULL)
@@ -508,7 +508,7 @@ METHOD(hasher_t, get_hash384, bool,
}
METHOD(hasher_t, get_hash512, bool,
- private_sha512_hasher_t *this, chunk_t chunk, u_int8_t *buffer)
+ private_sha512_hasher_t *this, chunk_t chunk, uint8_t *buffer)
{
sha512_write(this, chunk.ptr, chunk.len);
if (buffer != NULL)
diff --git a/src/libstrongswan/plugins/winhttp/winhttp_fetcher.c b/src/libstrongswan/plugins/winhttp/winhttp_fetcher.c
index 5f0b58479..da56954ab 100644
--- a/src/libstrongswan/plugins/winhttp/winhttp_fetcher.c
+++ b/src/libstrongswan/plugins/winhttp/winhttp_fetcher.c
@@ -120,7 +120,7 @@ static bool read_result(private_winhttp_fetcher_t *this, HINTERNET request,
{
DWORD received;
char buf[1024];
- u_int32_t code;
+ uint32_t code;
DWORD codelen = sizeof(code);
if (!WinHttpReceiveResponse(request, NULL))
diff --git a/src/libstrongswan/plugins/xcbc/xcbc.c b/src/libstrongswan/plugins/xcbc/xcbc.c
index d852a2932..820298e27 100644
--- a/src/libstrongswan/plugins/xcbc/xcbc.c
+++ b/src/libstrongswan/plugins/xcbc/xcbc.c
@@ -40,7 +40,7 @@ struct private_mac_t {
/**
* Block size, in bytes
*/
- u_int8_t b;
+ uint8_t b;
/**
* crypter using k1
@@ -50,22 +50,22 @@ struct private_mac_t {
/**
* k2
*/
- u_int8_t *k2;
+ uint8_t *k2;
/**
* k3
*/
- u_int8_t *k3;
+ uint8_t *k3;
/**
* E
*/
- u_int8_t *e;
+ uint8_t *e;
/**
* remaining, unprocessed bytes in append mode
*/
- u_int8_t *remaining;
+ uint8_t *remaining;
/**
* number of bytes in remaining
@@ -138,7 +138,7 @@ static bool update(private_mac_t *this, chunk_t data)
/**
* run last round, data is in this->e
*/
-static bool final(private_mac_t *this, u_int8_t *out)
+static bool final(private_mac_t *this, uint8_t *out)
{
chunk_t iv;
@@ -193,7 +193,7 @@ static bool final(private_mac_t *this, u_int8_t *out)
}
METHOD(mac_t, get_mac, bool,
- private_mac_t *this, chunk_t data, u_int8_t *out)
+ private_mac_t *this, chunk_t data, uint8_t *out)
{
/* update E, do not process last block */
if (!update(this, data))
@@ -294,7 +294,7 @@ static mac_t *xcbc_create(encryption_algorithm_t algo, size_t key_size)
{
private_mac_t *this;
crypter_t *crypter;
- u_int8_t b;
+ uint8_t b;
crypter = lib->crypto->create_crypter(lib->crypto, algo, key_size);
if (!crypter)
diff --git a/src/libstrongswan/processing/jobs/job.h b/src/libstrongswan/processing/jobs/job.h
index 64454718a..5b3a8a30b 100644
--- a/src/libstrongswan/processing/jobs/job.h
+++ b/src/libstrongswan/processing/jobs/job.h
@@ -96,7 +96,7 @@ struct job_requeue_t {
} schedule;
/** Time to reschedule the job */
union {
- u_int32_t rel;
+ uint32_t rel;
timeval_t abs;
} time;
};
diff --git a/src/libstrongswan/processing/scheduler.c b/src/libstrongswan/processing/scheduler.c
index d90852561..374742939 100644
--- a/src/libstrongswan/processing/scheduler.c
+++ b/src/libstrongswan/processing/scheduler.c
@@ -276,7 +276,7 @@ METHOD(scheduler_t, schedule_job_tv, void,
}
METHOD(scheduler_t, schedule_job, void,
- private_scheduler_t *this, job_t *job, u_int32_t s)
+ private_scheduler_t *this, job_t *job, uint32_t s)
{
timeval_t tv;
@@ -287,7 +287,7 @@ METHOD(scheduler_t, schedule_job, void,
}
METHOD(scheduler_t, schedule_job_ms, void,
- private_scheduler_t *this, job_t *job, u_int32_t ms)
+ private_scheduler_t *this, job_t *job, uint32_t ms)
{
timeval_t tv, add;
diff --git a/src/libstrongswan/processing/scheduler.h b/src/libstrongswan/processing/scheduler.h
index 7f91fcc59..1cd96d976 100644
--- a/src/libstrongswan/processing/scheduler.h
+++ b/src/libstrongswan/processing/scheduler.h
@@ -86,7 +86,7 @@ struct scheduler_t {
* @param job job to schedule
* @param time relative time to schedule job, in s
*/
- void (*schedule_job) (scheduler_t *this, job_t *job, u_int32_t s);
+ void (*schedule_job) (scheduler_t *this, job_t *job, uint32_t s);
/**
* Adds a event to the queue, using a relative time offset in ms.
@@ -94,7 +94,7 @@ struct scheduler_t {
* @param job job to schedule
* @param time relative time to schedule job, in ms
*/
- void (*schedule_job_ms) (scheduler_t *this, job_t *job, u_int32_t ms);
+ void (*schedule_job_ms) (scheduler_t *this, job_t *job, uint32_t ms);
/**
* Adds a event to the queue, using an absolut time.
diff --git a/src/libstrongswan/selectors/traffic_selector.c b/src/libstrongswan/selectors/traffic_selector.c
index a6298b394..da3ba97cf 100644
--- a/src/libstrongswan/selectors/traffic_selector.c
+++ b/src/libstrongswan/selectors/traffic_selector.c
@@ -52,7 +52,7 @@ struct private_traffic_selector_t {
/**
* IP protocol (UDP, TCP, ICMP, ...)
*/
- u_int8_t protocol;
+ uint8_t protocol;
/**
* narrow this traffic selector to hosts external ip
@@ -63,7 +63,7 @@ struct private_traffic_selector_t {
/**
* subnet size in CIDR notation, 255 means a non-subnet address range
*/
- u_int8_t netbits;
+ uint8_t netbits;
/**
* begin of address range, network order
@@ -72,9 +72,9 @@ struct private_traffic_selector_t {
/** dummy char for common address manipulation */
char from[0];
/** IPv4 address */
- u_int32_t from4[1];
+ uint32_t from4[1];
/** IPv6 address */
- u_int32_t from6[4];
+ uint32_t from6[4];
};
/**
@@ -84,30 +84,30 @@ struct private_traffic_selector_t {
/** dummy char for common address manipulation */
char to[0];
/** IPv4 address */
- u_int32_t to4[1];
+ uint32_t to4[1];
/** IPv6 address */
- u_int32_t to6[4];
+ uint32_t to6[4];
};
/**
* begin of port range
*/
- u_int16_t from_port;
+ uint16_t from_port;
/**
* end of port range
*/
- u_int16_t to_port;
+ uint16_t to_port;
};
/**
* calculate the "to"-address for the "from" address and a subnet size
*/
-static void calc_range(private_traffic_selector_t *this, u_int8_t netbits)
+static void calc_range(private_traffic_selector_t *this, uint8_t netbits)
{
size_t len;
int bytes, bits;
- u_int8_t mask;
+ uint8_t mask;
this->netbits = netbits;
@@ -126,10 +126,10 @@ static void calc_range(private_traffic_selector_t *this, u_int8_t netbits)
/**
* calculate the subnet size from the "to" and "from" addresses
*/
-static u_int8_t calc_netbits(private_traffic_selector_t *this)
+static uint8_t calc_netbits(private_traffic_selector_t *this)
{
int byte, bit;
- u_int8_t netbits;
+ uint8_t netbits;
size_t size = (this->type == TS_IPV4_ADDR_RANGE) ? 4 : 16;
bool prefix = TRUE;
@@ -144,7 +144,7 @@ static u_int8_t calc_netbits(private_traffic_selector_t *this)
{
for (bit = 7; bit >= 0; bit--)
{
- u_int8_t bitmask = 1 << bit;
+ uint8_t bitmask = 1 << bit;
if (prefix)
{
@@ -173,8 +173,8 @@ static u_int8_t calc_netbits(private_traffic_selector_t *this)
/**
* internal generic constructor
*/
-static private_traffic_selector_t *traffic_selector_create(u_int8_t protocol,
- ts_type_t type, u_int16_t from_port, u_int16_t to_port);
+static private_traffic_selector_t *traffic_selector_create(uint8_t protocol,
+ ts_type_t type, uint16_t from_port, uint16_t to_port);
/**
* Check if TS contains "opaque" ports
@@ -195,9 +195,9 @@ static bool is_any(private_traffic_selector_t *this)
/**
* Print ICMP/ICMPv6 type and code
*/
-static int print_icmp(printf_hook_data_t *data, u_int16_t port)
+static int print_icmp(printf_hook_data_t *data, uint16_t port)
{
- u_int8_t type, code;
+ uint8_t type, code;
type = traffic_selector_icmp_type(port);
code = traffic_selector_icmp_code(port);
@@ -222,7 +222,7 @@ int traffic_selector_printf_hook(printf_hook_data_t *data,
char *serv_proto = NULL, *sep = "";
bool has_proto, has_ports;
size_t written = 0;
- u_int32_t from[4], to[4];
+ uint32_t from[4], to[4];
if (this == NULL)
{
@@ -361,9 +361,9 @@ METHOD(traffic_selector_t, get_subset, traffic_selector_t*,
private_traffic_selector_t *this, traffic_selector_t *other_public)
{
private_traffic_selector_t *other, *subset;
- u_int16_t from_port, to_port;
+ uint16_t from_port, to_port;
u_char *from, *to;
- u_int8_t protocol;
+ uint8_t protocol;
size_t size;
other = (private_traffic_selector_t*)other_public;
@@ -481,13 +481,13 @@ METHOD(traffic_selector_t, get_to_address, chunk_t,
}
}
-METHOD(traffic_selector_t, get_from_port, u_int16_t,
+METHOD(traffic_selector_t, get_from_port, uint16_t,
private_traffic_selector_t *this)
{
return this->from_port;
}
-METHOD(traffic_selector_t, get_to_port, u_int16_t,
+METHOD(traffic_selector_t, get_to_port, uint16_t,
private_traffic_selector_t *this)
{
return this->to_port;
@@ -499,7 +499,7 @@ METHOD(traffic_selector_t, get_type, ts_type_t,
return this->type;
}
-METHOD(traffic_selector_t, get_protocol, u_int8_t,
+METHOD(traffic_selector_t, get_protocol, uint8_t,
private_traffic_selector_t *this)
{
return this->protocol;
@@ -610,14 +610,14 @@ METHOD(traffic_selector_t, includes, bool,
}
METHOD(traffic_selector_t, to_subnet, bool,
- private_traffic_selector_t *this, host_t **net, u_int8_t *mask)
+ private_traffic_selector_t *this, host_t **net, uint8_t *mask)
{
/* there is no way to do this cleanly, as the address range may
* be anything else but a subnet. We use from_addr as subnet
* and try to calculate a usable subnet mask.
*/
int family, non_zero_bytes;
- u_int16_t port = 0;
+ uint16_t port = 0;
chunk_t net_chunk;
*mask = (this->netbits == NON_SUBNET_ADDRESS_RANGE) ? calc_netbits(this)
@@ -777,10 +777,10 @@ int traffic_selector_cmp(traffic_selector_t *a_pub, traffic_selector_t *b_pub,
/*
* see header
*/
-traffic_selector_t *traffic_selector_create_from_bytes(u_int8_t protocol,
+traffic_selector_t *traffic_selector_create_from_bytes(uint8_t protocol,
ts_type_t type,
- chunk_t from, u_int16_t from_port,
- chunk_t to, u_int16_t to_port)
+ chunk_t from, uint16_t from_port,
+ chunk_t to, uint16_t to_port)
{
private_traffic_selector_t *this = traffic_selector_create(protocol, type,
from_port, to_port);
@@ -843,7 +843,7 @@ traffic_selector_t *traffic_selector_create_from_rfc3779_format(ts_type_t type,
}
if (to.len > 1)
{
- u_int8_t mask = to.ptr[0] ? (1 << to.ptr[0]) - 1 : 0;
+ uint8_t mask = to.ptr[0] ? (1 << to.ptr[0]) - 1 : 0;
memcpy(this->to, to.ptr+1, to.len-1);
this->to[to.len-2] |= mask;
@@ -856,8 +856,8 @@ traffic_selector_t *traffic_selector_create_from_rfc3779_format(ts_type_t type,
* see header
*/
traffic_selector_t *traffic_selector_create_from_subnet(host_t *net,
- u_int8_t netbits, u_int8_t protocol,
- u_int16_t from_port, u_int16_t to_port)
+ uint8_t netbits, uint8_t protocol,
+ uint16_t from_port, uint16_t to_port)
{
private_traffic_selector_t *this;
chunk_t from;
@@ -890,9 +890,9 @@ traffic_selector_t *traffic_selector_create_from_subnet(host_t *net,
* see header
*/
traffic_selector_t *traffic_selector_create_from_string(
- u_int8_t protocol, ts_type_t type,
- char *from_addr, u_int16_t from_port,
- char *to_addr, u_int16_t to_port)
+ uint8_t protocol, ts_type_t type,
+ char *from_addr, uint16_t from_port,
+ char *to_addr, uint16_t to_port)
{
private_traffic_selector_t *this;
int family;
@@ -926,8 +926,8 @@ traffic_selector_t *traffic_selector_create_from_string(
* see header
*/
traffic_selector_t *traffic_selector_create_from_cidr(
- char *string, u_int8_t protocol,
- u_int16_t from_port, u_int16_t to_port)
+ char *string, uint8_t protocol,
+ uint16_t from_port, uint16_t to_port)
{
host_t *net;
int bits;
@@ -944,8 +944,8 @@ traffic_selector_t *traffic_selector_create_from_cidr(
/*
* see header
*/
-traffic_selector_t *traffic_selector_create_dynamic(u_int8_t protocol,
- u_int16_t from_port, u_int16_t to_port)
+traffic_selector_t *traffic_selector_create_dynamic(uint8_t protocol,
+ uint16_t from_port, uint16_t to_port)
{
private_traffic_selector_t *this = traffic_selector_create(
protocol, TS_IPV4_ADDR_RANGE, from_port, to_port);
@@ -961,8 +961,8 @@ traffic_selector_t *traffic_selector_create_dynamic(u_int8_t protocol,
/*
* see declaration
*/
-static private_traffic_selector_t *traffic_selector_create(u_int8_t protocol,
- ts_type_t type, u_int16_t from_port, u_int16_t to_port)
+static private_traffic_selector_t *traffic_selector_create(uint8_t protocol,
+ ts_type_t type, uint16_t from_port, uint16_t to_port)
{
private_traffic_selector_t *this;
diff --git a/src/libstrongswan/selectors/traffic_selector.h b/src/libstrongswan/selectors/traffic_selector.h
index cf9a2861b..cc66c3453 100644
--- a/src/libstrongswan/selectors/traffic_selector.h
+++ b/src/libstrongswan/selectors/traffic_selector.h
@@ -122,7 +122,7 @@ struct traffic_selector_t {
*
* @return port
*/
- u_int16_t (*get_from_port) (traffic_selector_t *this);
+ uint16_t (*get_from_port) (traffic_selector_t *this);
/**
* Get ending port of this ts.
@@ -136,7 +136,7 @@ struct traffic_selector_t {
*
* @return port
*/
- u_int16_t (*get_to_port) (traffic_selector_t *this);
+ uint16_t (*get_to_port) (traffic_selector_t *this);
/**
* Get the type of the traffic selector.
@@ -150,7 +150,7 @@ struct traffic_selector_t {
*
* @return protocol id
*/
- u_int8_t (*get_protocol) (traffic_selector_t *this);
+ uint8_t (*get_protocol) (traffic_selector_t *this);
/**
* Check if the traffic selector is for a single host.
@@ -218,7 +218,7 @@ struct traffic_selector_t {
* @param mask converted net mask
* @return TRUE if traffic selector matches exactly to the subnet
*/
- bool (*to_subnet) (traffic_selector_t *this, host_t **net, u_int8_t *mask);
+ bool (*to_subnet) (traffic_selector_t *this, host_t **net, uint8_t *mask);
/**
* Create a hash value for the traffic selector.
@@ -240,7 +240,7 @@ struct traffic_selector_t {
* @param port port number in host order
* @return ICMP/ICMPv6 message type
*/
-static inline u_int8_t traffic_selector_icmp_type(u_int16_t port)
+static inline uint8_t traffic_selector_icmp_type(uint16_t port)
{
return port >> 8;
}
@@ -251,7 +251,7 @@ static inline u_int8_t traffic_selector_icmp_type(u_int16_t port)
* @param port port number in host order
* @return ICMP/ICMPv6 message code
*/
-static inline u_int8_t traffic_selector_icmp_code(u_int16_t port)
+static inline uint8_t traffic_selector_icmp_code(uint16_t port)
{
return port & 0xff;
}
@@ -286,9 +286,9 @@ int traffic_selector_cmp(traffic_selector_t *a, traffic_selector_t *b,
* - NULL if invalid address strings/protocol
*/
traffic_selector_t *traffic_selector_create_from_string(
- u_int8_t protocol, ts_type_t type,
- char *from_addr, u_int16_t from_port,
- char *to_addr, u_int16_t to_port);
+ uint8_t protocol, ts_type_t type,
+ char *from_addr, uint16_t from_port,
+ char *to_addr, uint16_t to_port);
@@ -307,8 +307,8 @@ traffic_selector_t *traffic_selector_create_from_string(
* @return traffic selector, NULL if string invalid
*/
traffic_selector_t *traffic_selector_create_from_cidr(
- char *string, u_int8_t protocol,
- u_int16_t from_port, u_int16_t to_port);
+ char *string, uint8_t protocol,
+ uint16_t from_port, uint16_t to_port);
/**
* Create a new traffic selector using data read from the net.
@@ -331,9 +331,9 @@ traffic_selector_t *traffic_selector_create_from_cidr(
* @return traffic_selector_t object
*/
traffic_selector_t *traffic_selector_create_from_bytes(
- u_int8_t protocol, ts_type_t type,
- chunk_t from_address, u_int16_t from_port,
- chunk_t to_address, u_int16_t to_port);
+ uint8_t protocol, ts_type_t type,
+ chunk_t from_address, uint16_t from_port,
+ chunk_t to_address, uint16_t to_port);
/**
* Create a new traffic selector using the RFC 3779 ASN.1 min/max address format
@@ -370,8 +370,8 @@ traffic_selector_t *traffic_selector_create_from_rfc3779_format(ts_type_t type,
* - NULL if address family of net not supported
*/
traffic_selector_t *traffic_selector_create_from_subnet(
- host_t *net, u_int8_t netbits, u_int8_t protocol,
- u_int16_t from_port, u_int16_t to_port);
+ host_t *net, uint8_t netbits, uint8_t protocol,
+ uint16_t from_port, uint16_t to_port);
/**
* Create a traffic selector for host-to-host cases.
@@ -392,8 +392,8 @@ traffic_selector_t *traffic_selector_create_from_subnet(
* - traffic_selector_t object
* - NULL if type not supported
*/
-traffic_selector_t *traffic_selector_create_dynamic(u_int8_t protocol,
- u_int16_t from_port, u_int16_t to_port);
+traffic_selector_t *traffic_selector_create_dynamic(uint8_t protocol,
+ uint16_t from_port, uint16_t to_port);
/**
* printf hook function for traffic_selector_t.
diff --git a/src/libstrongswan/settings/settings.c b/src/libstrongswan/settings/settings.c
index 56cc2f19b..829e78482 100644
--- a/src/libstrongswan/settings/settings.c
+++ b/src/libstrongswan/settings/settings.c
@@ -540,9 +540,9 @@ METHOD(settings_t, get_int, int,
/**
* Described in header
*/
-inline u_int64_t settings_value_as_uint64(char *value, u_int64_t def)
+inline uint64_t settings_value_as_uint64(char *value, uint64_t def)
{
- u_int64_t intval;
+ uint64_t intval;
char *end;
int base = 10;
@@ -597,10 +597,10 @@ METHOD(settings_t, get_double, double,
/**
* Described in header
*/
-inline u_int32_t settings_value_as_time(char *value, u_int32_t def)
+inline uint32_t settings_value_as_time(char *value, uint32_t def)
{
char *endptr;
- u_int32_t timeval;
+ uint32_t timeval;
if (value)
{
errno = 0;
@@ -638,8 +638,8 @@ inline u_int32_t settings_value_as_time(char *value, u_int32_t def)
return def;
}
-METHOD(settings_t, get_time, u_int32_t,
- private_settings_t *this, char *key, u_int32_t def, ...)
+METHOD(settings_t, get_time, uint32_t,
+ private_settings_t *this, char *key, uint32_t def, ...)
{
char *value;
va_list args;
@@ -695,7 +695,7 @@ METHOD(settings_t, set_double, void,
}
METHOD(settings_t, set_time, void,
- private_settings_t *this, char *key, u_int32_t value, ...)
+ private_settings_t *this, char *key, uint32_t value, ...)
{
char val[16];
va_list args;
diff --git a/src/libstrongswan/settings/settings.h b/src/libstrongswan/settings/settings.h
index a133a3681..eec5ece6c 100644
--- a/src/libstrongswan/settings/settings.h
+++ b/src/libstrongswan/settings/settings.h
@@ -51,13 +51,13 @@ bool settings_value_as_bool(char *value, bool def);
int settings_value_as_int(char *value, int def);
/**
- * Convert a string value returned by a key/value enumerator to an u_int64_t.
+ * Convert a string value returned by a key/value enumerator to an uint64_t.
*
* @see settings_t.create_key_value_enumerator()
* @param value the string value
* @param def the default value, if value is NULL or invalid
*/
-u_int64_t settings_value_as_uint64(char *value, u_int64_t def);
+uint64_t settings_value_as_uint64(char *value, uint64_t def);
/**
* Convert a string value returned by a key/value enumerator to a double.
@@ -77,7 +77,7 @@ double settings_value_as_double(char *value, double def);
* @param value the string value
* @param def the default value, if value is NULL or invalid
*/
-u_int32_t settings_value_as_time(char *value, u_int32_t def);
+uint32_t settings_value_as_time(char *value, uint32_t def);
/**
* Generic configuration options read from a config file.
@@ -203,7 +203,7 @@ struct settings_t {
* @param ... argument list for key
* @return value of the key (in seconds)
*/
- u_int32_t (*get_time)(settings_t *this, char *key, u_int32_t def, ...);
+ uint32_t (*get_time)(settings_t *this, char *key, uint32_t def, ...);
/**
* Set a string value.
@@ -248,7 +248,7 @@ struct settings_t {
* @param def value to set
* @param ... argument list for key
*/
- void (*set_time)(settings_t *this, char *key, u_int32_t value, ...);
+ void (*set_time)(settings_t *this, char *key, uint32_t value, ...);
/**
* Set a default for string value.
diff --git a/src/libstrongswan/tests/suites/test_array.c b/src/libstrongswan/tests/suites/test_array.c
index eda72e10a..eed8fba56 100644
--- a/src/libstrongswan/tests/suites/test_array.c
+++ b/src/libstrongswan/tests/suites/test_array.c
@@ -512,7 +512,7 @@ END_TEST
START_TEST(test_insert_create_value)
{
array_t *array = NULL;
- u_int16_t v;
+ uint16_t v;
v = 1;
array_insert_create_value(&array, sizeof(v), ARRAY_TAIL, &v);
diff --git a/src/libstrongswan/tests/suites/test_asn1.c b/src/libstrongswan/tests/suites/test_asn1.c
index ac7c5519e..fa02df9ca 100644
--- a/src/libstrongswan/tests/suites/test_asn1.c
+++ b/src/libstrongswan/tests/suites/test_asn1.c
@@ -462,7 +462,7 @@ START_TEST(test_asn1_to_time)
{
typedef struct {
time_t time;
- u_int8_t type;
+ uint8_t type;
char *string;
} testdata_t;
@@ -525,7 +525,7 @@ START_TEST(test_asn1_from_time)
{
typedef struct {
time_t time;
- u_int8_t type;
+ uint8_t type;
chunk_t chunk;
} testdata_t;
@@ -759,7 +759,7 @@ END_TEST
START_TEST(test_asn1_parse_integer_uint64)
{
typedef struct {
- u_int64_t n;
+ uint64_t n;
chunk_t chunk;
} testdata_t;
diff --git a/src/libstrongswan/tests/suites/test_bio_reader.c b/src/libstrongswan/tests/suites/test_bio_reader.c
index 6a9743d62..d3b4b4358 100644
--- a/src/libstrongswan/tests/suites/test_bio_reader.c
+++ b/src/libstrongswan/tests/suites/test_bio_reader.c
@@ -65,7 +65,7 @@
START_TEST(test_read_uint8)
{
chunk_t data = chunk_from_chars(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07);
- u_int8_t val;
+ uint8_t val;
assert_integer_read(data, 8, val);
assert_basic_read(8, val);
@@ -76,7 +76,7 @@ END_TEST
START_TEST(test_read_uint16)
{
chunk_t data = chunk_from_chars(0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03);
- u_int16_t val;
+ uint16_t val;
assert_integer_read(data, 16, val);
assert_basic_read(16, val);
@@ -87,7 +87,7 @@ END_TEST
START_TEST(test_read_uint24)
{
chunk_t data = chunk_from_chars(0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x03);
- u_int32_t val;
+ uint32_t val;
assert_integer_read(data, 24, val);
assert_basic_read(24, val);
@@ -99,7 +99,7 @@ START_TEST(test_read_uint32)
{
chunk_t data = chunk_from_chars(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03);
- u_int32_t val;
+ uint32_t val;
assert_integer_read(data, 32, val);
assert_basic_read(32, val);
@@ -113,7 +113,7 @@ START_TEST(test_read_uint64)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03);
- u_int64_t val;
+ uint64_t val;
assert_integer_read(data, 64, val);
assert_basic_read(64, val);
@@ -170,7 +170,7 @@ END_TEST
START_TEST(test_read_uint8_end)
{
chunk_t data = chunk_from_chars(0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00);
- u_int8_t val;
+ uint8_t val;
assert_integer_read_end(data, 8, val);
assert_basic_read_end(8, val);
@@ -181,7 +181,7 @@ END_TEST
START_TEST(test_read_uint16_end)
{
chunk_t data = chunk_from_chars(0x00, 0x03, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00);
- u_int16_t val;
+ uint16_t val;
assert_integer_read_end(data, 16, val);
assert_basic_read_end(16, val);
@@ -192,7 +192,7 @@ END_TEST
START_TEST(test_read_uint24_end)
{
chunk_t data = chunk_from_chars(0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00);
- u_int32_t val;
+ uint32_t val;
assert_integer_read_end(data, 24, val);
assert_basic_read_end(24, val);
@@ -204,7 +204,7 @@ START_TEST(test_read_uint32_end)
{
chunk_t data = chunk_from_chars(0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00);
- u_int32_t val;
+ uint32_t val;
assert_integer_read_end(data, 32, val);
assert_basic_read_end(32, val);
@@ -218,7 +218,7 @@ START_TEST(test_read_uint64_end)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
- u_int64_t val;
+ uint64_t val;
assert_integer_read_end(data, 64, val);
assert_basic_read_end(64, val);
diff --git a/src/libstrongswan/tests/suites/test_chunk.c b/src/libstrongswan/tests/suites/test_chunk.c
index 6272ca795..7e5310c64 100644
--- a/src/libstrongswan/tests/suites/test_chunk.c
+++ b/src/libstrongswan/tests/suites/test_chunk.c
@@ -736,7 +736,7 @@ START_TEST(test_chunk_mac)
{
chunk_t in;
u_char key[16];
- u_int64_t out;
+ uint64_t out;
int i, count;
count = countof(sip_vectors);
@@ -765,7 +765,7 @@ END_TEST
START_TEST(test_chunk_hash)
{
chunk_t chunk;
- u_int32_t hash_a, hash_b, hash_c;
+ uint32_t hash_a, hash_b, hash_c;
chunk = chunk_from_str("asdf");
@@ -787,7 +787,7 @@ END_TEST
START_TEST(test_chunk_hash_static)
{
chunk_t in;
- u_int32_t out, hash_a, hash_b, hash_inc = 0x7b891a95;
+ uint32_t out, hash_a, hash_b, hash_inc = 0x7b891a95;
int i, count;
count = countof(sip_vectors);
@@ -813,7 +813,7 @@ END_TEST
* test for chunk_internet_checksum[_inc]()
*/
-static inline u_int16_t compensate_alignment(u_int16_t val)
+static inline uint16_t compensate_alignment(uint16_t val)
{
return ((val & 0xff) << 8) | (val >> 8);
}
@@ -821,7 +821,7 @@ static inline u_int16_t compensate_alignment(u_int16_t val)
START_TEST(test_chunk_internet_checksum)
{
chunk_t chunk;
- u_int16_t sum;
+ uint16_t sum;
chunk = chunk_from_chars(0x45,0x00,0x00,0x30,0x44,0x22,0x40,0x00,0x80,0x06,
0x00,0x00,0x8c,0x7c,0x19,0xac,0xae,0x24,0x1e,0x2b);
diff --git a/src/libstrongswan/tests/suites/test_host.c b/src/libstrongswan/tests/suites/test_host.c
index 5cb8013ff..5d054577a 100644
--- a/src/libstrongswan/tests/suites/test_host.c
+++ b/src/libstrongswan/tests/suites/test_host.c
@@ -46,7 +46,7 @@ static void verify_netmask(chunk_t addr, int mask)
* host_create_any
*/
-static void verify_any(host_t *host, int family, u_int16_t port)
+static void verify_any(host_t *host, int family, uint16_t port)
{
verify_netmask(host->get_address(host), 0);
ck_assert(host->is_anyaddr(host));
@@ -88,7 +88,7 @@ END_TEST
* host_create_from_string
*/
-static void verify_address(host_t *host, chunk_t addr, int family, u_int16_t port)
+static void verify_address(host_t *host, chunk_t addr, int family, uint16_t port)
{
ck_assert(chunk_equals(host->get_address(host), addr));
ck_assert(!host->is_anyaddr(host));
@@ -656,7 +656,7 @@ END_TEST
static struct {
char *addr;
- u_int16_t port;
+ uint16_t port;
/* results for %H, %+H, %#H (falls back to [0]) */
char *result[3];
} printf_data[] = {
diff --git a/src/libstrongswan/tests/suites/test_iv_gen.c b/src/libstrongswan/tests/suites/test_iv_gen.c
index 4e45c8538..8b0a14b79 100644
--- a/src/libstrongswan/tests/suites/test_iv_gen.c
+++ b/src/libstrongswan/tests/suites/test_iv_gen.c
@@ -21,17 +21,17 @@
START_TEST(test_iv_gen_seq)
{
iv_gen_t *iv_gen;
- u_int64_t iv0, iv1_1, iv1_2;
+ uint64_t iv0, iv1_1, iv1_2;
iv_gen = iv_gen_seq_create();
- ck_assert(iv_gen->get_iv(iv_gen, 0, 8, (u_int8_t*)&iv0));
- ck_assert(iv_gen->get_iv(iv_gen, 1, 8, (u_int8_t*)&iv1_1));
+ ck_assert(iv_gen->get_iv(iv_gen, 0, 8, (uint8_t*)&iv0));
+ ck_assert(iv_gen->get_iv(iv_gen, 1, 8, (uint8_t*)&iv1_1));
ck_assert(iv0 != iv1_1);
/* every sequence number may be used twice, but results in a different IV */
- ck_assert(iv_gen->get_iv(iv_gen, 1, 8, (u_int8_t*)&iv1_2));
+ ck_assert(iv_gen->get_iv(iv_gen, 1, 8, (uint8_t*)&iv1_2));
ck_assert(iv0 != iv1_2);
ck_assert(iv1_1 != iv1_2);
- ck_assert(!iv_gen->get_iv(iv_gen, 1, 8, (u_int8_t*)&iv1_2));
+ ck_assert(!iv_gen->get_iv(iv_gen, 1, 8, (uint8_t*)&iv1_2));
iv_gen->destroy(iv_gen);
}
END_TEST
@@ -39,19 +39,19 @@ END_TEST
START_TEST(test_iv_gen_seq_len)
{
iv_gen_t *iv_gen;
- u_int64_t iv;
- u_int8_t buf[9];
+ uint64_t iv;
+ uint8_t buf[9];
iv_gen = iv_gen_seq_create();
- ck_assert(!iv_gen->get_iv(iv_gen, 0, 0, (u_int8_t*)&iv));
- ck_assert(!iv_gen->get_iv(iv_gen, 0, 1, (u_int8_t*)&iv));
- ck_assert(!iv_gen->get_iv(iv_gen, 0, 2, (u_int8_t*)&iv));
- ck_assert(!iv_gen->get_iv(iv_gen, 0, 3, (u_int8_t*)&iv));
- ck_assert(!iv_gen->get_iv(iv_gen, 0, 4, (u_int8_t*)&iv));
- ck_assert(!iv_gen->get_iv(iv_gen, 0, 5, (u_int8_t*)&iv));
- ck_assert(!iv_gen->get_iv(iv_gen, 0, 6, (u_int8_t*)&iv));
- ck_assert(!iv_gen->get_iv(iv_gen, 0, 7, (u_int8_t*)&iv));
- ck_assert(iv_gen->get_iv(iv_gen, 0, 8, (u_int8_t*)&iv));
+ ck_assert(!iv_gen->get_iv(iv_gen, 0, 0, (uint8_t*)&iv));
+ ck_assert(!iv_gen->get_iv(iv_gen, 0, 1, (uint8_t*)&iv));
+ ck_assert(!iv_gen->get_iv(iv_gen, 0, 2, (uint8_t*)&iv));
+ ck_assert(!iv_gen->get_iv(iv_gen, 0, 3, (uint8_t*)&iv));
+ ck_assert(!iv_gen->get_iv(iv_gen, 0, 4, (uint8_t*)&iv));
+ ck_assert(!iv_gen->get_iv(iv_gen, 0, 5, (uint8_t*)&iv));
+ ck_assert(!iv_gen->get_iv(iv_gen, 0, 6, (uint8_t*)&iv));
+ ck_assert(!iv_gen->get_iv(iv_gen, 0, 7, (uint8_t*)&iv));
+ ck_assert(iv_gen->get_iv(iv_gen, 0, 8, (uint8_t*)&iv));
ck_assert(iv_gen->get_iv(iv_gen, 0, 9, buf));
iv_gen->destroy(iv_gen);
}
diff --git a/src/libstrongswan/tests/suites/test_ntru.c b/src/libstrongswan/tests/suites/test_ntru.c
index d209fa2bc..0a6d24d04 100644
--- a/src/libstrongswan/tests/suites/test_ntru.c
+++ b/src/libstrongswan/tests/suites/test_ntru.c
@@ -25,7 +25,7 @@
#include <plugins/ntru/ntru_private_key.h>
IMPORT_FUNCTION_FOR_TESTS(ntru, ntru_drbg_create, ntru_drbg_t*,
- u_int32_t strength, chunk_t pers_str, rng_t *entropy)
+ uint32_t strength, chunk_t pers_str, rng_t *entropy)
IMPORT_FUNCTION_FOR_TESTS(ntru, ntru_trits_create, ntru_trits_t*,
size_t len, hash_algorithm_t alg, chunk_t seed)
@@ -36,7 +36,7 @@ IMPORT_FUNCTION_FOR_TESTS(ntru, ntru_poly_create_from_seed, ntru_poly_t*,
uint32_t indices_len_m, bool is_product_form)
IMPORT_FUNCTION_FOR_TESTS(ntru, ntru_poly_create_from_data, ntru_poly_t*,
- u_int16_t *data, uint16_t N, uint16_t q,
+ uint16_t *data, uint16_t N, uint16_t q,
uint32_t indices_len_p, uint32_t indices_len_m,
bool is_product_form)
@@ -73,8 +73,8 @@ char *parameter_sets[] = {
};
typedef struct {
- u_int32_t requested;
- u_int32_t standard;
+ uint32_t requested;
+ uint32_t standard;
}strength_t;
strength_t strengths[] = {
diff --git a/src/libstrongswan/tests/suites/test_printf.c b/src/libstrongswan/tests/suites/test_printf.c
index 9e40d1fc0..377f2a767 100644
--- a/src/libstrongswan/tests/suites/test_printf.c
+++ b/src/libstrongswan/tests/suites/test_printf.c
@@ -75,7 +75,7 @@ END_TEST
START_TEST(test_printf_unsigned)
{
- verify("1 23 456", "%u %lu %llu", 1, (u_long)23, (u_int64_t)456);
+ verify("1 23 456", "%u %lu %llu", 1, (u_long)23, (uint64_t)456);
verify("65535 255", "%hu %hhu", 0x1ffff, 0x1ff);
verify("123456789", "%zu", (size_t)123456789);
verify(" 12", "%5u", 12);
@@ -99,7 +99,7 @@ END_TEST
START_TEST(test_printf_hex)
{
- verify("1 23 456", "%x %lx %llx", 1, (u_long)0x23, (u_int64_t)0x456);
+ verify("1 23 456", "%x %lx %llx", 1, (u_long)0x23, (uint64_t)0x456);
verify("12abcdef 12ABCDEF", "%x %X", 0x12ABCDEF, 0x12ABCDEF);
verify("ffff ff", "%hx %hhx", 0x1ffff, 0x1ff);
verify("23456789", "%zx", (size_t)0x23456789);
@@ -170,10 +170,10 @@ END_TEST
START_TEST(test_printf_pri)
{
- verify("255", "%" PRIu8, (u_int8_t)0xFF);
- verify("65535", "%" PRIu16, (u_int16_t)0xFFFF);
- verify("4294967295", "%" PRIu32, (u_int32_t)0x1FFFFFFFFll);
- verify("18446744073709551615", "%" PRIu64, (u_int64_t)0xFFFFFFFFFFFFFFFFll);
+ verify("255", "%" PRIu8, (uint8_t)0xFF);
+ verify("65535", "%" PRIu16, (uint16_t)0xFFFF);
+ verify("4294967295", "%" PRIu32, (uint32_t)0x1FFFFFFFFll);
+ verify("18446744073709551615", "%" PRIu64, (uint64_t)0xFFFFFFFFFFFFFFFFll);
verify("-1", "%" PRId8, (int8_t)-1);
verify("-1", "%" PRId16, (int16_t)-1);
diff --git a/src/libstrongswan/tests/suites/test_traffic_selector.c b/src/libstrongswan/tests/suites/test_traffic_selector.c
index 5c0fb754d..0d5d877ac 100644
--- a/src/libstrongswan/tests/suites/test_traffic_selector.c
+++ b/src/libstrongswan/tests/suites/test_traffic_selector.c
@@ -198,7 +198,7 @@ struct {
char *from;
char *to;
char *net;
- u_int8_t mask;
+ uint8_t mask;
bool exact;
} to_subnet_tests[] = {
{ TS_IPV4_ADDR_RANGE, "10.0.0.1", "10.0.0.1", "10.0.0.1", 32, TRUE },
@@ -218,7 +218,7 @@ START_TEST(test_to_subnet)
{
traffic_selector_t *ts;
host_t *net, *exp_net;
- u_int8_t mask;
+ uint8_t mask;
ts = traffic_selector_create_from_string(0, to_subnet_tests[_i].type,
to_subnet_tests[_i].from, 0, to_subnet_tests[_i].to, 0);
@@ -234,9 +234,9 @@ END_TEST
struct {
char *cidr;
- u_int16_t from_port;
- u_int16_t to_port;
- u_int16_t port;
+ uint16_t from_port;
+ uint16_t to_port;
+ uint16_t port;
} to_subnet_port_tests[] = {
{ "10.0.0.0/8", 0, 0, 0 },
{ "10.0.0.1/32", 80, 80, 80 },
@@ -252,7 +252,7 @@ START_TEST(test_to_subnet_port)
{
traffic_selector_t *ts;
host_t *net, *exp_net;
- u_int8_t mask;
+ uint8_t mask;
int exp_mask;
ts = traffic_selector_create_from_cidr(to_subnet_port_tests[_i].cidr, 0,
@@ -431,9 +431,9 @@ struct {
bool contained;
struct {
char *net;
- u_int8_t proto;
- u_int16_t from_port;
- u_int16_t to_port;
+ uint8_t proto;
+ uint16_t from_port;
+ uint16_t to_port;
} a, b;
} is_contained_in_tests[] = {
{ TRUE, { "10.0.0.0/16", 0, 0, 65535 }, { "10.0.0.0/16", 0, 0, 65535 }, },
@@ -555,9 +555,9 @@ struct {
int res;
struct {
char *net;
- u_int8_t proto;
- u_int16_t from_port;
- u_int16_t to_port;
+ uint8_t proto;
+ uint16_t from_port;
+ uint16_t to_port;
} a, b;
} cmp_tests[] = {
{ 0, { "10.0.0.0/8", 0, 0, 65535 }, { "10.0.0.0/8", 0, 0, 65535 }, },
@@ -706,13 +706,13 @@ START_TEST(test_hash)
END_TEST
struct {
- u_int8_t proto;
- u_int16_t from_port;
- u_int16_t to_port;
- u_int8_t from_type;
- u_int8_t from_code;
- u_int8_t to_type;
- u_int8_t to_code;
+ uint8_t proto;
+ uint16_t from_port;
+ uint16_t to_port;
+ uint8_t from_type;
+ uint8_t from_code;
+ uint8_t to_type;
+ uint8_t to_code;
char *str;
char *str_alt;
} icmp_tests[] = {
@@ -731,7 +731,7 @@ struct {
START_TEST(test_icmp)
{
traffic_selector_t *ts;
- u_int16_t from, to;
+ uint16_t from, to;
ts = traffic_selector_create_dynamic(icmp_tests[_i].proto,
icmp_tests[_i].from_port, icmp_tests[_i].to_port);
diff --git a/src/libstrongswan/tests/suites/test_utils.c b/src/libstrongswan/tests/suites/test_utils.c
index 104b0b2c0..504562615 100644
--- a/src/libstrongswan/tests/suites/test_utils.c
+++ b/src/libstrongswan/tests/suites/test_utils.c
@@ -121,9 +121,9 @@ END_TEST
START_TEST(test_htoun)
{
chunk_t net64, expected;
- u_int16_t host16 = 513;
- u_int32_t net16 = 0, host32 = 67305985;
- u_int64_t net32 = 0, host64 = 578437695752307201ULL;
+ uint16_t host16 = 513;
+ uint32_t net16 = 0, host32 = 67305985;
+ uint64_t net32 = 0, host64 = 578437695752307201ULL;
net64 = chunk_alloca(16);
memset(net64.ptr, 0, net64.len);
@@ -133,14 +133,14 @@ START_TEST(test_htoun)
ck_assert(chunk_equals(expected, chunk_from_thing(net16)));
expected = chunk_from_chars(0x00, 0x00, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00);
- htoun32((u_int16_t*)&net32 + 1, host32);
+ htoun32((uint16_t*)&net32 + 1, host32);
ck_assert(chunk_equals(expected, chunk_from_thing(net32)));
expected = chunk_from_chars(0x00, 0x00, 0x00, 0x00,
0x08, 0x07, 0x06, 0x05,
0x04, 0x03, 0x02, 0x01,
0x00, 0x00, 0x00, 0x00);
- htoun64((u_int32_t*)net64.ptr + 1, host64);
+ htoun64((uint32_t*)net64.ptr + 1, host64);
ck_assert(chunk_equals(expected, net64));
}
END_TEST
@@ -148,9 +148,9 @@ END_TEST
START_TEST(test_untoh)
{
chunk_t net;
- u_int16_t host16;
- u_int32_t host32;
- u_int64_t host64;
+ uint16_t host16;
+ uint32_t host32;
+ uint64_t host64;
net = chunk_from_chars(0x00, 0x02, 0x01, 0x00);
host16 = untoh16(net.ptr + 1);
@@ -308,7 +308,7 @@ END_TEST
START_TEST(test_memxor_aligned)
{
- u_int64_t a = 0, b = 0;
+ uint64_t a = 0, b = 0;
chunk_t ca, cb;
int i;
diff --git a/src/libstrongswan/tests/utils/test_rng.c b/src/libstrongswan/tests/utils/test_rng.c
index 01569509b..2985a56e3 100644
--- a/src/libstrongswan/tests/utils/test_rng.c
+++ b/src/libstrongswan/tests/utils/test_rng.c
@@ -34,7 +34,7 @@ struct private_rng_t {
};
METHOD(rng_t, get_bytes, bool,
- private_rng_t *this, size_t bytes, u_int8_t *buffer)
+ private_rng_t *this, size_t bytes, uint8_t *buffer)
{
if (bytes > this->entropy.len)
{
diff --git a/src/libstrongswan/utils/chunk.c b/src/libstrongswan/utils/chunk.c
index c4471be70..2f824a259 100644
--- a/src/libstrongswan/utils/chunk.c
+++ b/src/libstrongswan/utils/chunk.c
@@ -775,25 +775,25 @@ bool chunk_printable(chunk_t chunk, chunk_t *sane, char replace)
/**
* Helper functions for chunk_mac()
*/
-static inline u_int64_t sipget(u_char *in)
+static inline uint64_t sipget(u_char *in)
{
- u_int64_t v = 0;
+ uint64_t v = 0;
int i;
for (i = 0; i < 64; i += 8, ++in)
{
- v |= ((u_int64_t)*in) << i;
+ v |= ((uint64_t)*in) << i;
}
return v;
}
-static inline u_int64_t siprotate(u_int64_t v, int shift)
+static inline uint64_t siprotate(uint64_t v, int shift)
{
return (v << shift) | (v >> (64 - shift));
}
-static inline void sipround(u_int64_t *v0, u_int64_t *v1, u_int64_t *v2,
- u_int64_t *v3)
+static inline void sipround(uint64_t *v0, uint64_t *v1, uint64_t *v2,
+ uint64_t *v3)
{
*v0 += *v1;
*v1 = siprotate(*v1, 13);
@@ -814,8 +814,8 @@ static inline void sipround(u_int64_t *v0, u_int64_t *v1, u_int64_t *v2,
*v3 ^= *v0;
}
-static inline void sipcompress(u_int64_t *v0, u_int64_t *v1, u_int64_t *v2,
- u_int64_t *v3, u_int64_t m)
+static inline void sipcompress(uint64_t *v0, uint64_t *v1, uint64_t *v2,
+ uint64_t *v3, uint64_t m)
{
*v3 ^= m;
sipround(v0, v1, v2, v3);
@@ -823,28 +823,28 @@ static inline void sipcompress(u_int64_t *v0, u_int64_t *v1, u_int64_t *v2,
*v0 ^= m;
}
-static inline u_int64_t siplast(size_t len, u_char *pos)
+static inline uint64_t siplast(size_t len, u_char *pos)
{
- u_int64_t b;
+ uint64_t b;
int rem = len & 7;
- b = ((u_int64_t)len) << 56;
+ b = ((uint64_t)len) << 56;
switch (rem)
{
case 7:
- b |= ((u_int64_t)pos[6]) << 48;
+ b |= ((uint64_t)pos[6]) << 48;
case 6:
- b |= ((u_int64_t)pos[5]) << 40;
+ b |= ((uint64_t)pos[5]) << 40;
case 5:
- b |= ((u_int64_t)pos[4]) << 32;
+ b |= ((uint64_t)pos[4]) << 32;
case 4:
- b |= ((u_int64_t)pos[3]) << 24;
+ b |= ((uint64_t)pos[3]) << 24;
case 3:
- b |= ((u_int64_t)pos[2]) << 16;
+ b |= ((uint64_t)pos[2]) << 16;
case 2:
- b |= ((u_int64_t)pos[1]) << 8;
+ b |= ((uint64_t)pos[1]) << 8;
case 1:
- b |= ((u_int64_t)pos[0]);
+ b |= ((uint64_t)pos[0]);
break;
case 0:
break;
@@ -855,9 +855,9 @@ static inline u_int64_t siplast(size_t len, u_char *pos)
/**
* Caculate SipHash-2-4 with an optional first block given as argument.
*/
-static u_int64_t chunk_mac_inc(chunk_t chunk, u_char *key, u_int64_t m)
+static uint64_t chunk_mac_inc(chunk_t chunk, u_char *key, uint64_t m)
{
- u_int64_t v0, v1, v2, v3, k0, k1;
+ uint64_t v0, v1, v2, v3, k0, k1;
size_t len = chunk.len;
u_char *pos = chunk.ptr, *end;
@@ -896,7 +896,7 @@ static u_int64_t chunk_mac_inc(chunk_t chunk, u_char *key, u_int64_t m)
/**
* Described in header.
*/
-u_int64_t chunk_mac(chunk_t chunk, u_char *key)
+uint64_t chunk_mac(chunk_t chunk, u_char *key)
{
return chunk_mac_inc(chunk, key, 0);
}
@@ -957,16 +957,16 @@ void chunk_hash_seed()
/**
* Described in header.
*/
-u_int32_t chunk_hash_inc(chunk_t chunk, u_int32_t hash)
+uint32_t chunk_hash_inc(chunk_t chunk, uint32_t hash)
{
/* we could use a mac of the previous hash, but this is faster */
- return chunk_mac_inc(chunk, key, ((u_int64_t)hash) << 32 | hash);
+ return chunk_mac_inc(chunk, key, ((uint64_t)hash) << 32 | hash);
}
/**
* Described in header.
*/
-u_int32_t chunk_hash(chunk_t chunk)
+uint32_t chunk_hash(chunk_t chunk)
{
return chunk_mac(chunk, key);
}
@@ -974,15 +974,15 @@ u_int32_t chunk_hash(chunk_t chunk)
/**
* Described in header.
*/
-u_int32_t chunk_hash_static_inc(chunk_t chunk, u_int32_t hash)
+uint32_t chunk_hash_static_inc(chunk_t chunk, uint32_t hash)
{ /* we could use a mac of the previous hash, but this is faster */
- return chunk_mac_inc(chunk, static_key, ((u_int64_t)hash) << 32 | hash);
+ return chunk_mac_inc(chunk, static_key, ((uint64_t)hash) << 32 | hash);
}
/**
* Described in header.
*/
-u_int32_t chunk_hash_static(chunk_t chunk)
+uint32_t chunk_hash_static(chunk_t chunk)
{
return chunk_mac(chunk, static_key);
}
@@ -990,9 +990,9 @@ u_int32_t chunk_hash_static(chunk_t chunk)
/**
* Described in header.
*/
-u_int16_t chunk_internet_checksum_inc(chunk_t data, u_int16_t checksum)
+uint16_t chunk_internet_checksum_inc(chunk_t data, uint16_t checksum)
{
- u_int32_t sum = ntohs((u_int16_t)~checksum);
+ uint32_t sum = ntohs((uint16_t)~checksum);
while (data.len > 1)
{
@@ -1001,7 +1001,7 @@ u_int16_t chunk_internet_checksum_inc(chunk_t data, u_int16_t checksum)
}
if (data.len)
{
- sum += (u_int16_t)*data.ptr << 8;
+ sum += (uint16_t)*data.ptr << 8;
}
while (sum >> 16)
{
@@ -1013,7 +1013,7 @@ u_int16_t chunk_internet_checksum_inc(chunk_t data, u_int16_t checksum)
/**
* Described in header.
*/
-u_int16_t chunk_internet_checksum(chunk_t data)
+uint16_t chunk_internet_checksum(chunk_t data)
{
return chunk_internet_checksum_inc(data, 0xffff);
}
diff --git a/src/libstrongswan/utils/chunk.h b/src/libstrongswan/utils/chunk.h
index 2ec7f7543..403c7f83b 100644
--- a/src/libstrongswan/utils/chunk.h
+++ b/src/libstrongswan/utils/chunk.h
@@ -375,7 +375,7 @@ void chunk_hash_seed();
* @param chunk data to hash
* @return hash value
*/
-u_int32_t chunk_hash(chunk_t chunk);
+uint32_t chunk_hash(chunk_t chunk);
/**
* Incremental version of chunk_hash. Use this to hash two or more chunks.
@@ -384,7 +384,7 @@ u_int32_t chunk_hash(chunk_t chunk);
* @param hash previous hash value
* @return hash value
*/
-u_int32_t chunk_hash_inc(chunk_t chunk, u_int32_t hash);
+uint32_t chunk_hash_inc(chunk_t chunk, uint32_t hash);
/**
* Computes a 32 bit hash of the given chunk.
@@ -398,7 +398,7 @@ u_int32_t chunk_hash_inc(chunk_t chunk, u_int32_t hash);
* @param chunk data to hash
* @return hash value
*/
-u_int32_t chunk_hash_static(chunk_t chunk);
+uint32_t chunk_hash_static(chunk_t chunk);
/**
* Incremental version of chunk_hash_static(). Use this to hash two or more
@@ -408,7 +408,7 @@ u_int32_t chunk_hash_static(chunk_t chunk);
* @param hash previous hash value
* @return hash value
*/
-u_int32_t chunk_hash_static_inc(chunk_t chunk, u_int32_t hash);
+uint32_t chunk_hash_static_inc(chunk_t chunk, uint32_t hash);
/**
* Computes a quick MAC from the given chunk and key using SipHash.
@@ -422,7 +422,7 @@ u_int32_t chunk_hash_static_inc(chunk_t chunk, u_int32_t hash);
* @param key key to use
* @return MAC for given input and key
*/
-u_int64_t chunk_mac(chunk_t chunk, u_char *key);
+uint64_t chunk_mac(chunk_t chunk, u_char *key);
/**
* Calculate the Internet Checksum according to RFC 1071 for the given chunk.
@@ -434,7 +434,7 @@ u_int64_t chunk_mac(chunk_t chunk, u_char *key);
* @param data data to process
* @return checksum (one's complement, network order)
*/
-u_int16_t chunk_internet_checksum(chunk_t data);
+uint16_t chunk_internet_checksum(chunk_t data);
/**
* Extend the given Internet Checksum (one's complement, in network byte order)
@@ -447,7 +447,7 @@ u_int16_t chunk_internet_checksum(chunk_t data);
* @param checksum previous checksum (one's complement, network order)
* @return checksum (one's complement, network order)
*/
-u_int16_t chunk_internet_checksum_inc(chunk_t data, u_int16_t checksum);
+uint16_t chunk_internet_checksum_inc(chunk_t data, uint16_t checksum);
/**
* printf hook function for chunk_t.
diff --git a/src/libstrongswan/utils/cpu_feature.c b/src/libstrongswan/utils/cpu_feature.c
index d86ca6bd8..0529701ea 100644
--- a/src/libstrongswan/utils/cpu_feature.c
+++ b/src/libstrongswan/utils/cpu_feature.c
@@ -102,7 +102,7 @@ static cpu_feature_t get_via_features()
*/
cpu_feature_t cpu_feature_get_all()
{
- char vendor[3 * sizeof(u_int32_t) + 1];
+ char vendor[3 * sizeof(uint32_t) + 1];
cpu_feature_t f = 0;
u_int a, b, c, d;
diff --git a/src/libstrongswan/utils/integrity_checker.c b/src/libstrongswan/utils/integrity_checker.c
index b66df02e7..6f9510b3e 100644
--- a/src/libstrongswan/utils/integrity_checker.c
+++ b/src/libstrongswan/utils/integrity_checker.c
@@ -56,10 +56,10 @@ struct private_integrity_checker_t {
int checksum_count;
};
-METHOD(integrity_checker_t, build_file, u_int32_t,
+METHOD(integrity_checker_t, build_file, uint32_t,
private_integrity_checker_t *this, char *file, size_t *len)
{
- u_int32_t checksum;
+ uint32_t checksum;
chunk_t *contents;
contents = chunk_map(file, FALSE);
@@ -109,7 +109,7 @@ static int callback(struct dl_phdr_info *dlpi, size_t size, Dl_info *dli)
return 0;
}
-METHOD(integrity_checker_t, build_segment, u_int32_t,
+METHOD(integrity_checker_t, build_segment, uint32_t,
private_integrity_checker_t *this, void *sym, size_t *len)
{
chunk_t segment;
@@ -154,7 +154,7 @@ METHOD(integrity_checker_t, check_file, bool,
private_integrity_checker_t *this, char *name, char *file)
{
integrity_checksum_t *cs;
- u_int32_t sum;
+ uint32_t sum;
size_t len = 0;
cs = find_checksum(this, name);
@@ -188,7 +188,7 @@ METHOD(integrity_checker_t, check_segment, bool,
private_integrity_checker_t *this, char *name, void *sym)
{
integrity_checksum_t *cs;
- u_int32_t sum;
+ uint32_t sum;
size_t len = 0;
cs = find_checksum(this, name);
diff --git a/src/libstrongswan/utils/integrity_checker.h b/src/libstrongswan/utils/integrity_checker.h
index afaa114b3..2ac21c608 100644
--- a/src/libstrongswan/utils/integrity_checker.h
+++ b/src/libstrongswan/utils/integrity_checker.h
@@ -35,11 +35,11 @@ struct integrity_checksum_t {
/* size in bytes of the file on disk */
size_t file_len;
/* checksum of the file on disk */
- u_int32_t file;
+ uint32_t file;
/* size in bytes of executable segment in memory */
size_t segment_len;
/* checksum of the executable segment in memory */
- u_int32_t segment;
+ uint32_t segment;
};
/**
@@ -66,7 +66,7 @@ struct integrity_checker_t {
* @param len return length in bytes of file
* @return checksum, 0 on error
*/
- u_int32_t (*build_file)(integrity_checker_t *this, char *file, size_t *len);
+ uint32_t (*build_file)(integrity_checker_t *this, char *file, size_t *len);
/**
* Check the integrity of the code segment in memory.
@@ -83,7 +83,7 @@ struct integrity_checker_t {
* @param len return length in bytes of code segment in memory
* @return checksum, 0 on error
*/
- u_int32_t (*build_segment)(integrity_checker_t *this, void *sym, size_t *len);
+ uint32_t (*build_segment)(integrity_checker_t *this, void *sym, size_t *len);
/**
* Check both, on disk file integrity and loaded segment.
diff --git a/src/libstrongswan/utils/leak_detective.c b/src/libstrongswan/utils/leak_detective.c
index 99f4843ad..25bd1118f 100644
--- a/src/libstrongswan/utils/leak_detective.c
+++ b/src/libstrongswan/utils/leak_detective.c
@@ -120,17 +120,17 @@ struct memory_header_t {
/**
* Padding to make sizeof(memory_header_t) == 32
*/
- u_int32_t padding[sizeof(void*) == sizeof(u_int32_t) ? 3 : 0];
+ uint32_t padding[sizeof(void*) == sizeof(uint32_t) ? 3 : 0];
/**
* Number of bytes following after the header
*/
- u_int32_t bytes;
+ uint32_t bytes;
/**
* magic bytes to detect bad free or heap underflow, MEMORY_HEADER_MAGIC
*/
- u_int32_t magic;
+ uint32_t magic;
}__attribute__((__packed__));
@@ -142,7 +142,7 @@ struct memory_tail_t {
/**
* Magic bytes to detect heap overflow, MEMORY_TAIL_MAGIC
*/
- u_int32_t magic;
+ uint32_t magic;
}__attribute__((__packed__));
diff --git a/src/libstrongswan/utils/utils.c b/src/libstrongswan/utils/utils.c
index 40cb43d90..4deba0fe7 100644
--- a/src/libstrongswan/utils/utils.c
+++ b/src/libstrongswan/utils/utils.c
@@ -33,7 +33,7 @@
/* This is from the kernel sources. We limit the length of directory names to
* 256 as we only use it to enumerate FDs. */
struct linux_dirent64 {
- u_int64_t d_ino;
+ uint64_t d_ino;
int64_t d_off;
unsigned short d_reclen;
unsigned char d_type;
diff --git a/src/libstrongswan/utils/utils/align.c b/src/libstrongswan/utils/utils/align.c
index 29f110ff1..ffdb1b5ce 100644
--- a/src/libstrongswan/utils/utils/align.c
+++ b/src/libstrongswan/utils/utils/align.c
@@ -20,9 +20,9 @@
/**
* Described in header.
*/
-void* malloc_align(size_t size, u_int8_t align)
+void* malloc_align(size_t size, uint8_t align)
{
- u_int8_t pad;
+ uint8_t pad;
void *ptr;
if (align == 0)
@@ -46,7 +46,7 @@ void* malloc_align(size_t size, u_int8_t align)
*/
void free_align(void *ptr)
{
- u_int8_t pad, *pos;
+ uint8_t pad, *pos;
pos = ptr - 1;
/* verify padding to check any corruption */
diff --git a/src/libstrongswan/utils/utils/align.h b/src/libstrongswan/utils/utils/align.h
index 39cde10c8..a28dc3668 100644
--- a/src/libstrongswan/utils/utils/align.h
+++ b/src/libstrongswan/utils/utils/align.h
@@ -74,7 +74,7 @@ static inline size_t round_down(size_t size, size_t alignment)
* @param align alignment, up to 255 bytes, usually a power of 2
* @return allocated hunk, aligned to align bytes
*/
-void* malloc_align(size_t size, u_int8_t align);
+void* malloc_align(size_t size, uint8_t align);
/**
* Free a hunk allocated by malloc_align().
diff --git a/src/libstrongswan/utils/utils/byteorder.h b/src/libstrongswan/utils/utils/byteorder.h
index 3ccbad5f1..1072a0e6e 100644
--- a/src/libstrongswan/utils/utils/byteorder.h
+++ b/src/libstrongswan/utils/utils/byteorder.h
@@ -26,7 +26,7 @@
* Architecture independent bitfield definition helpers (at least with GCC).
*
* Defines a bitfield with a type t and a fixed size of bitfield members, e.g.:
- * BITFIELD2(u_int8_t,
+ * BITFIELD2(uint8_t,
* low: 4,
* high: 4,
* ) flags;
@@ -80,7 +80,7 @@
* @param host host order 16-bit value
* @param network unaligned address to write network order value to
*/
-static inline void htoun16(void *network, u_int16_t host)
+static inline void htoun16(void *network, uint16_t host)
{
char *unaligned = (char*)network;
@@ -94,7 +94,7 @@ static inline void htoun16(void *network, u_int16_t host)
* @param host host order 32-bit value
* @param network unaligned address to write network order value to
*/
-static inline void htoun32(void *network, u_int32_t host)
+static inline void htoun32(void *network, uint32_t host)
{
char *unaligned = (char*)network;
@@ -108,7 +108,7 @@ static inline void htoun32(void *network, u_int32_t host)
* @param host host order 64-bit value
* @param network unaligned address to write network order value to
*/
-static inline void htoun64(void *network, u_int64_t host)
+static inline void htoun64(void *network, uint64_t host)
{
char *unaligned = (char*)network;
@@ -122,10 +122,10 @@ static inline void htoun64(void *network, u_int64_t host)
* @param network unaligned address to read network order value from
* @return host order value
*/
-static inline u_int16_t untoh16(void *network)
+static inline uint16_t untoh16(void *network)
{
char *unaligned = (char*)network;
- u_int16_t tmp;
+ uint16_t tmp;
memcpy(&tmp, unaligned, sizeof(tmp));
return ntohs(tmp);
@@ -137,10 +137,10 @@ static inline u_int16_t untoh16(void *network)
* @param network unaligned address to read network order value from
* @return host order value
*/
-static inline u_int32_t untoh32(void *network)
+static inline uint32_t untoh32(void *network)
{
char *unaligned = (char*)network;
- u_int32_t tmp;
+ uint32_t tmp;
memcpy(&tmp, unaligned, sizeof(tmp));
return ntohl(tmp);
@@ -152,10 +152,10 @@ static inline u_int32_t untoh32(void *network)
* @param network unaligned address to read network order value from
* @return host order value
*/
-static inline u_int64_t untoh64(void *network)
+static inline uint64_t untoh64(void *network)
{
char *unaligned = (char*)network;
- u_int64_t tmp;
+ uint64_t tmp;
memcpy(&tmp, unaligned, sizeof(tmp));
return be64toh(tmp);
@@ -167,9 +167,9 @@ static inline u_int64_t untoh64(void *network)
* @param p unaligned address to read little endian value from
* @return host order value
*/
-static inline u_int32_t uletoh32(void *p)
+static inline uint32_t uletoh32(void *p)
{
- u_int32_t ret;
+ uint32_t ret;
memcpy(&ret, p, sizeof(ret));
ret = le32toh(ret);
@@ -182,7 +182,7 @@ static inline u_int32_t uletoh32(void *p)
* @param p host order 32-bit value
* @param v unaligned address to write little endian value to
*/
-static inline void htoule32(void *p, u_int32_t v)
+static inline void htoule32(void *p, uint32_t v)
{
v = htole32(v);
memcpy(p, &v, sizeof(v));
diff --git a/src/libstrongswan/utils/utils/memory.c b/src/libstrongswan/utils/utils/memory.c
index a15371518..30c6f546c 100644
--- a/src/libstrongswan/utils/utils/memory.c
+++ b/src/libstrongswan/utils/utils/memory.c
@@ -20,7 +20,7 @@
/**
* Described in header.
*/
-void memxor(u_int8_t dst[], u_int8_t src[], size_t n)
+void memxor(uint8_t dst[], uint8_t src[], size_t n)
{
int m, i;
diff --git a/src/libstrongswan/utils/utils/memory.h b/src/libstrongswan/utils/utils/memory.h
index aef318f6c..b978e7c48 100644
--- a/src/libstrongswan/utils/utils/memory.h
+++ b/src/libstrongswan/utils/utils/memory.h
@@ -80,7 +80,7 @@ static inline void *memset_noop(void *s, int c, size_t n)
/**
* Same as memcpy, but XORs src into dst instead of copy
*/
-void memxor(u_int8_t dest[], u_int8_t src[], size_t n);
+void memxor(uint8_t dest[], uint8_t src[], size_t n);
/**
* Safely overwrite n bytes of memory at ptr with zero, non-inlining variant.
diff --git a/src/libstrongswan/utils/utils/time.c b/src/libstrongswan/utils/utils/time.c
index c67ae93f2..48e5151c0 100644
--- a/src/libstrongswan/utils/utils/time.c
+++ b/src/libstrongswan/utils/utils/time.c
@@ -121,7 +121,7 @@ int time_delta_printf_hook(printf_hook_data_t *data, printf_hook_spec_t *spec,
char* unit = "second";
time_t *arg1 = *((time_t**)(args[0]));
time_t *arg2 = *((time_t**)(args[1]));
- u_int64_t delta = llabs(*arg1 - *arg2);
+ uint64_t delta = llabs(*arg1 - *arg2);
if (delta > 2 * 60 * 60 * 24)
{
diff --git a/src/libstrongswan/utils/utils/types.h b/src/libstrongswan/utils/utils/types.h
index 056c2e0c2..0aad69491 100644
--- a/src/libstrongswan/utils/utils/types.h
+++ b/src/libstrongswan/utils/utils/types.h
@@ -50,10 +50,10 @@
*/
#if defined __sun || defined WIN32
#include <stdint.h>
-typedef uint8_t u_int8_t;
-typedef uint16_t u_int16_t;
-typedef uint32_t u_int32_t;
-typedef uint64_t u_int64_t;
+typedef uint8_t uint8_t;
+typedef uint16_t uint16_t;
+typedef uint32_t uint32_t;
+typedef uint64_t uint64_t;
#endif
#ifdef HAVE_INT128
@@ -70,7 +70,7 @@ typedef unsigned __int128 u_int128_t;
# define MAX_UINT_TYPE u_int128_t
#else
# define MAX_INT_TYPE int64_t
-# define MAX_UINT_TYPE u_int64_t
+# define MAX_UINT_TYPE uint64_t
#endif
/**