8 years agocharon-cmd: Block SIGUSR1 on worker threads
Martin Willi [Tue, 4 Feb 2014 10:14:27 +0000 (11:14 +0100)]
charon-cmd: Block SIGUSR1 on worker threads

To properly shut down charon-cmd with leak reports, only the main thread
should catch SIGUSR1 to shut down the application. Work threads should ignore
SIGUSR1 to avoid any hard application termination.

8 years agoDocument ipsec attest --session command
Andreas Steffen [Wed, 5 Feb 2014 11:06:46 +0000 (12:06 +0100)]
Document ipsec attest --session command

8 years agoAllow output of session time in UTC
Andreas Steffen [Wed, 5 Feb 2014 11:06:22 +0000 (12:06 +0100)]
Allow output of session time in UTC

8 years agoAdded missing semicolon in SQL statements
Andreas Steffen [Wed, 5 Feb 2014 09:15:56 +0000 (10:15 +0100)]
Added missing semicolon in SQL statements

8 years agoAdded Android 4.3.1 to products database table
Andreas Steffen [Tue, 4 Feb 2014 18:49:34 +0000 (19:49 +0100)]
Added Android 4.3.1 to products database table

8 years agoAdded new Android versions to PTS database
Andreas Steffen [Tue, 4 Feb 2014 05:59:01 +0000 (06:59 +0100)]
Added new Android versions to PTS database

8 years agotesting: Fetch the FreeRADIUS tarball from the "old" directory
Martin Willi [Fri, 31 Jan 2014 16:51:45 +0000 (17:51 +0100)]
testing: Fetch the FreeRADIUS tarball from the "old" directory

Fixes #483.

8 years agounit-tests: Add some test cases for HTTP GET/POST fetches
Martin Willi [Thu, 30 Jan 2014 17:05:46 +0000 (18:05 +0100)]
unit-tests: Add some test cases for HTTP GET/POST fetches

8 years agounit-tests: Fix test_runner_run() apidoc
Martin Willi [Wed, 29 Jan 2014 12:36:56 +0000 (13:36 +0100)]
unit-tests: Fix test_runner_run() apidoc

8 years agopki: Declare correct section in pki --issue man page
Tobias Brunner [Fri, 24 Jan 2014 15:16:08 +0000 (16:16 +0100)]
pki: Declare correct section in pki --issue man page

8 years agoNEWS: Add unit testing improvements
Martin Willi [Fri, 24 Jan 2014 12:18:45 +0000 (13:18 +0100)]
NEWS: Add unit testing improvements

8 years agoike: Restart inactivity counter after doing a CHILD_SA rekey
Martin Willi [Thu, 7 Nov 2013 08:21:02 +0000 (09:21 +0100)]
ike: Restart inactivity counter after doing a CHILD_SA rekey

When doing a rekey for a CHILD_SA, the use counters get reset. An inactivity
job is queued for a time unrelated to the rekey time, so it might happen
that the inactivity job gets executed just after rekeying. If this happens,
inactivity is detected even if we had traffic on the rekeyed CHILD_SA just
before rekeying.

This change implies that inactivity checks can't handle inactivity timeouts
for rekeyed CHILD_SAs, and therefore requires that inactivity timeout is shorter
than the rekey time to have any effect.

8 years agochild-sa: Add a getter for CHILD_SA install time
Martin Willi [Thu, 7 Nov 2013 08:20:40 +0000 (09:20 +0100)]
child-sa: Add a getter for CHILD_SA install time

8 years agoMerge branch 'pam-session'
Martin Willi [Thu, 23 Jan 2014 15:14:46 +0000 (16:14 +0100)]
Merge branch 'pam-session'

Add support for PAM session management in xauth-pam.

8 years agoNEWS: Introduce PAM session management
Martin Willi [Thu, 23 Jan 2014 15:11:54 +0000 (16:11 +0100)]
NEWS: Introduce PAM session management

8 years agoman: Document xauth-pam session option
Martin Willi [Wed, 22 Jan 2014 13:31:22 +0000 (14:31 +0100)]
man: Document xauth-pam session option

