diff options
author | Yves-Alexis Perez <corsac@debian.org> | 2016-07-16 15:19:53 +0200 |
---|---|---|
committer | Yves-Alexis Perez <corsac@debian.org> | 2016-07-16 15:19:53 +0200 |
commit | bf372706c469764d59e9f29c39e3ecbebd72b8d2 (patch) | |
tree | 0f0e296e2d50e4a7faf99ae6fa428d2681e81ea1 /src/charon-tkm | |
parent | 518dd33c94e041db0444c7d1f33da363bb8e3faf (diff) | |
download | vyos-strongswan-bf372706c469764d59e9f29c39e3ecbebd72b8d2.tar.gz vyos-strongswan-bf372706c469764d59e9f29c39e3ecbebd72b8d2.zip |
Imported Upstream version 5.5.0
Diffstat (limited to 'src/charon-tkm')
-rw-r--r-- | src/charon-tkm/Makefile.in | 26 | ||||
-rw-r--r-- | src/charon-tkm/src/tkm/tkm_diffie_hellman.c | 6 | ||||
-rw-r--r-- | src/charon-tkm/src/tkm/tkm_kernel_ipsec.c | 97 | ||||
-rw-r--r-- | src/charon-tkm/src/tkm/tkm_kernel_sad.c | 32 | ||||
-rw-r--r-- | src/charon-tkm/src/tkm/tkm_kernel_sad.h | 10 | ||||
-rw-r--r-- | src/charon-tkm/src/tkm/tkm_keymat.c | 8 | ||||
-rw-r--r-- | src/charon-tkm/src/tkm/tkm_nonceg.c | 2 | ||||
-rw-r--r-- | src/charon-tkm/src/tkm/tkm_spi_generator.c | 12 | ||||
-rw-r--r-- | src/charon-tkm/tests/nonceg_tests.c | 6 |
9 files changed, 103 insertions, 96 deletions
diff --git a/src/charon-tkm/Makefile.in b/src/charon-tkm/Makefile.in index 81afd4de5..1eaf46a89 100644 --- a/src/charon-tkm/Makefile.in +++ b/src/charon-tkm/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,7 +14,17 @@ @SET_MAKE@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -78,7 +88,6 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/charon-tkm -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/config/libtool.m4 \ $(top_srcdir)/m4/config/ltoptions.m4 \ @@ -92,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/config/libtool.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -116,12 +126,14 @@ am__can_run_installinfo = \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ +ATOMICLIB = @ATOMICLIB@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -171,6 +183,7 @@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -205,6 +218,7 @@ PTHREADLIB = @PTHREADLIB@ PYTHON = @PYTHON@ PYTHONEGGINSTALLDIR = @PYTHONEGGINSTALLDIR@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PACKAGE_VERSION = @PYTHON_PACKAGE_VERSION@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ @@ -316,6 +330,7 @@ random_device = @random_device@ resolv_conf = @resolv_conf@ routing_table = @routing_table@ routing_table_prio = @routing_table_prio@ +runstatedir = @runstatedir@ s_plugins = @s_plugins@ sbindir = @sbindir@ scepclient_plugins = @scepclient_plugins@ @@ -391,7 +406,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/charon-tkm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/charon-tkm/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -563,6 +577,8 @@ uninstall-am: mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am +.PRECIOUS: Makefile + all: build_charon diff --git a/src/charon-tkm/src/tkm/tkm_diffie_hellman.c b/src/charon-tkm/src/tkm/tkm_diffie_hellman.c index c4953b6aa..5f2cbfe0c 100644 --- a/src/charon-tkm/src/tkm/tkm_diffie_hellman.c +++ b/src/charon-tkm/src/tkm/tkm_diffie_hellman.c @@ -123,7 +123,7 @@ int register_dh_mapping() int count, i; char *iana_id_str, *tkm_id_str; diffie_hellman_group_t *iana_id; - u_int64_t *tkm_id; + uint64_t *tkm_id; hashtable_t *map; enumerator_t *enumerator; @@ -138,7 +138,7 @@ int register_dh_mapping() { iana_id = malloc_thing(diffie_hellman_group_t); *iana_id = settings_value_as_int(iana_id_str, 0); - tkm_id = malloc_thing(u_int64_t); + tkm_id = malloc_thing(uint64_t); *tkm_id = settings_value_as_int(tkm_id_str, 0); map->put(map, iana_id, tkm_id); @@ -227,7 +227,7 @@ tkm_diffie_hellman_t *tkm_diffie_hellman_create(diffie_hellman_group_t group) return NULL; } - u_int64_t *dha_id = group_map->get(group_map, &group); + uint64_t *dha_id = group_map->get(group_map, &group); if (!dha_id) { free(this); diff --git a/src/charon-tkm/src/tkm/tkm_kernel_ipsec.c b/src/charon-tkm/src/tkm/tkm_kernel_ipsec.c index 2d22fbdc3..c9be8989a 100644 --- a/src/charon-tkm/src/tkm/tkm_kernel_ipsec.c +++ b/src/charon-tkm/src/tkm/tkm_kernel_ipsec.c @@ -54,7 +54,7 @@ struct private_tkm_kernel_ipsec_t { METHOD(kernel_ipsec_t, get_spi, status_t, private_tkm_kernel_ipsec_t *this, host_t *src, host_t *dst, - u_int8_t protocol, u_int32_t *spi) + uint8_t protocol, uint32_t *spi) { bool result; @@ -68,26 +68,21 @@ METHOD(kernel_ipsec_t, get_spi, status_t, } } - result = this->rng->get_bytes(this->rng, sizeof(u_int32_t), - (u_int8_t *)spi); + result = this->rng->get_bytes(this->rng, sizeof(uint32_t), + (uint8_t *)spi); return result ? SUCCESS : FAILED; } METHOD(kernel_ipsec_t, get_cpi, status_t, private_tkm_kernel_ipsec_t *this, host_t *src, host_t *dst, - u_int16_t *cpi) + uint16_t *cpi) { return NOT_SUPPORTED; } METHOD(kernel_ipsec_t, add_sa, status_t, - private_tkm_kernel_ipsec_t *this, host_t *src, host_t *dst, - u_int32_t spi, u_int8_t protocol, u_int32_t reqid, mark_t mark, - u_int32_t tfc, lifetime_cfg_t *lifetime, u_int16_t enc_alg, chunk_t enc_key, - u_int16_t int_alg, chunk_t int_key, ipsec_mode_t mode, - u_int16_t ipcomp, u_int16_t cpi, u_int32_t replay_window, - bool initiator, bool encap, bool esn, bool inbound, bool update, - linked_list_t* src_ts, linked_list_t* dst_ts) + private_tkm_kernel_ipsec_t *this, kernel_ipsec_sa_id_t *id, + kernel_ipsec_add_sa_t *data) { esa_info_t esa; esp_spi_type spi_loc, spi_rem; @@ -97,43 +92,43 @@ METHOD(kernel_ipsec_t, add_sa, status_t, esa_id_type esa_id; nonce_type nc_rem; - if (enc_key.ptr == NULL) + if (data->enc_key.ptr == NULL) { DBG1(DBG_KNL, "Unable to get ESA information"); return FAILED; } - esa = *(esa_info_t *)(enc_key.ptr); + esa = *(esa_info_t *)(data->enc_key.ptr); /* only handle the case where we have both distinct ESP spi's available */ - if (esa.spi_r == spi) + if (esa.spi_r == id->spi) { chunk_free(&esa.nonce_i); chunk_free(&esa.nonce_r); return SUCCESS; } - if (initiator) + if (data->initiator) { - spi_loc = spi; + spi_loc = id->spi; spi_rem = esa.spi_r; - local = dst; - peer = src; + local = id->dst; + peer = id->src; nonce_loc = &esa.nonce_i; nonce_rem = &esa.nonce_r; } else { spi_loc = esa.spi_r; - spi_rem = spi; - local = src; - peer = dst; + spi_rem = id->spi; + local = id->src; + peer = id->dst; nonce_loc = &esa.nonce_r; nonce_rem = &esa.nonce_i; } esa_id = tkm->idmgr->acquire_id(tkm->idmgr, TKM_CTX_ESA); - if (!tkm->sad->insert(tkm->sad, esa_id, reqid, local, peer, spi_loc, spi_rem, - protocol)) + if (!tkm->sad->insert(tkm->sad, esa_id, data->reqid, local, peer, + spi_loc, spi_rem, id->proto)) { DBG1(DBG_KNL, "unable to add entry (%llu) to SAD", esa_id); goto sad_failure; @@ -146,8 +141,8 @@ METHOD(kernel_ipsec_t, add_sa, status_t, nonce_loc_id = tkm->chunk_map->get_id(tkm->chunk_map, nonce_loc); if (nonce_loc_id == 0 && esa.dh_id == 0) { - if (ike_esa_create_first(esa_id, esa.isa_id, reqid, 1, spi_loc, spi_rem) - != TKM_OK) + if (ike_esa_create_first(esa_id, esa.isa_id, data->reqid, 1, spi_loc, + spi_rem) != TKM_OK) { DBG1(DBG_KNL, "child SA (%llu, first) creation failed", esa_id); goto failure; @@ -157,9 +152,9 @@ METHOD(kernel_ipsec_t, add_sa, status_t, else if (nonce_loc_id != 0 && esa.dh_id == 0) { chunk_to_sequence(nonce_rem, &nc_rem, sizeof(nonce_type)); - if (ike_esa_create_no_pfs(esa_id, esa.isa_id, reqid, 1, nonce_loc_id, - nc_rem, initiator, spi_loc, spi_rem) - != TKM_OK) + if (ike_esa_create_no_pfs(esa_id, esa.isa_id, data->reqid, 1, + nonce_loc_id, nc_rem, data->initiator, + spi_loc, spi_rem) != TKM_OK) { DBG1(DBG_KNL, "child SA (%llu, no PFS) creation failed", esa_id); goto failure; @@ -171,8 +166,9 @@ METHOD(kernel_ipsec_t, add_sa, status_t, else { chunk_to_sequence(nonce_rem, &nc_rem, sizeof(nonce_type)); - if (ike_esa_create(esa_id, esa.isa_id, reqid, 1, esa.dh_id, nonce_loc_id, - nc_rem, initiator, spi_loc, spi_rem) != TKM_OK) + if (ike_esa_create(esa_id, esa.isa_id, data->reqid, 1, esa.dh_id, + nonce_loc_id, nc_rem, data->initiator, spi_loc, + spi_rem) != TKM_OK) { DBG1(DBG_KNL, "child SA (%llu) creation failed", esa_id); goto failure; @@ -192,7 +188,7 @@ METHOD(kernel_ipsec_t, add_sa, status_t, DBG1(DBG_KNL, "added child SA (esa: %llu, isa: %llu, esp_spi_loc: %x, " "esp_spi_rem: %x, role: %s)", esa_id, esa.isa_id, ntohl(spi_loc), - ntohl(spi_rem), initiator ? "initiator" : "responder"); + ntohl(spi_rem), data->initiator ? "initiator" : "responder"); chunk_free(&esa.nonce_i); chunk_free(&esa.nonce_r); @@ -208,20 +204,21 @@ sad_failure: } METHOD(kernel_ipsec_t, query_sa, status_t, - private_tkm_kernel_ipsec_t *this, host_t *src, host_t *dst, - u_int32_t spi, u_int8_t protocol, mark_t mark, u_int64_t *bytes, - u_int64_t *packets, time_t *time) + private_tkm_kernel_ipsec_t *this, kernel_ipsec_sa_id_t *id, + kernel_ipsec_query_sa_t *data, uint64_t *bytes, uint64_t *packets, + time_t *time) { return NOT_SUPPORTED; } METHOD(kernel_ipsec_t, del_sa, status_t, - private_tkm_kernel_ipsec_t *this, host_t *src, host_t *dst, - u_int32_t spi, u_int8_t protocol, u_int16_t cpi, mark_t mark) + private_tkm_kernel_ipsec_t *this, kernel_ipsec_sa_id_t *id, + kernel_ipsec_del_sa_t *data) { esa_id_type esa_id, other_esa_id; - esa_id = tkm->sad->get_esa_id(tkm->sad, src, dst, spi, protocol); + esa_id = tkm->sad->get_esa_id(tkm->sad, id->src, id->dst, + id->spi, id->proto); if (esa_id) { other_esa_id = tkm->sad->get_other_esa_id(tkm->sad, esa_id); @@ -236,7 +233,7 @@ METHOD(kernel_ipsec_t, del_sa, status_t, } DBG1(DBG_KNL, "deleting child SA (esa: %llu, spi: %x)", esa_id, - ntohl(spi)); + ntohl(id->spi)); if (ike_esa_reset(esa_id) != TKM_OK) { DBG1(DBG_KNL, "child SA (%llu) deletion failed", esa_id); @@ -249,9 +246,8 @@ METHOD(kernel_ipsec_t, del_sa, status_t, } METHOD(kernel_ipsec_t, update_sa, status_t, - private_tkm_kernel_ipsec_t *this, u_int32_t spi, u_int8_t protocol, - u_int16_t cpi, host_t *src, host_t *dst, host_t *new_src, host_t *new_dst, - bool old_encap, bool new_encap, mark_t mark) + private_tkm_kernel_ipsec_t *this, kernel_ipsec_sa_id_t *id, + kernel_ipsec_update_sa_t *data) { return NOT_SUPPORTED; } @@ -264,27 +260,22 @@ METHOD(kernel_ipsec_t, flush_sas, status_t, } METHOD(kernel_ipsec_t, add_policy, status_t, - private_tkm_kernel_ipsec_t *this, host_t *src, host_t *dst, - traffic_selector_t *src_ts, traffic_selector_t *dst_ts, - policy_dir_t direction, policy_type_t type, ipsec_sa_cfg_t *sa, - mark_t mark, policy_priority_t priority) + private_tkm_kernel_ipsec_t *this, kernel_ipsec_policy_id_t *id, + kernel_ipsec_manage_policy_t *data) { return SUCCESS; } METHOD(kernel_ipsec_t, query_policy, status_t, - private_tkm_kernel_ipsec_t *this, traffic_selector_t *src_ts, - traffic_selector_t *dst_ts, policy_dir_t direction, mark_t mark, - time_t *use_time) + private_tkm_kernel_ipsec_t *this, kernel_ipsec_policy_id_t *id, + kernel_ipsec_query_policy_t *data, time_t *use_time) { return NOT_SUPPORTED; } METHOD(kernel_ipsec_t, del_policy, status_t, - private_tkm_kernel_ipsec_t *this, host_t *src, host_t *dst, - traffic_selector_t *src_ts, traffic_selector_t *dst_ts, - policy_dir_t direction, policy_type_t type, ipsec_sa_cfg_t *sa, - mark_t mark, policy_priority_t priority) + private_tkm_kernel_ipsec_t *this, kernel_ipsec_policy_id_t *id, + kernel_ipsec_manage_policy_t *data) { return SUCCESS; } @@ -338,7 +329,7 @@ METHOD(kernel_ipsec_t, bypass_socket, bool, } METHOD(kernel_ipsec_t, enable_udp_decap, bool, - private_tkm_kernel_ipsec_t *this, int fd, int family, u_int16_t port) + private_tkm_kernel_ipsec_t *this, int fd, int family, uint16_t port) { int type = UDP_ENCAP_ESPINUDP; diff --git a/src/charon-tkm/src/tkm/tkm_kernel_sad.c b/src/charon-tkm/src/tkm/tkm_kernel_sad.c index 2556f6b8b..22d2aac13 100644 --- a/src/charon-tkm/src/tkm/tkm_kernel_sad.c +++ b/src/charon-tkm/src/tkm/tkm_kernel_sad.c @@ -59,7 +59,7 @@ struct sad_entry_t { /** * Reqid. */ - u_int32_t reqid; + uint32_t reqid; /** * Source address of CHILD SA. @@ -74,17 +74,17 @@ struct sad_entry_t { /** * Local SPI of CHILD SA. */ - u_int32_t spi_loc; + uint32_t spi_loc; /** * Remote SPI of CHILD SA. */ - u_int32_t spi_rem; + uint32_t spi_rem; /** * Protocol of CHILD SA (ESP/AH). */ - u_int8_t proto; + uint8_t proto; }; @@ -105,8 +105,8 @@ static void sad_entry_destroy(sad_entry_t *entry) * Find a list entry with given src, dst, (remote) spi and proto values. */ static bool sad_entry_match(sad_entry_t * const entry, const host_t * const src, - const host_t * const dst, const u_int32_t * const spi, - const u_int8_t * const proto) + const host_t * const dst, const uint32_t * const spi, + const uint8_t * const proto) { if (entry->src == NULL || entry->dst == NULL) { @@ -122,9 +122,9 @@ static bool sad_entry_match(sad_entry_t * const entry, const host_t * const src, * Find a list entry with given reqid, spi and proto values. */ static bool sad_entry_match_dst(sad_entry_t * const entry, - const u_int32_t * const reqid, - const u_int32_t * const spi, - const u_int8_t * const proto) + const uint32_t * const reqid, + const uint32_t * const spi, + const uint8_t * const proto) { return entry->reqid == *reqid && entry->spi_rem == *spi && @@ -145,7 +145,7 @@ static bool sad_entry_match_esa_id(sad_entry_t * const entry, */ static bool sad_entry_match_other_esa(sad_entry_t * const entry, const esa_id_type * const esa_id, - const u_int32_t * const reqid) + const uint32_t * const reqid) { return entry->reqid == *reqid && entry->esa_id != *esa_id; @@ -172,8 +172,8 @@ static bool sad_entry_equal(sad_entry_t * const left, sad_entry_t * const right) METHOD(tkm_kernel_sad_t, insert, bool, private_tkm_kernel_sad_t * const this, const esa_id_type esa_id, - const u_int32_t reqid, const host_t * const src, const host_t * const dst, - const u_int32_t spi_loc, const u_int32_t spi_rem, const u_int8_t proto) + const uint32_t reqid, const host_t * const src, const host_t * const dst, + const uint32_t spi_loc, const uint32_t spi_rem, const uint8_t proto) { status_t result; sad_entry_t *new_entry; @@ -212,7 +212,7 @@ METHOD(tkm_kernel_sad_t, insert, bool, METHOD(tkm_kernel_sad_t, get_esa_id, esa_id_type, private_tkm_kernel_sad_t * const this, const host_t * const src, - const host_t * const dst, const u_int32_t spi, const u_int8_t proto) + const host_t * const dst, const uint32_t spi, const uint8_t proto) { esa_id_type id = 0; sad_entry_t *entry = NULL; @@ -242,7 +242,7 @@ METHOD(tkm_kernel_sad_t, get_other_esa_id, esa_id_type, { esa_id_type id = 0; sad_entry_t *entry = NULL; - u_int32_t reqid; + uint32_t reqid; status_t res; this->mutex->lock(this->mutex); @@ -274,8 +274,8 @@ METHOD(tkm_kernel_sad_t, get_other_esa_id, esa_id_type, } METHOD(tkm_kernel_sad_t, get_dst_host, host_t *, - private_tkm_kernel_sad_t * const this, const u_int32_t reqid, - const u_int32_t spi, const u_int8_t proto) + private_tkm_kernel_sad_t * const this, const uint32_t reqid, + const uint32_t spi, const uint8_t proto) { host_t *dst = NULL; sad_entry_t *entry = NULL; diff --git a/src/charon-tkm/src/tkm/tkm_kernel_sad.h b/src/charon-tkm/src/tkm/tkm_kernel_sad.h index 3a84deffc..ba6462192 100644 --- a/src/charon-tkm/src/tkm/tkm_kernel_sad.h +++ b/src/charon-tkm/src/tkm/tkm_kernel_sad.h @@ -46,9 +46,9 @@ struct tkm_kernel_sad_t { * @return TRUE if entry was inserted, FALSE otherwise */ bool (*insert)(tkm_kernel_sad_t * const this, const esa_id_type esa_id, - const u_int32_t reqid, const host_t * const src, - const host_t * const dst, const u_int32_t spi_loc, - const u_int32_t spi_rem, const u_int8_t proto); + const uint32_t reqid, const host_t * const src, + const host_t * const dst, const uint32_t spi_loc, + const uint32_t spi_rem, const uint8_t proto); /** * Get ESA id for entry with given parameters. @@ -61,7 +61,7 @@ struct tkm_kernel_sad_t { */ esa_id_type (*get_esa_id)(tkm_kernel_sad_t * const this, const host_t * const src, const host_t * const dst, - const u_int32_t spi, const u_int8_t proto); + const uint32_t spi, const uint8_t proto); /** * Get ESA id for entry associated with same security policy as the @@ -82,7 +82,7 @@ struct tkm_kernel_sad_t { * @return destination host of entry if found, NULL otherwise */ host_t * (*get_dst_host)(tkm_kernel_sad_t * const this, - const u_int32_t reqid, const u_int32_t spi, const u_int8_t proto); + const uint32_t reqid, const uint32_t spi, const uint8_t proto); /** * Remove entry with given ESA id from SAD. diff --git a/src/charon-tkm/src/tkm/tkm_keymat.c b/src/charon-tkm/src/tkm/tkm_keymat.c index 1e1fa4f30..a7cce0f62 100644 --- a/src/charon-tkm/src/tkm/tkm_keymat.c +++ b/src/charon-tkm/src/tkm/tkm_keymat.c @@ -96,8 +96,8 @@ struct private_tkm_keymat_t { static void aead_create_from_keys(aead_t **in, aead_t **out, const chunk_t * const sk_ai, const chunk_t * const sk_ar, const chunk_t * const sk_ei, const chunk_t * const sk_er, - const u_int16_t enc_alg, const u_int16_t int_alg, - const u_int16_t key_size, bool initiator) + const uint16_t enc_alg, const uint16_t int_alg, + const uint16_t key_size, bool initiator) { *in = *out = NULL; signer_t *signer_i, *signer_r; @@ -187,8 +187,8 @@ METHOD(keymat_v2_t, derive_ike_keys, bool, chunk_t nonce_i, chunk_t nonce_r, ike_sa_id_t *id, pseudo_random_function_t rekey_function, chunk_t rekey_skd) { - u_int16_t enc_alg, int_alg, key_size; - u_int64_t nc_id, spi_loc, spi_rem; + uint16_t enc_alg, int_alg, key_size; + uint64_t nc_id, spi_loc, spi_rem; chunk_t *nonce, c_ai, c_ar, c_ei, c_er; tkm_diffie_hellman_t *tkm_dh; dh_id_type dh_id; diff --git a/src/charon-tkm/src/tkm/tkm_nonceg.c b/src/charon-tkm/src/tkm/tkm_nonceg.c index 336f16ecd..493ea2922 100644 --- a/src/charon-tkm/src/tkm/tkm_nonceg.c +++ b/src/charon-tkm/src/tkm/tkm_nonceg.c @@ -39,7 +39,7 @@ struct private_tkm_nonceg_t { }; METHOD(nonce_gen_t, get_nonce, bool, - private_tkm_nonceg_t *this, size_t size, u_int8_t *buffer) + private_tkm_nonceg_t *this, size_t size, uint8_t *buffer) { nonce_type nonce; uint64_t nc_id; diff --git a/src/charon-tkm/src/tkm/tkm_spi_generator.c b/src/charon-tkm/src/tkm/tkm_spi_generator.c index eff0ca91e..b9ce83727 100644 --- a/src/charon-tkm/src/tkm/tkm_spi_generator.c +++ b/src/charon-tkm/src/tkm/tkm_spi_generator.c @@ -25,8 +25,8 @@ */ typedef struct { rng_t *rng; - u_int64_t spi_mask; - u_int64_t spi_label; + uint64_t spi_mask; + uint64_t spi_label; } get_spi_args_t; static get_spi_args_t *spi_args; @@ -37,12 +37,12 @@ static get_spi_args_t *spi_args; * @param this Callback args containing rng_t and spi mask & label * @return labeled SPI */ -CALLBACK(tkm_get_spi, u_int64_t, +CALLBACK(tkm_get_spi, uint64_t, const get_spi_args_t const *this) { - u_int64_t spi; + uint64_t spi; - if (!this->rng->get_bytes(this->rng, sizeof(spi), (u_int8_t*)&spi)) + if (!this->rng->get_bytes(this->rng, sizeof(spi), (uint8_t*)&spi)) { return 0; } @@ -54,7 +54,7 @@ bool tkm_spi_generator_register(plugin_t *plugin, plugin_feature_t *feature, bool reg, void *cb_data) { - u_int64_t spi_mask, spi_label; + uint64_t spi_mask, spi_label; char *spi_val; rng_t *rng; diff --git a/src/charon-tkm/tests/nonceg_tests.c b/src/charon-tkm/tests/nonceg_tests.c index d150891eb..67c1635ef 100644 --- a/src/charon-tkm/tests/nonceg_tests.c +++ b/src/charon-tkm/tests/nonceg_tests.c @@ -37,7 +37,7 @@ START_TEST(test_nonceg_allocate_nonce) tkm_nonceg_t *ng = tkm_nonceg_create(); const size_t length = 256; - u_int8_t zero[length]; + uint8_t zero[length]; memset(zero, 0, length); chunk_t nonce; @@ -61,10 +61,10 @@ START_TEST(test_nonceg_get_nonce) tkm_nonceg_t *ng = tkm_nonceg_create(); const size_t length = 128; - u_int8_t zero[length]; + uint8_t zero[length]; memset(zero, 0, length); - u_int8_t *buf = malloc(length + 1); + uint8_t *buf = malloc(length + 1); memset(buf, 0, length); /* set end marker */ buf[length] = 255; |