diff options
Diffstat (limited to 'src/libstrongswan/plugins/rdrand')
-rw-r--r-- | src/libstrongswan/plugins/rdrand/Makefile.in | 27 | ||||
-rw-r--r-- | src/libstrongswan/plugins/rdrand/rdrand_rng.c | 76 |
2 files changed, 59 insertions, 44 deletions
diff --git a/src/libstrongswan/plugins/rdrand/Makefile.in b/src/libstrongswan/plugins/rdrand/Makefile.in index f6bdf9c59..ff853b691 100644 --- a/src/libstrongswan/plugins/rdrand/Makefile.in +++ b/src/libstrongswan/plugins/rdrand/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/rdrand -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 = @@ -202,12 +211,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@ @@ -257,6 +268,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@ @@ -291,6 +303,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@ @@ -402,6 +415,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@ @@ -459,7 +473,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/libstrongswan/plugins/rdrand/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/libstrongswan/plugins/rdrand/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -773,6 +786,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/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) { |