8 years agoxauth-pam: Open/close a PAM session for each connected client
Andrea Bonomi [Tue, 21 Jan 2014 08:54:20 +0000 (09:54 +0100)]
xauth-pam: Open/close a PAM session for each connected client

Signed-off-by: Andrea Bonomi <>
8 years agoxauth-pam: Sanitize XAuth attributes before passing them to PAM
Martin Willi [Wed, 22 Jan 2014 13:01:01 +0000 (14:01 +0100)]
xauth-pam: Sanitize XAuth attributes before passing them to PAM

8 years agoMerge branch 'vendor-ids'
Martin Willi [Thu, 23 Jan 2014 15:04:48 +0000 (16:04 +0100)]
Merge branch 'vendor-ids'

Refactors IKEv2 vendor ID handling, and introduces some IDs seen when talking
to Cisco devices.

8 years agoikev2: Add Cisco FRAGMENTATION vendor ID
Martin Willi [Fri, 17 Jan 2014 11:00:13 +0000 (12:00 +0100)]
ikev2: Add Cisco FRAGMENTATION vendor ID

Courtesy of C.J. Adams-Collier, ZeroLag Communications, Inc.

8 years agoikev2: Add Cisco Copyright vendor ID
Martin Willi [Fri, 17 Jan 2014 10:58:12 +0000 (11:58 +0100)]
ikev2: Add Cisco Copyright vendor ID

Courtesy of C.J. Adams-Collier, ZeroLag Communications, Inc.

8 years agoikev2: Add Cisco Delete Reason vendor ID
Martin Willi [Fri, 17 Jan 2014 10:57:47 +0000 (11:57 +0100)]
ikev2: Add Cisco Delete Reason vendor ID

Courtesy of C.J. Adams-Collier, ZeroLag Communications, Inc.

8 years agoikev2: Use a more dynamic vendor ID database, as we use with IKEv1
Martin Willi [Fri, 17 Jan 2014 10:37:35 +0000 (11:37 +0100)]
ikev2: Use a more dynamic vendor ID database, as we use with IKEv1

8 years agoMerge branch 'chunk-mmap'
Martin Willi [Thu, 23 Jan 2014 14:55:44 +0000 (15:55 +0100)]
Merge branch 'chunk-mmap'

Introduces file mmap/munmap() wrappers and provides a fallback if mmap() is not
supported. Replaces all mmap() uses by the new functions.

8 years agolibpts: Use chunk_map() instead of non-portable mmap()
Martin Willi [Thu, 21 Nov 2013 13:49:19 +0000 (14:49 +0100)]
libpts: Use chunk_map() instead of non-portable mmap()

8 years agotnccs: Use chunk_map() instead of non-portable mmap()
Martin Willi [Thu, 21 Nov 2013 13:49:57 +0000 (14:49 +0100)]
tnccs: Use chunk_map() instead of non-portable mmap()

8 years agopem: Use chunk_map() instead of non-portable mmap()
Martin Willi [Thu, 21 Nov 2013 13:49:37 +0000 (14:49 +0100)]
pem: Use chunk_map() instead of non-portable mmap()

8 years agostroke: Use chunk_map() instead of non-portable mmap()
Martin Willi [Thu, 21 Nov 2013 13:48:03 +0000 (14:48 +0100)]
stroke: Use chunk_map() instead of non-portable mmap()

8 years agoradattr: Use chunk_map() instead of non-portable mmap()
Martin Willi [Thu, 21 Nov 2013 13:47:23 +0000 (14:47 +0100)]
radattr: Use chunk_map() instead of non-portable mmap()

8 years agolibfast: Use chunk_map() instead of non-portable mmap()
Martin Willi [Thu, 21 Nov 2013 13:48:23 +0000 (14:48 +0100)]
libfast: Use chunk_map() instead of non-portable mmap()

8 years agointegrity-checker: Use chunk_map() instead of non-portable mmap()
Martin Willi [Thu, 21 Nov 2013 13:50:30 +0000 (14:50 +0100)]
integrity-checker: Use chunk_map() instead of non-portable mmap()

8 years agochunk: Externalize error reporting in chunk_write()
Martin Willi [Thu, 21 Nov 2013 13:22:01 +0000 (14:22 +0100)]
chunk: Externalize error reporting in chunk_write()

