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/libstrongswan/plugins/af_alg | |
parent | 518dd33c94e041db0444c7d1f33da363bb8e3faf (diff) | |
download | vyos-strongswan-bf372706c469764d59e9f29c39e3ecbebd72b8d2.tar.gz vyos-strongswan-bf372706c469764d59e9f29c39e3ecbebd72b8d2.zip |
Imported Upstream version 5.5.0
Diffstat (limited to 'src/libstrongswan/plugins/af_alg')
-rw-r--r-- | src/libstrongswan/plugins/af_alg/Makefile.in | 27 | ||||
-rw-r--r-- | src/libstrongswan/plugins/af_alg/af_alg_hasher.c | 2 | ||||
-rw-r--r-- | src/libstrongswan/plugins/af_alg/af_alg_ops.c | 2 | ||||
-rw-r--r-- | src/libstrongswan/plugins/af_alg/af_alg_ops.h | 2 | ||||
-rw-r--r-- | src/libstrongswan/plugins/af_alg/af_alg_plugin.c | 19 | ||||
-rw-r--r-- | src/libstrongswan/plugins/af_alg/af_alg_prf.c | 2 | ||||
-rw-r--r-- | src/libstrongswan/plugins/af_alg/af_alg_signer.c | 2 |
7 files changed, 45 insertions, 11 deletions
diff --git a/src/libstrongswan/plugins/af_alg/Makefile.in b/src/libstrongswan/plugins/af_alg/Makefile.in index 7aaea450c..1f092287b 100644 --- a/src/libstrongswan/plugins/af_alg/Makefile.in +++ b/src/libstrongswan/plugins/af_alg/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, @@ -15,7 +15,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 \ ?) ;; \ @@ -79,8 +89,6 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/libstrongswan/plugins/af_alg -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/config/libtool.m4 \ $(top_srcdir)/m4/config/ltoptions.m4 \ @@ -94,6 +102,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 = @@ -204,12 +213,14 @@ am__define_uniq_tagged_files = \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp 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@ @@ -259,6 +270,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@ @@ -293,6 +305,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@ @@ -404,6 +417,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@ @@ -466,7 +480,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/libstrongswan/plugins/af_alg/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/libstrongswan/plugins/af_alg/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -784,6 +797,8 @@ uninstall-am: uninstall-pluginLTLIBRARIES mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-pluginLTLIBRARIES +.PRECIOUS: Makefile + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. 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_plugin.c b/src/libstrongswan/plugins/af_alg/af_alg_plugin.c index 445667507..571882cec 100644 --- a/src/libstrongswan/plugins/af_alg/af_alg_plugin.c +++ b/src/libstrongswan/plugins/af_alg/af_alg_plugin.c @@ -22,6 +22,8 @@ #include "af_alg_prf.h" #include "af_alg_crypter.h" +#include <unistd.h> + typedef struct private_af_alg_plugin_t private_af_alg_plugin_t; /** @@ -41,6 +43,19 @@ METHOD(plugin_t, get_name, char*, return "af-alg"; } +static bool af_alg_supported() +{ + int fd; + + fd = socket(AF_ALG, SOCK_SEQPACKET, 0); + if (fd != -1) + { + close(fd); + return true; + } + return false; +} + METHOD(plugin_t, get_features, int, private_af_alg_plugin_t *this, plugin_feature_t *features[]) { @@ -50,6 +65,10 @@ METHOD(plugin_t, get_features, int, if (!count) { /* initialize only once */ + if (!af_alg_supported()) + { + return 0; + } f[count++] = PLUGIN_REGISTER(HASHER, af_alg_hasher_create); af_alg_hasher_probe(f, &count); f[count++] = PLUGIN_REGISTER(SIGNER, af_alg_signer_create); 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); } |