This avoids passing that arbitrary label just for error messages, and gives
greater flexibility in handling errors.

8 years agochunk: Provide a fallback chunk_map() if mmap is not available
Martin Willi [Thu, 21 Nov 2013 13:07:12 +0000 (14:07 +0100)]
chunk: Provide a fallback chunk_map() if mmap is not available

8 years agochunk: Use dynamically allocated buffer in chunk_from_fd()
Martin Willi [Thu, 21 Nov 2013 11:19:20 +0000 (12:19 +0100)]
chunk: Use dynamically allocated buffer in chunk_from_fd()

When acting on files, we can use fstat() to estimate the buffer size. On
non-file FDs, we dynamically increase an allocated buffer.

Additionally we slightly change the function signature to properly handle
zero-length files and add appropriate unit tests.

8 years agochunk: Add functions to map file contents to a chunk
Martin Willi [Thu, 21 Nov 2013 10:29:46 +0000 (11:29 +0100)]
chunk: Add functions to map file contents to a chunk

8 years agoMerge branch 'unity-fixes'
Tobias Brunner [Thu, 23 Jan 2014 10:19:38 +0000 (11:19 +0100)]
Merge branch 'unity-fixes'

Improves compatibility with the Cisco and Shrew clients.

Fixes #445.

8 years agounity: Send all traffic selectors in a single UNITY_SPLIT_INCLUDE attribute
Tobias Brunner [Fri, 15 Nov 2013 15:45:59 +0000 (16:45 +0100)]
unity: Send all traffic selectors in a single UNITY_SPLIT_INCLUDE attribute

Cisco clients only handle the first such attribute.

8 years agounity: Change local TS to as responder
Tobias Brunner [Fri, 15 Nov 2013 14:15:19 +0000 (15:15 +0100)]
unity: Change local TS to as responder

Cisco clients and Shrew expect a remote TS of if Unity is
used, otherwise Quick Mode fails.

8 years agounity: Send UNITY_SPLIT_INCLUDE attributes with proper padding
Tobias Brunner [Fri, 15 Nov 2013 13:54:42 +0000 (14:54 +0100)]
unity: Send UNITY_SPLIT_INCLUDE attributes with proper padding

The additional 6 bytes are not actually padding but are parsed by the
Cisco client as protocol and src and dst ports (each two bytes but
strangely only the first two in network order).

8 years agoMerge branch 'ipcomp'
Tobias Brunner [Thu, 23 Jan 2014 09:27:49 +0000 (10:27 +0100)]
Merge branch 'ipcomp'

Fixes compatibility issues between firewall rules (leftfirewall=yes)
and IPComp (compress=yes), plus issues with IPComp when used with
multiple subnets in left|rightsubnet.

Fixes #436.

8 years agotesting: Add ikev2/host2host-transport-nat scenario
Tobias Brunner [Fri, 8 Nov 2013 13:57:01 +0000 (14:57 +0100)]
testing: Add ikev2/host2host-transport-nat scenario

8 years agotesting: Add ipv6/rw-compress-ikev2 scenario
Tobias Brunner [Fri, 8 Nov 2013 11:16:40 +0000 (12:16 +0100)]
testing: Add ipv6/rw-compress-ikev2 scenario

8 years agotesting: Add ikev2/compress-nat scenario
Tobias Brunner [Fri, 8 Nov 2013 10:12:04 +0000 (11:12 +0100)]
testing: Add ikev2/compress-nat scenario

8 years agotesting: Enable firewall for ikev2/compress scenario
Tobias Brunner [Fri, 8 Nov 2013 09:54:20 +0000 (10:54 +0100)]
testing: Enable firewall for ikev2/compress scenario

Additionally, send a regular (small) ping as the kernel does not
compress small packets and handles those differently inbound.

8 years agokernel-netlink: Set selector on transport mode IPComp SAs
Tobias Brunner [Thu, 7 Nov 2013 20:02:07 +0000 (21:02 +0100)]
kernel-netlink: Set selector on transport mode IPComp SAs

8 years agokernel-netlink: Selectively add selector on SAs that use IPComp
Tobias Brunner [Thu, 7 Nov 2013 19:58:42 +0000 (20:58 +0100)]
kernel-netlink: Selectively add selector on SAs that use IPComp

Don't add a selector to tunnel mode SAs, these might serve multiple
traffic selectors but with only one selector on the SA only the traffic
matching the first one would actually get tunneled.

8 years agoupdown: Increase buffer size for script and environment variables
Tobias Brunner [Thu, 7 Nov 2013 19:56:30 +0000 (20:56 +0100)]
updown: Increase buffer size for script and environment variables

8 years agoupdown: Allow IPIP traffic if IPComp was negotiated
Tobias Brunner [Thu, 7 Nov 2013 16:50:02 +0000 (17:50 +0100)]
updown: Allow IPIP traffic if IPComp was negotiated

The kernel implicitly creates an IPIP SA if an IPComp SA is installed.
This SA is used inbound for small packets that are not compressed.

Since the addresses are different (they are the tunnel addresses not
those of the tunneled traffic) additional rules are required if the
traffic selector does not cover the tunnel addresses (e.g. due to a NAT).

For SAs with multiple traffic selectors duplicate rules will get installed.

8 years agoupdown: Add PLUTO_IPCOMP to indicate if IPComp was negotiated
Tobias Brunner [Thu, 7 Nov 2013 16:48:40 +0000 (17:48 +0100)]
updown: Add PLUTO_IPCOMP to indicate if IPComp was negotiated

8 years agocurl: Replace spaces in URIs with %20
Tobias Brunner [Fri, 22 Nov 2013 09:42:18 +0000 (10:42 +0100)]
curl: Replace spaces in URIs with %20

cURL requires the URIs to be URL-encoded. Apparently, some CAs encode CRL
URIs with spaces in them.

Fixes #454.

8 years agoutils: Add strreplace function
Tobias Brunner [Fri, 22 Nov 2013 09:30:16 +0000 (10:30 +0100)]
utils: Add strreplace function

8 years agostroke: Ensure the buffer of strings in a stroke_msg_t is null-terminated
Tobias Brunner [Fri, 29 Nov 2013 16:42:11 +0000 (17:42 +0100)]
stroke: Ensure the buffer of strings in a stroke_msg_t is null-terminated

Otherwise a malicious user could send an unterminated string to cause
unterminated reads.

8 years agostroke: Add an option to prevent log level changes via stroke socket
Tobias Brunner [Fri, 29 Nov 2013 16:27:23 +0000 (17:27 +0100)]
stroke: Add an option to prevent log level changes via stroke socket

8 years agopki: Make sure no command registers too many options
Tobias Brunner [Wed, 11 Dec 2013 16:38:18 +0000 (17:38 +0100)]
pki: Make sure no command registers too many options

8 years agopki: Increase MAX_COMMANDS to cover all currently available commands
Tobias Brunner [Wed, 11 Dec 2013 16:24:03 +0000 (17:24 +0100)]
pki: Increase MAX_COMMANDS to cover all currently available commands

Fixes #452.

8 years agopki: Print a warning if MAX_COMMANDS is too low
Tobias Brunner [Wed, 11 Dec 2013 16:23:43 +0000 (17:23 +0100)]
pki: Print a warning if MAX_COMMANDS is too low

8 years agopki: Properly use ?: when defining option arrays
Tobias Brunner [Wed, 11 Dec 2013 16:21:06 +0000 (17:21 +0100)]
pki: Properly use ?: when defining option arrays

8 years agoconfigure: Add -Wno-format-security to default CFLAGS
Tobias Brunner [Mon, 25 Nov 2013 17:20:13 +0000 (18:20 +0100)]
configure: Add -Wno-format-security to default CFLAGS

Either due to a change in Ubuntu 13.10 or GCC 4.8 -Wno-format has no
effect if -Wformat-security is enabled (which it is on Ubuntu) so we
also disable the latter by default.

8 years agoagent: Keep CAP_DAC_OVERRIDE to connect to ssh-agent socket
Tobias Brunner [Thu, 21 Nov 2013 16:12:21 +0000 (17:12 +0100)]
agent: Keep CAP_DAC_OVERRIDE to connect to ssh-agent socket

This is also required if charon-cmd is used with capability dropping.

8 years agoike: Simplify error handling if name resolution failed
Tobias Brunner [Mon, 11 Nov 2013 15:17:35 +0000 (16:17 +0100)]
ike: Simplify error handling if name resolution failed

This avoids a second name resolution attempt just to determine if %any
etc. was configured.

Fixes #440.

8 years agoike: Use proper hostname(s) when name resolution failed
Tobias Brunner [Mon, 11 Nov 2013 15:16:03 +0000 (16:16 +0100)]
ike: Use proper hostname(s) when name resolution failed

Was wrong since 0edce687675df8f10f4026fa12a8fc3b3dd003f5.

Fixes #440.

8 years agoikev2: Wipe (optional) shared secret during CHILD_SA key derivation
Tobias Brunner [Wed, 6 Nov 2013 09:30:27 +0000 (10:30 +0100)]
ikev2: Wipe (optional) shared secret during CHILD_SA key derivation

8 years agochecksum must be the last subdir included
Tobias Brunner [Thu, 23 Jan 2014 08:41:35 +0000 (09:41 +0100)]
checksum must be the last subdir included

Otherwise charon-cmd will not yet be installed when the checksums are
calculated (now from the install dir, not the build dir).

Fixes #496.

8 years agounit-tests: Pass a test suite collection name to print during test execution
Martin Willi [Tue, 21 Jan 2014 16:48:08 +0000 (17:48 +0100)]
unit-tests: Pass a test suite collection name to print during test execution

As we except to get more and more test runners for the different components,
we add a name to easily identify them on the test output.

8 years agoarray: Add an array_get() function
Martin Willi [Tue, 21 Jan 2014 12:23:32 +0000 (13:23 +0100)]
array: Add an array_get() function

8 years agowatcher: Don't complain if select() syscall got interrupted
Martin Willi [Wed, 22 Jan 2014 13:25:03 +0000 (14:25 +0100)]
watcher: Don't complain if select() syscall got interrupted

8 years agostream: Make sure no watcher callback is active while changing stream callbacks
Martin Willi [Tue, 21 Jan 2014 16:36:38 +0000 (17:36 +0100)]
stream: Make sure no watcher callback is active while changing stream callbacks

When changing async callbacks on streams, we have to make sure the watcher
callback is not currently active and has temporarily disabled callbacks. This
could have been the case, as we didn't explicitly removed any pending
watcher registration if both callbacks are NULL.

By enforcing the watcher unregistration, we are sure the watcher callback is
not active and currently is not mangling the callback hooks. This should make
sure we avoid any races for the callback variables.

8 years agochecksum: Read executables from DESTDIR
Tobias Brunner [Tue, 21 Jan 2014 13:53:46 +0000 (14:53 +0100)]
checksum: Read executables from DESTDIR

This allows to recreate the checksums after the installed binaries have
been modified e.g. with strip.

Fixes #491.

8 years agoman: Add documentation of the dhcp interface option
Thomas Egerer [Tue, 19 Nov 2013 12:42:54 +0000 (13:42 +0100)]
man: Add documentation of the dhcp interface option

Signed-off-by: Thomas Egerer <>
8 years agodhcp: Allow binding of socket to particular interface
Thomas Egerer [Mon, 18 Nov 2013 12:15:02 +0000 (13:15 +0100)]
dhcp: Allow binding of socket to particular interface

In certain situations it is desirable to bind the send/receive sockets
for the DHCP address allocation to a particular interface. With this
patch the strongswan.conf option charon.plugins.dhcp.interface can be
used to restrict the DHCP communication to a configurable interface.

Signed-off-by: Thomas Egerer <>
8 years agoproposal: Add possibility to register custom proposal keyword parser
Thomas Egerer [Fri, 29 Nov 2013 12:17:30 +0000 (13:17 +0100)]
proposal: Add possibility to register custom proposal keyword parser

If a proposal string cannot be matched to a token using strcmp (e.g. if
you want to register a whole class of algorithms containing their ID,
like my_alg_2342), you can use the provided function to register a
parser that transforms the given string into a proposal token.

Signed-off-by: Thomas Egerer <>
8 years agounit-tests: Add environment variable to reduce the number of generated keys
Tobias Brunner [Mon, 20 Jan 2014 14:35:13 +0000 (15:35 +0100)]
unit-tests: Add environment variable to reduce the number of generated keys

If TESTS_REDUCED_KEYLENGTHS is set RSA and ECDSA keys are only generated
for the lowest configured key length.

Fixes #474.

8 years agounit-tests: Generate RSA key with 768 bits not 786
Tobias Brunner [Mon, 20 Jan 2014 14:27:09 +0000 (15:27 +0100)]
unit-tests: Generate RSA key with 768 bits not 786

8 years agoike_sa: Defer task manager destruction after child destruction
Thomas Egerer [Thu, 16 Jan 2014 12:24:08 +0000 (13:24 +0100)]
ike_sa: Defer task manager destruction after child destruction

This patch exports the task manager's flush to allow flushing of all
queues with one function call from ike_sa->destroy. It allows the
access of intact children during task destructoin (see git-commit
e44ebdcf) and allows the access of the task manager in
child_state_change hook.

Signed-off-by: Thomas Egerer <>
8 years agoVersion bump to 5.1.2rc1
Andreas Steffen [Thu, 16 Jan 2014 00:47:34 +0000 (01:47 +0100)]
Version bump to 5.1.2rc1

8 years agoAdded TPMRA workitem support in PTS database
Andreas Steffen [Thu, 16 Jan 2014 00:46:55 +0000 (01:46 +0100)]
Added TPMRA workitem support in PTS database

8 years agoprintf-hook-builtin: Correctly calculate written bytes in print_in_hook()
Martin Willi [Wed, 15 Jan 2014 17:18:24 +0000 (18:18 +0100)]
printf-hook-builtin: Correctly calculate written bytes in print_in_hook()

The hook data counts remaining buffer bytes, not used ones. Counting them
correctly fixes a crash for long hexdumps.

Further, print_in_hook() must return the number of bytes that would have been
written, not the actually written bytes. This is important, as we allocate a
dynamic buffer in bus that relies on the exact byte count. Fixes long hexdumps
that got truncated.

8 years agoDo PTS measurements only if session initialisation was successful 5.1.2dr3
Andreas Steffen [Wed, 15 Jan 2014 11:06:22 +0000 (12:06 +0100)]
Do PTS measurements only if session initialisation was successful

8 years agoStarting with 3.1.7 replaced bz2 with xz format
Andreas Steffen [Wed, 15 Jan 2014 01:14:08 +0000 (02:14 +0100)]
Starting with 3.1.7  replaced bz2 with xz format

8 years agoVersion bump to 5.1.2dr3
Andreas Steffen [Mon, 13 Jan 2014 11:12:52 +0000 (12:12 +0100)]
Version bump to 5.1.2dr3

8 years agoCatch AIK errors
Andreas Steffen [Mon, 13 Jan 2014 07:19:10 +0000 (08:19 +0100)]
Catch AIK errors

8 years agoDo TPM measurements only if there is a TPMRA workitem
Andreas Steffen [Fri, 10 Jan 2014 10:53:50 +0000 (11:53 +0100)]
Do TPM measurements only if there is a TPMRA workitem

8 years agoAllow reason strings to be used as workitem result string
Andreas Steffen [Tue, 31 Dec 2013 12:13:32 +0000 (13:13 +0100)]
Allow reason strings to be used as workitem result string

8 years agoAttestation IMV processes TPMRA workitem
Andreas Steffen [Thu, 26 Dec 2013 16:39:05 +0000 (17:39 +0100)]
Attestation IMV processes TPMRA workitem

8 years agoAdded TPM Remote Attestation (TPMRA) workitem
Andreas Steffen [Thu, 26 Dec 2013 10:28:51 +0000 (11:28 +0100)]
Added TPM Remote Attestation (TPMRA) workitem

8 years agochecksum: Set rpath including DESTDIR for checksum_builder
Tobias Brunner [Wed, 8 Jan 2014 10:24:24 +0000 (11:24 +0100)]
checksum: Set rpath including DESTDIR for checksum_builder

This way libraries to which checksum_builder does not itself link,
like libtls and libradius, are found during DESTDIR installs.

Fixes #476.

8 years agotest-asn1: Fix skipping of >2038 tests on i386
Tobias Brunner [Mon, 6 Jan 2014 17:01:06 +0000 (18:01 +0100)]
test-asn1: Fix skipping of >2038 tests on i386

The two constants overflow time_t on i386 (they also produced a compiler
warning without type suffix) so the comparison with TIME_32_BIT_SIGNED_MAX
did not work as intended.

Fixes #477.

8 years agochunk: Fix chunk_mac/hash tests on big-endian systems
Tobias Brunner [Mon, 6 Jan 2014 16:31:07 +0000 (17:31 +0100)]
chunk: Fix chunk_mac/hash tests on big-endian systems

Our SipHash-2-4 implementation returns the result in host order, while
the test vectors are little-endian.  Use a custom comparison function to
account for this.

Fixes #478.

8 years agoutils: Fix %T printf hook on big-endian systems
Tobias Brunner [Mon, 6 Jan 2014 14:30:02 +0000 (15:30 +0100)]
utils: Fix %T printf hook on big-endian systems

The cast to a bool* cut of the actual value on big-endian systems
if bool was shorter than int because the bool argument to printf gets
promoted to an int.

Fixes #479.

8 years agochecksum: Delay building of checksum_builder until required by make install
Tobias Brunner [Mon, 6 Jan 2014 13:17:20 +0000 (14:17 +0100)]
checksum: Delay building of checksum_builder until required by make install

This ensures PLUGINDIR includes any DESTDIR set during make install.

8 years agochecksum: Remove unnecessary pluto symbol
Tobias Brunner [Mon, 6 Jan 2014 12:37:12 +0000 (13:37 +0100)]
checksum: Remove unnecessary pluto symbol

8 years agostroke: Fix error message if parsing leftsourceip fails
Tobias Brunner [Mon, 6 Jan 2014 11:55:10 +0000 (12:55 +0100)]
stroke: Fix error message if parsing leftsourceip fails

8 years agoUpdate PCR even if measurement does not equal reference value
Andreas Steffen [Fri, 20 Dec 2013 23:39:40 +0000 (00:39 +0100)]
Update PCR even if measurement does not equal reference value

8 years agotun-device: Include system headers before our own
Tobias Brunner [Fri, 20 Dec 2013 10:24:02 +0000 (11:24 +0100)]
tun-device: Include system headers before our own

On CentOS 6.5 the sys/capability.h header file defines _LINUX_TYPES_H
without actually including that header, preventing its later inclusion

As library.h (via which the capabilities headers are included) is not
actually required in tun_device.[ch], moving the inclusion of tun_device.h
would not strictly be necessary.  But it's probably a good idea to
include our own headers after system headers anyway, for if one of the
recursively included files at a later point includes library.h we'd have
the same problem again.

8 years agoaes-test: Fix compiler warnings from older versions of GCC
Tobias Brunner [Thu, 19 Dec 2013 10:02:23 +0000 (11:02 +0100)]
aes-test: Fix compiler warnings from older versions of GCC

8 years agoFixed check_file_measurement method in pts_database_t
Andreas Steffen [Fri, 13 Dec 2013 13:37:31 +0000 (14:37 +0100)]
Fixed check_file_measurement method in pts_database_t

8 years agounit-tests: NTRU test to check a special branch
Andreas Steffen [Sun, 8 Dec 2013 09:18:33 +0000 (10:18 +0100)]
unit-tests: NTRU test to check a special branch

8 years agomin_MGF_hash_calls parameter is not needed anymore
Andreas Steffen [Sat, 7 Dec 2013 22:54:53 +0000 (23:54 +0100)]
min_MGF_hash_calls parameter is not needed anymore

8 years agoOptimized MGF1 implementation
Andreas Steffen [Sat, 7 Dec 2013 22:29:04 +0000 (23:29 +0100)]
Optimized MGF1 implementation

8 years agoImplemented ntru_trits class
Andreas Steffen [Sat, 7 Dec 2013 22:27:59 +0000 (23:27 +0100)]
Implemented ntru_trits class