diff -Nru libfvde-20170930/AUTHORS libfvde-20180108/AUTHORS --- libfvde-20170930/AUTHORS 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/AUTHORS 2018-01-08 17:42:46.000000000 +0000 @@ -1,5 +1,5 @@ Acknowledgements: libfvde -Copyright (C) 2011-2017, Omar Choudary +Copyright (C) 2011-2018, Omar Choudary Joachim Metz diff -Nru libfvde-20170930/common/byte_stream.h libfvde-20180108/common/byte_stream.h --- libfvde-20170930/common/byte_stream.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/common/byte_stream.h 2018-01-08 17:42:46.000000000 +0000 @@ -1,7 +1,7 @@ /* * Byte stream functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/common/common.h libfvde-20180108/common/common.h --- libfvde-20170930/common/common.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/common/common.h 2018-01-08 17:42:46.000000000 +0000 @@ -1,7 +1,7 @@ /* * Common include file * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/common/config_borlandc.h libfvde-20180108/common/config_borlandc.h --- libfvde-20170930/common/config_borlandc.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/common/config_borlandc.h 2018-01-08 17:42:46.000000000 +0000 @@ -1,7 +1,7 @@ /* * Configuration for the Borland/CodeGear C++ Builder compiler * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/common/config.h libfvde-20180108/common/config.h --- libfvde-20170930/common/config.h 2017-10-04 19:28:35.000000000 +0000 +++ libfvde-20180108/common/config.h 2018-01-08 20:19:52.000000000 +0000 @@ -617,7 +617,7 @@ #define PACKAGE_NAME "libfvde" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libfvde 20170930" +#define PACKAGE_STRING "libfvde 20180108" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "libfvde" @@ -626,7 +626,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "20170930" +#define PACKAGE_VERSION "20180108" /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 @@ -653,7 +653,7 @@ /* #undef TM_IN_SYS_TIME */ /* Version number of package */ -#define VERSION "20170930" +#define VERSION "20180108" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ diff -Nru libfvde-20170930/common/config_msc.h libfvde-20180108/common/config_msc.h --- libfvde-20170930/common/config_msc.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/common/config_msc.h 2018-01-08 17:42:46.000000000 +0000 @@ -1,7 +1,7 @@ /* * Configuration for the Microsoft Visual Studio C++ compiler * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/common/config_winapi.h libfvde-20180108/common/config_winapi.h --- libfvde-20170930/common/config_winapi.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/common/config_winapi.h 2018-01-08 17:42:46.000000000 +0000 @@ -1,7 +1,7 @@ /* * Configuration file for WINAPI * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/common/file_stream.h libfvde-20180108/common/file_stream.h --- libfvde-20170930/common/file_stream.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/common/file_stream.h 2018-01-08 17:42:46.000000000 +0000 @@ -1,7 +1,7 @@ /* * FILE stream functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/common/Makefile.in libfvde-20180108/common/Makefile.in --- libfvde-20170930/common/Makefile.in 2017-10-04 19:28:14.000000000 +0000 +++ libfvde-20180108/common/Makefile.in 2018-01-08 20:19:37.000000000 +0000 @@ -452,6 +452,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/common/memory.h libfvde-20180108/common/memory.h --- libfvde-20170930/common/memory.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/common/memory.h 2018-01-08 17:42:46.000000000 +0000 @@ -1,7 +1,7 @@ /* * Memory functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * @@ -88,7 +88,7 @@ #elif defined( WINAPI ) #define memory_free( buffer ) \ - HeapFree( GetProcessHeap(), 0, (LPVOID) buffer ) + ( buffer == NULL ) ? TRUE : HeapFree( GetProcessHeap(), 0, (LPVOID) buffer ) #elif defined( HAVE_FREE ) #define memory_free( buffer ) \ diff -Nru libfvde-20170930/common/narrow_string.h libfvde-20180108/common/narrow_string.h --- libfvde-20170930/common/narrow_string.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/common/narrow_string.h 2018-01-08 17:42:46.000000000 +0000 @@ -1,7 +1,7 @@ /* * Narrow character string functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/common/system_string.h libfvde-20180108/common/system_string.h --- libfvde-20170930/common/system_string.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/common/system_string.h 2018-01-08 17:42:46.000000000 +0000 @@ -1,7 +1,7 @@ /* * System character string functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/common/types.h libfvde-20180108/common/types.h --- libfvde-20170930/common/types.h 2017-10-04 19:28:35.000000000 +0000 +++ libfvde-20180108/common/types.h 2018-01-08 20:19:52.000000000 +0000 @@ -1,7 +1,7 @@ /* * Type and type-support defintions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/common/types.h.in libfvde-20180108/common/types.h.in --- libfvde-20170930/common/types.h.in 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/common/types.h.in 2018-01-08 17:42:46.000000000 +0000 @@ -1,7 +1,7 @@ /* * Type and type-support defintions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/common/wide_string.h libfvde-20180108/common/wide_string.h --- libfvde-20170930/common/wide_string.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/common/wide_string.h 2018-01-08 17:42:46.000000000 +0000 @@ -1,7 +1,7 @@ /* * Wide character string functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/configure libfvde-20180108/configure --- libfvde-20170930/configure 2017-10-04 19:28:12.000000000 +0000 +++ libfvde-20180108/configure 2018-01-08 20:19:35.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libfvde 20170930. +# Generated by GNU Autoconf 2.69 for libfvde 20180108. # # Report bugs to . # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='libfvde' PACKAGE_TARNAME='libfvde' -PACKAGE_VERSION='20170930' -PACKAGE_STRING='libfvde 20170930' +PACKAGE_VERSION='20180108' +PACKAGE_STRING='libfvde 20180108' PACKAGE_BUGREPORT='joachim.metz@gmail.com' PACKAGE_URL='' @@ -731,6 +731,7 @@ HAVE_WINCRYPT_TRUE LIBCRYPTO_LIBADD ax_zlib_static_spec_build_requires +ax_zlib_static_spec_requires ax_zlib_spec_build_requires ax_zlib_spec_requires ax_zlib_pc_libs_private @@ -1710,7 +1711,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libfvde 20170930 to adapt to many kinds of systems. +\`configure' configures libfvde 20180108 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1780,7 +1781,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libfvde 20170930:";; + short | recursive ) echo "Configuration of libfvde 20180108:";; esac cat <<\_ACEOF @@ -2074,7 +2075,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libfvde configure 20170930 +libfvde configure 20180108 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2726,7 +2727,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libfvde $as_me 20170930, which was +It was created by libfvde $as_me 20180108, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3593,7 +3594,7 @@ # Define the identity of the package. PACKAGE='libfvde' - VERSION='20170930' + VERSION='20180108' cat >>confdefs.h <<_ACEOF @@ -44969,10 +44970,10 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_zlib" >&5 $as_echo "$ac_cv_with_zlib" >&6; } - if test "x$ac_cv_with_zlib" != x && test "x$ac_cv_with_zlib" != xno && test "x$ac_cv_with_zlib" != xauto-detect; then : + if test "x$ac_cv_with_zlib" != x && test "x$ac_cv_with_zlib" != xno && test "x$ac_cv_with_zlib" != xauto-detect; then : if test -d "$ac_cv_with_zlib"; then : CFLAGS="$CFLAGS -I${ac_cv_with_zlib}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_zlib}/lib" + LDFLAGS="$LDFLAGS -L${ac_cv_with_zlib}/lib" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no such directory: $ac_cv_with_zlib" >&5 $as_echo "$as_me: WARNING: no such directory: $ac_cv_with_zlib" >&2;} @@ -44981,10 +44982,10 @@ fi - if test "x$ac_cv_with_zlib" = xno; then : + if test "x$ac_cv_with_zlib" = xno; then : ac_cv_zlib=no else - if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : + if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib" >&5 @@ -45059,11 +45060,11 @@ fi - if test "x$ac_cv_zlib" = xzlib; then : + if test "x$ac_cv_zlib" = xzlib; then : ac_cv_zlib_CPPFLAGS="$pkg_cv_zlib_CFLAGS" - ac_cv_zlib_LIBADD="$pkg_cv_zlib_LIBS" + ac_cv_zlib_LIBADD="$pkg_cv_zlib_LIBS" else - for ac_header in zlib.h + for ac_header in zlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes; then : @@ -45076,12 +45077,12 @@ done - if test "x$ac_cv_header_zlib_h" = xno; then : + if test "x$ac_cv_header_zlib_h" = xno; then : ac_cv_zlib=no else - ac_cv_zlib=zlib + ac_cv_zlib=zlib - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlibVersion in -lz" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlibVersion in -lz" >&5 $as_echo_n "checking for zlibVersion in -lz... " >&6; } if ${ac_cv_lib_z_zlibVersion+:} false; then : $as_echo_n "(cached) " >&6 @@ -45129,7 +45130,7 @@ fi - if test "x$ac_cv_lib_z_zlibVersion" = xno; then : + if test "x$ac_cv_lib_z_zlibVersion" = xno; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 1 "Missing function: zlibVersion in library: zlib. @@ -45137,7 +45138,7 @@ fi - ac_cv_zlib_LIBADD="-lz"; + ac_cv_zlib_LIBADD="-lz"; fi @@ -45145,14 +45146,14 @@ fi - if test "x$ac_cv_zlib" = xzlib; then : + if test "x$ac_cv_zlib" = xzlib; then : $as_echo "#define HAVE_ZLIB 1" >>confdefs.h fi - if test "x$ac_cv_zlib" != xno; then : + if test "x$ac_cv_zlib" != xno; then : HAVE_ZLIB=1 else @@ -45162,29 +45163,31 @@ fi - if test "x$ac_cv_zlib_CPPFLAGS" != "x"; then : + if test "x$ac_cv_zlib_CPPFLAGS" != "x"; then : ZLIB_CPPFLAGS=$ac_cv_zlib_CPPFLAGS fi - if test "x$ac_cv_zlib_LIBADD" != "x"; then : + if test "x$ac_cv_zlib_LIBADD" != "x"; then : ZLIB_LIBADD=$ac_cv_zlib_LIBADD fi - if test "x$ac_cv_zlib" = xzlib; then : + if test "x$ac_cv_zlib" = xzlib; then : ax_zlib_pc_libs_private=-lz fi - if test "x$ac_cv_zlib" = xzlib; then : + if test "x$ac_cv_zlib" = xzlib; then : ax_zlib_spec_requires=zlib - ax_zlib_spec_build_requires=zlib-devel + ax_zlib_spec_build_requires=zlib-devel + + ax_zlib_static_spec_requires=zlib-static - ax_zlib_static_spec_build_requires=zlib-static + ax_zlib_static_spec_build_requires=zlib-static fi @@ -45235,7 +45238,7 @@ fi - if test "x$ac_cv_uncompress" = xzlib; then : + if test "x$ac_cv_uncompress" = xzlib; then : $as_echo "#define HAVE_ZLIB_UNCOMPRESS 1" >>confdefs.h @@ -51863,10 +51866,10 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_with_libfuse" >&5 $as_echo "$ac_cv_with_libfuse" >&6; } - if test "x$ac_cv_with_libfuse" != x && test "x$ac_cv_with_libfuse" != xno && test "x$ac_cv_with_libfuse" != xauto-detect; then : + if test "x$ac_cv_with_libfuse" != x && test "x$ac_cv_with_libfuse" != xno && test "x$ac_cv_with_libfuse" != xauto-detect; then : if test -d "$ac_cv_with_libfuse"; then : CFLAGS="$CFLAGS -I${ac_cv_with_libfuse}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libfuse}/lib" + LDFLAGS="$LDFLAGS -L${ac_cv_with_libfuse}/lib" else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no such directory: $ac_cv_with_libfuse" >&5 $as_echo "$as_me: WARNING: no such directory: $ac_cv_with_libfuse" >&2;} @@ -51875,10 +51878,10 @@ fi - if test "x$ac_cv_with_libfuse" = xno; then : + if test "x$ac_cv_with_libfuse" = xno; then : ac_cv_libfuse=no else - if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : + if test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse" >&5 @@ -51953,11 +51956,11 @@ fi - if test "x$ac_cv_libfuse" = xlibfuse; then : + if test "x$ac_cv_libfuse" = xlibfuse; then : ac_cv_libfuse_CPPFLAGS="$pkg_cv_fuse_CFLAGS" - ac_cv_libfuse_LIBADD="$pkg_cv_fuse_LIBS" + ac_cv_libfuse_LIBADD="$pkg_cv_fuse_LIBS" else - for ac_header in fuse.h + for ac_header in fuse.h do : ac_fn_c_check_header_mongrel "$LINENO" "fuse.h" "ac_cv_header_fuse_h" "$ac_includes_default" if test "x$ac_cv_header_fuse_h" = xyes; then : @@ -51972,10 +51975,10 @@ done - if test "x$ac_cv_header_fuse_h" = xno; then : + if test "x$ac_cv_header_fuse_h" = xno; then : { ac_cv_header_fuse_h=; unset ac_cv_header_fuse_h;} - CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" - for ac_header in fuse.h + CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" + for ac_header in fuse.h do : ac_fn_c_check_header_mongrel "$LINENO" "fuse.h" "ac_cv_header_fuse_h" "$ac_includes_default" if test "x$ac_cv_header_fuse_h" = xyes; then : @@ -51990,12 +51993,12 @@ fi - if test "x$ac_cv_header_fuse_h" = xno; then : + if test "x$ac_cv_header_fuse_h" = xno; then : ac_cv_libfuse=no else - ac_cv_libfuse=libfuse + ac_cv_libfuse=libfuse - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_daemonize in -lfuse" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_daemonize in -lfuse" >&5 $as_echo_n "checking for fuse_daemonize in -lfuse... " >&6; } if ${ac_cv_lib_fuse_fuse_daemonize+:} false; then : $as_echo_n "(cached) " >&6 @@ -52037,7 +52040,7 @@ ac_cv_libfuse=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_destroy in -lfuse" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_destroy in -lfuse" >&5 $as_echo_n "checking for fuse_destroy in -lfuse... " >&6; } if ${ac_cv_lib_fuse_fuse_destroy+:} false; then : $as_echo_n "(cached) " >&6 @@ -52079,7 +52082,7 @@ ac_cv_libfuse=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_mount in -lfuse" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_mount in -lfuse" >&5 $as_echo_n "checking for fuse_mount in -lfuse... " >&6; } if ${ac_cv_lib_fuse_fuse_mount+:} false; then : $as_echo_n "(cached) " >&6 @@ -52121,7 +52124,7 @@ ac_cv_libfuse=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_new in -lfuse" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_new in -lfuse" >&5 $as_echo_n "checking for fuse_new in -lfuse... " >&6; } if ${ac_cv_lib_fuse_fuse_new+:} false; then : $as_echo_n "(cached) " >&6 @@ -52164,15 +52167,15 @@ fi - ac_cv_libfuse_LIBADD="-lfuse"; + ac_cv_libfuse_LIBADD="-lfuse"; fi fi - if test "x$ac_cv_with_libfuse" != xno && test "x$ac_cv_header_fuse_h" = xno; then : + if test "x$ac_cv_with_libfuse" != xno && test "x$ac_cv_header_fuse_h" = xno; then : CPPFLAGS="$CPPFLAGS -DFUSE_USE_VERSION=26" - for ac_header in osxfuse/fuse.h + for ac_header in osxfuse/fuse.h do : ac_fn_c_check_header_mongrel "$LINENO" "osxfuse/fuse.h" "ac_cv_header_osxfuse_fuse_h" "$ac_includes_default" if test "x$ac_cv_header_osxfuse_fuse_h" = xyes; then : @@ -52185,10 +52188,10 @@ done - if test "x$ac_cv_header_osxfuse_fuse_h" = xno; then : + if test "x$ac_cv_header_osxfuse_fuse_h" = xno; then : { ac_cv_header_osxfuse_fuse_h=; unset ac_cv_header_osxfuse_fuse_h;} - CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" - for ac_header in osxfuse/fuse.h + CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" + for ac_header in osxfuse/fuse.h do : ac_fn_c_check_header_mongrel "$LINENO" "osxfuse/fuse.h" "ac_cv_header_osxfuse_fuse_h" "$ac_includes_default" if test "x$ac_cv_header_osxfuse_fuse_h" = xyes; then : @@ -52203,12 +52206,12 @@ fi - if test "x$ac_cv_header_osxfuse_fuse_h" = xno; then : + if test "x$ac_cv_header_osxfuse_fuse_h" = xno; then : ac_cv_libfuse=no else - ac_cv_libfuse=libosxfuse + ac_cv_libfuse=libosxfuse - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_daemonize in -losxfuse" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_daemonize in -losxfuse" >&5 $as_echo_n "checking for fuse_daemonize in -losxfuse... " >&6; } if ${ac_cv_lib_osxfuse_fuse_daemonize+:} false; then : $as_echo_n "(cached) " >&6 @@ -52250,7 +52253,7 @@ ac_cv_libfuse=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_destroy in -losxfuse" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_destroy in -losxfuse" >&5 $as_echo_n "checking for fuse_destroy in -losxfuse... " >&6; } if ${ac_cv_lib_osxfuse_fuse_destroy+:} false; then : $as_echo_n "(cached) " >&6 @@ -52292,7 +52295,7 @@ ac_cv_libfuse=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_mount in -losxfuse" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_mount in -losxfuse" >&5 $as_echo_n "checking for fuse_mount in -losxfuse... " >&6; } if ${ac_cv_lib_osxfuse_fuse_mount+:} false; then : $as_echo_n "(cached) " >&6 @@ -52334,7 +52337,7 @@ ac_cv_libfuse=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_new in -losxfuse" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_new in -losxfuse" >&5 $as_echo_n "checking for fuse_new in -losxfuse... " >&6; } if ${ac_cv_lib_osxfuse_fuse_new+:} false; then : $as_echo_n "(cached) " >&6 @@ -52377,7 +52380,7 @@ fi - ac_cv_libfuse_LIBADD="-losxfuse"; + ac_cv_libfuse_LIBADD="-losxfuse"; fi @@ -52385,20 +52388,20 @@ fi - if test "x$ac_cv_libfuse" = xlibfuse; then : + if test "x$ac_cv_libfuse" = xlibfuse; then : $as_echo "#define HAVE_LIBFUSE 1" >>confdefs.h fi - if test "x$ac_cv_libfuse" = xlibosxfuse; then : + if test "x$ac_cv_libfuse" = xlibosxfuse; then : $as_echo "#define HAVE_LIBOSXFUSE 1" >>confdefs.h fi - if test "x$ac_cv_libfuse" != xno; then : + if test "x$ac_cv_libfuse" != xno; then : HAVE_LIBFUSE=1 else @@ -52408,32 +52411,32 @@ fi - if test "x$ac_cv_libfuse_CPPFLAGS" != "x"; then : + if test "x$ac_cv_libfuse_CPPFLAGS" != "x"; then : LIBFUSE_CPPFLAGS=$ac_cv_libfuse_CPPFLAGS fi - if test "x$ac_cv_libfuse_LIBADD" != "x"; then : + if test "x$ac_cv_libfuse_LIBADD" != "x"; then : LIBFUSE_LIBADD=$ac_cv_libfuse_LIBADD fi - if test "x$ac_cv_libfuse" = xlibfuse; then : + if test "x$ac_cv_libfuse" = xlibfuse; then : ax_libfuse_pc_libs_private=-lfuse fi - if test "x$ac_cv_libfuse" = xlibosxfuse; then : + if test "x$ac_cv_libfuse" = xlibosxfuse; then : ax_libfuse_pc_libs_private=-losxfuse fi - if test "x$ac_cv_libfuse" = xlibfuse; then : + if test "x$ac_cv_libfuse" = xlibfuse; then : ax_libfuse_spec_requires=fuse-libs - ax_libfuse_spec_build_requires=fuse-devel + ax_libfuse_spec_build_requires=fuse-devel fi @@ -53461,7 +53464,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libfvde $as_me 20170930, which was +This file was extended by libfvde $as_me 20180108, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -53527,7 +53530,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libfvde config.status 20170930 +libfvde config.status 20180108 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru libfvde-20170930/configure.ac libfvde-20180108/configure.ac --- libfvde-20170930/configure.ac 2017-09-30 13:39:35.000000000 +0000 +++ libfvde-20180108/configure.ac 2018-01-08 17:42:46.000000000 +0000 @@ -2,7 +2,7 @@ AC_INIT( [libfvde], - [20170930], + [20180108], [joachim.metz@gmail.com]) AC_CONFIG_SRCDIR( @@ -99,7 +99,7 @@ dnl Check if libfvalue or required headers and functions are available AX_LIBFVALUE_CHECK_ENABLE -dnl Check for zlib compression support +dnl Check if zlib or required headers and functions are available AX_ZLIB_CHECK_ENABLE AX_ZLIB_CHECK_UNCOMPRESS diff -Nru libfvde-20170930/debian/changelog libfvde-20180108/debian/changelog --- libfvde-20170930/debian/changelog 2017-10-18 20:39:39.000000000 +0000 +++ libfvde-20180108/debian/changelog 2018-01-10 21:44:16.000000000 +0000 @@ -1,3 +1,9 @@ +libfvde (20180108-1) unstable; urgency=medium + + * New upstream version 20180108 + + -- Hilko Bengen Wed, 10 Jan 2018 22:44:16 +0100 + libfvde (20170930-1) unstable; urgency=medium * New upstream version 20170930 diff -Nru libfvde-20170930/dpkg/changelog libfvde-20180108/dpkg/changelog --- libfvde-20170930/dpkg/changelog 2017-10-04 19:28:35.000000000 +0000 +++ libfvde-20180108/dpkg/changelog 2018-01-08 20:19:52.000000000 +0000 @@ -1,5 +1,5 @@ -libfvde (20170930-1) unstable; urgency=low +libfvde (20180108-1) unstable; urgency=low * Auto-generated - -- Joachim Metz Wed, 04 Oct 2017 21:28:33 +0200 + -- Joachim Metz Mon, 08 Jan 2018 21:19:51 +0100 diff -Nru libfvde-20170930/dpkg/copyright libfvde-20180108/dpkg/copyright --- libfvde-20170930/dpkg/copyright 2017-09-30 13:37:15.000000000 +0000 +++ libfvde-20180108/dpkg/copyright 2018-01-08 17:42:47.000000000 +0000 @@ -3,7 +3,7 @@ Source: https://github.com/libyal/libfvde Files: * -Copyright: 2011-2017, Joachim Metz +Copyright: 2011-2018, Joachim Metz License: LGPL-3.0+ License: LGPL-3.0+ diff -Nru libfvde-20170930/fvdetools/fvdeinfo.c libfvde-20180108/fvdetools/fvdeinfo.c --- libfvde-20170930/fvdetools/fvdeinfo.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/fvdeinfo.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Shows information obtained from a FileVault Drive Encryption (FVDE) encrypted volume * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/fvdetools/fvdemount.c libfvde-20180108/fvdetools/fvdemount.c --- libfvde-20170930/fvdetools/fvdemount.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/fvdemount.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Mounts a MacOS-X FileVault Drive Encryption (FVDE) encrypted volume * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/fvdetools/fvdetools_getopt.c libfvde-20180108/fvdetools/fvdetools_getopt.c --- libfvde-20170930/fvdetools/fvdetools_getopt.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/fvdetools_getopt.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * GetOpt functions * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/fvdetools/fvdetools_getopt.h libfvde-20180108/fvdetools/fvdetools_getopt.h --- libfvde-20170930/fvdetools/fvdetools_getopt.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/fvdetools_getopt.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * GetOpt functions * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/fvdetools/fvdetools_i18n.h libfvde-20180108/fvdetools/fvdetools_i18n.h --- libfvde-20170930/fvdetools/fvdetools_i18n.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/fvdetools_i18n.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Internationalization (i18n) functions * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/fvdetools/fvdetools_libbfio.h libfvde-20180108/fvdetools/fvdetools_libbfio.h --- libfvde-20170930/fvdetools/fvdetools_libbfio.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/fvdetools_libbfio.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The libbfio header wrapper * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/fvdetools/fvdetools_libcerror.h libfvde-20180108/fvdetools/fvdetools_libcerror.h --- libfvde-20170930/fvdetools/fvdetools_libcerror.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/fvdetools_libcerror.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libcerror header * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/fvdetools/fvdetools_libclocale.h libfvde-20180108/fvdetools/fvdetools_libclocale.h --- libfvde-20170930/fvdetools/fvdetools_libclocale.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/fvdetools_libclocale.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libclocale header * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/fvdetools/fvdetools_libcnotify.h libfvde-20180108/fvdetools/fvdetools_libcnotify.h --- libfvde-20170930/fvdetools/fvdetools_libcnotify.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/fvdetools_libcnotify.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libcnotify header * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/fvdetools/fvdetools_libcsplit.h libfvde-20180108/fvdetools/fvdetools_libcsplit.h --- libfvde-20170930/fvdetools/fvdetools_libcsplit.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/fvdetools_libcsplit.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libcsplit header * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/fvdetools/fvdetools_libfguid.h libfvde-20180108/fvdetools/fvdetools_libfguid.h --- libfvde-20170930/fvdetools/fvdetools_libfguid.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/fvdetools_libfguid.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The libfguid header wrapper * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/fvdetools/fvdetools_libfvde.h libfvde-20180108/fvdetools/fvdetools_libfvde.h --- libfvde-20170930/fvdetools/fvdetools_libfvde.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/fvdetools_libfvde.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libfvde header * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/fvdetools/fvdetools_libuna.h libfvde-20180108/fvdetools/fvdetools_libuna.h --- libfvde-20170930/fvdetools/fvdetools_libuna.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/fvdetools_libuna.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The libuna header wrapper * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/fvdetools/fvdetools_output.c libfvde-20180108/fvdetools/fvdetools_output.c --- libfvde-20170930/fvdetools/fvdetools_output.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/fvdetools_output.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Common output functions for the fvdetools * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. @@ -105,7 +105,7 @@ */ fprintf( stream, - _( "Copyright (C) 2011-2017, %s.\n" ), + _( "Copyright (C) 2011-2018, %s.\n" ), _( "Omar Choudary, Joachim Metz" ) ); fprintf( diff -Nru libfvde-20170930/fvdetools/fvdetools_output.h libfvde-20180108/fvdetools/fvdetools_output.h --- libfvde-20170930/fvdetools/fvdetools_output.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/fvdetools_output.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Common output functions for the fvdetools * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/fvdetools/fvdetools_signal.c libfvde-20180108/fvdetools/fvdetools_signal.c --- libfvde-20170930/fvdetools/fvdetools_signal.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/fvdetools_signal.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Signal handling functions * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/fvdetools/fvdetools_signal.h libfvde-20180108/fvdetools/fvdetools_signal.h --- libfvde-20170930/fvdetools/fvdetools_signal.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/fvdetools_signal.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Signal handling functions * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/fvdetools/fvdetools_unused.h libfvde-20180108/fvdetools/fvdetools_unused.h --- libfvde-20170930/fvdetools/fvdetools_unused.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/fvdetools_unused.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The unused definition * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/fvdetools/fvdewipekey.c libfvde-20180108/fvdetools/fvdewipekey.c --- libfvde-20170930/fvdetools/fvdewipekey.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/fvdewipekey.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Decrypts a EncryptedRoot.plist.wipekey file * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/fvdetools/info_handle.c libfvde-20180108/fvdetools/info_handle.c --- libfvde-20170930/fvdetools/info_handle.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/info_handle.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Info handle * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/fvdetools/info_handle.h libfvde-20180108/fvdetools/info_handle.h --- libfvde-20170930/fvdetools/info_handle.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/info_handle.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Info handle * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/fvdetools/Makefile.in libfvde-20180108/fvdetools/Makefile.in --- libfvde-20170930/fvdetools/Makefile.in 2017-10-04 19:28:14.000000000 +0000 +++ libfvde-20180108/fvdetools/Makefile.in 2018-01-08 20:19:37.000000000 +0000 @@ -498,6 +498,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/fvdetools/mount_handle.c libfvde-20180108/fvdetools/mount_handle.c --- libfvde-20170930/fvdetools/mount_handle.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/mount_handle.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Mount handle * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/fvdetools/mount_handle.h libfvde-20180108/fvdetools/mount_handle.h --- libfvde-20170930/fvdetools/mount_handle.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/mount_handle.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Mount handle * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/fvdetools/wipekey_handle.c libfvde-20180108/fvdetools/wipekey_handle.c --- libfvde-20170930/fvdetools/wipekey_handle.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/wipekey_handle.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Wipekey handle * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/fvdetools/wipekey_handle.h libfvde-20180108/fvdetools/wipekey_handle.h --- libfvde-20170930/fvdetools/wipekey_handle.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/fvdetools/wipekey_handle.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Wipekey handle * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/include/libfvde/codepage.h libfvde-20180108/include/libfvde/codepage.h --- libfvde-20170930/include/libfvde/codepage.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/include/libfvde/codepage.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Codepage definitions for libfvde * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/include/libfvde/definitions.h libfvde-20180108/include/libfvde/definitions.h --- libfvde-20170930/include/libfvde/definitions.h 2017-10-04 19:28:34.000000000 +0000 +++ libfvde-20180108/include/libfvde/definitions.h 2018-01-08 20:19:52.000000000 +0000 @@ -1,7 +1,7 @@ /* * Definitions for libfvde * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. @@ -25,11 +25,11 @@ #include -#define LIBFVDE_VERSION 20170930 +#define LIBFVDE_VERSION 20180108 /* The version string */ -#define LIBFVDE_VERSION_STRING "20170930" +#define LIBFVDE_VERSION_STRING "20180108" /* The file access * bit 1 set to 1 for read access diff -Nru libfvde-20170930/include/libfvde/definitions.h.in libfvde-20180108/include/libfvde/definitions.h.in --- libfvde-20170930/include/libfvde/definitions.h.in 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/include/libfvde/definitions.h.in 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Definitions for libfvde * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/include/libfvde/error.h libfvde-20180108/include/libfvde/error.h --- libfvde-20170930/include/libfvde/error.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/include/libfvde/error.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The error code definitions for libfvde * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/include/libfvde/extern.h libfvde-20180108/include/libfvde/extern.h --- libfvde-20170930/include/libfvde/extern.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/include/libfvde/extern.h 2018-01-08 17:42:47.000000000 +0000 @@ -4,7 +4,7 @@ * This header should be included in header files that export or import * library functions * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/include/libfvde/features.h libfvde-20180108/include/libfvde/features.h --- libfvde-20170930/include/libfvde/features.h 2017-10-04 19:28:34.000000000 +0000 +++ libfvde-20180108/include/libfvde/features.h 2018-01-08 20:19:52.000000000 +0000 @@ -1,7 +1,7 @@ /* * Features of libfvde * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/include/libfvde/features.h.in libfvde-20180108/include/libfvde/features.h.in --- libfvde-20170930/include/libfvde/features.h.in 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/include/libfvde/features.h.in 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Features of libfvde * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/include/libfvde/types.h libfvde-20180108/include/libfvde/types.h --- libfvde-20170930/include/libfvde/types.h 2017-10-04 19:28:34.000000000 +0000 +++ libfvde-20180108/include/libfvde/types.h 2018-01-08 20:19:52.000000000 +0000 @@ -1,7 +1,7 @@ /* * Type definitions for libfvde * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/include/libfvde/types.h.in libfvde-20180108/include/libfvde/types.h.in --- libfvde-20170930/include/libfvde/types.h.in 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/include/libfvde/types.h.in 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Type definitions for libfvde * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/include/libfvde.h libfvde-20180108/include/libfvde.h --- libfvde-20170930/include/libfvde.h 2017-10-04 19:28:34.000000000 +0000 +++ libfvde-20180108/include/libfvde.h 2018-01-08 20:19:52.000000000 +0000 @@ -1,7 +1,7 @@ /* * Library to access the FileVault Drive Encryption (FVDE) format * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/include/libfvde.h.in libfvde-20180108/include/libfvde.h.in --- libfvde-20170930/include/libfvde.h.in 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/include/libfvde.h.in 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Library to access the FileVault Drive Encryption (FVDE) format * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/include/Makefile.in libfvde-20180108/include/Makefile.in --- libfvde-20170930/include/Makefile.in 2017-10-04 19:28:14.000000000 +0000 +++ libfvde-20180108/include/Makefile.in 2018-01-08 20:19:37.000000000 +0000 @@ -482,6 +482,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/libbfio/libbfio_definitions.h libfvde-20180108/libbfio/libbfio_definitions.h --- libfvde-20170930/libbfio/libbfio_definitions.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libbfio/libbfio_definitions.h 2018-01-08 20:18:35.000000000 +0000 @@ -33,11 +33,11 @@ * for local use of libbfio */ #else -#define LIBBFIO_VERSION 20170920 +#define LIBBFIO_VERSION 20170123 /* The libbfio version string */ -#define LIBBFIO_VERSION_STRING "20170920" +#define LIBBFIO_VERSION_STRING "20170123" /* The library flags definitions */ @@ -85,5 +85,5 @@ #endif /* HAVE_LOCAL_LIBBFIO */ -#endif /* !defined( _LIBBFIO_INTERNAL_DEFINITIONS_H ) */ +#endif diff -Nru libfvde-20170930/libbfio/libbfio_system_string.c libfvde-20180108/libbfio/libbfio_system_string.c --- libfvde-20170930/libbfio/libbfio_system_string.c 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libbfio/libbfio_system_string.c 2018-01-08 20:18:35.000000000 +0000 @@ -513,7 +513,7 @@ error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to set narrow string.", + "%s: unable to set narrow_string.", function ); return( -1 ); @@ -952,7 +952,7 @@ error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to set wide string.", + "%s: unable to set wide_string.", function ); return( -1 ); diff -Nru libfvde-20170930/libbfio/Makefile.in libfvde-20180108/libbfio/Makefile.in --- libfvde-20170930/libbfio/Makefile.in 2017-10-04 19:28:14.000000000 +0000 +++ libfvde-20180108/libbfio/Makefile.in 2018-01-08 20:19:37.000000000 +0000 @@ -499,6 +499,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/libcaes/libcaes_context.c libfvde-20180108/libcaes/libcaes_context.c --- libfvde-20170930/libcaes/libcaes_context.c 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libcaes/libcaes_context.c 2018-01-08 20:18:38.000000000 +0000 @@ -24,7 +24,7 @@ #include #include -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) +#if defined( WINAPI ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_AES_H ) @@ -267,7 +267,7 @@ libcaes_internal_context_t *internal_context = NULL; static char *function = "libcaes_context_initialize"; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) DWORD error_code = 0; #endif @@ -321,7 +321,7 @@ goto on_error; } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) /* Request the AES crypt provider, fail back to the RSA crypt provider */ if( CryptAcquireContext( @@ -441,7 +441,7 @@ internal_context = (libcaes_internal_context_t *) *context; *context = NULL; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) if( internal_context->key != 0 ) { CryptDestroyKey( @@ -488,7 +488,7 @@ libcaes_internal_context_t *internal_context = NULL; static char *function = "libcaes_context_set_key"; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) libcaes_key_t *wincrypt_key = NULL; DWORD error_code = 0; DWORD wincrypt_key_size = 0; @@ -532,7 +532,7 @@ return( -1 ); } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) if( libcaes_key_initialize( &wincrypt_key, error ) != 1 ) @@ -1251,7 +1251,7 @@ #endif static char *function = "libcaes_crypt_cbc"; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) uint8_t block_data[ 128 ]; DWORD block_length = 0; @@ -1396,7 +1396,7 @@ return( -1 ); } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) if( input_data_size > (size_t) UINT32_MAX ) { libcerror_error_set( @@ -2394,7 +2394,7 @@ static char *function = "libcaes_crypt_ecb"; int result = 1; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) uint8_t block_data[ 128 ]; DWORD block_length = 0; @@ -2514,7 +2514,7 @@ return( -1 ); } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) if( input_data_size > (size_t) UINT32_MAX ) { libcerror_error_set( diff -Nru libfvde-20170930/libcaes/libcaes_context.h libfvde-20180108/libcaes/libcaes_context.h --- libfvde-20170930/libcaes/libcaes_context.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libcaes/libcaes_context.h 2018-01-08 20:18:38.000000000 +0000 @@ -25,7 +25,7 @@ #include #include -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) +#if defined( WINAPI ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_AES_H ) @@ -48,7 +48,7 @@ struct libcaes_internal_context { -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) /* The crypto provider handle */ HCRYPTPROV crypt_provider; diff -Nru libfvde-20170930/libcaes/libcaes_definitions.h libfvde-20180108/libcaes/libcaes_definitions.h --- libfvde-20170930/libcaes/libcaes_definitions.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libcaes/libcaes_definitions.h 2018-01-08 20:18:38.000000000 +0000 @@ -34,11 +34,11 @@ * for local use of libcaes */ #else -#define LIBCAES_VERSION 20170904 +#define LIBCAES_VERSION 20170110 /* The libcaes version string */ -#define LIBCAES_VERSION_STRING "20170904" +#define LIBCAES_VERSION_STRING "20170110" /* The crypt modes */ @@ -48,7 +48,7 @@ LIBCAES_CRYPT_MODE_ENCRYPT = 1 }; -#endif /* !defined( HAVE_LOCAL_LIBCAES ) */ +#endif #if defined( WINAPI ) && ( WINVER >= 0x0600 ) #define LIBCAES_HAVE_AES_SUPPORT @@ -71,5 +71,5 @@ #define LIBCAES_UNFOLLED_LOOPS -#endif /* !defined( LIBCAES_INTERNAL_DEFINITIONS_H ) */ +#endif diff -Nru libfvde-20170930/libcaes/Makefile.in libfvde-20180108/libcaes/Makefile.in --- libfvde-20170930/libcaes/Makefile.in 2017-10-04 19:28:14.000000000 +0000 +++ libfvde-20180108/libcaes/Makefile.in 2018-01-08 20:19:37.000000000 +0000 @@ -491,6 +491,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/libcdata/libcdata_array.c libfvde-20180108/libcdata/libcdata_array.c --- libfvde-20170930/libcdata/libcdata_array.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_array.c 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * Array functions * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * @@ -569,7 +569,7 @@ internal_source_array = (libcdata_internal_array_t *) source_array; if( libcdata_array_initialize( - destination_array, + (libcdata_array_t **) &internal_destination_array, internal_source_array->number_of_entries, error ) != 1 ) { @@ -580,9 +580,9 @@ "%s: unable to create destination array.", function ); - goto on_error; + return( -1 ); } - if( *destination_array == NULL ) + if( internal_destination_array == NULL ) { libcerror_error_set( error, @@ -591,10 +591,8 @@ "%s: missing destination array.", function ); - goto on_error; + return( -1 ); } - internal_destination_array = (libcdata_internal_array_t *) *destination_array; - #if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) if( libcthreads_read_write_lock_grab_for_read( internal_source_array->read_write_lock, @@ -633,7 +631,7 @@ function, entry_iterator ); - break; + goto on_error; } } } @@ -653,17 +651,20 @@ goto on_error; } #endif - if( result != 1 ) - { - goto on_error; - } + *destination_array = (libcdata_array_t *) internal_destination_array; + return( 1 ); on_error: - if( *destination_array != NULL ) +#if defined( HAVE_MULTI_THREAD_SUPPORT ) && !defined( HAVE_LOCAL_LIBCDATA ) + libcthreads_read_write_lock_release_for_read( + internal_source_array->read_write_lock, + NULL ); +#endif + if( internal_destination_array != NULL ) { libcdata_array_free( - destination_array, + (libcdata_array_t **) &internal_destination_array, entry_free_function, NULL ); } diff -Nru libfvde-20170930/libcdata/libcdata_array.h libfvde-20180108/libcdata/libcdata_array.h --- libfvde-20170930/libcdata/libcdata_array.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_array.h 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * Array functions * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcdata/libcdata_btree.c libfvde-20180108/libcdata/libcdata_btree.c --- libfvde-20170930/libcdata/libcdata_btree.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_btree.c 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * Balanced tree type functions * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcdata/libcdata_btree.h libfvde-20180108/libcdata/libcdata_btree.h --- libfvde-20170930/libcdata/libcdata_btree.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_btree.h 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * Balanced tree type functions * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcdata/libcdata_definitions.h libfvde-20180108/libcdata/libcdata_definitions.h --- libfvde-20170930/libcdata/libcdata_definitions.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_definitions.h 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal definitions * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * @@ -35,11 +35,11 @@ */ #else -#define LIBCDATA_VERSION 20170917 +#define LIBCDATA_VERSION 20180102 /* The libcdata version string */ -#define LIBCDATA_VERSION_STRING "20170917" +#define LIBCDATA_VERSION_STRING "20180102" /* The comparison function definitions */ diff -Nru libfvde-20170930/libcdata/libcdata_error.c libfvde-20180108/libcdata/libcdata_error.c --- libfvde-20170930/libcdata/libcdata_error.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_error.c 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * Error functions * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcdata/libcdata_error.h libfvde-20180108/libcdata/libcdata_error.h --- libfvde-20170930/libcdata/libcdata_error.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_error.h 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * Error functions * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcdata/libcdata_extern.h libfvde-20180108/libcdata/libcdata_extern.h --- libfvde-20170930/libcdata/libcdata_extern.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_extern.h 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal extern definition * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcdata/libcdata_libcerror.h libfvde-20180108/libcdata/libcdata_libcerror.h --- libfvde-20170930/libcdata/libcdata_libcerror.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_libcerror.h 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libcerror header * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcdata/libcdata_libcthreads.h libfvde-20180108/libcdata/libcdata_libcthreads.h --- libfvde-20170930/libcdata/libcdata_libcthreads.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_libcthreads.h 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libcthreads header * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcdata/libcdata_list.c libfvde-20180108/libcdata/libcdata_list.c --- libfvde-20170930/libcdata/libcdata_list.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_list.c 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * List functions * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcdata/libcdata_list_element.c libfvde-20180108/libcdata/libcdata_list_element.c --- libfvde-20170930/libcdata/libcdata_list_element.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_list_element.c 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * List element functions * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcdata/libcdata_list_element.h libfvde-20180108/libcdata/libcdata_list_element.h --- libfvde-20170930/libcdata/libcdata_list_element.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_list_element.h 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * List element functions * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcdata/libcdata_list.h libfvde-20180108/libcdata/libcdata_list.h --- libfvde-20170930/libcdata/libcdata_list.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_list.h 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * List functions * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcdata/libcdata_range_list.c libfvde-20180108/libcdata/libcdata_range_list.c --- libfvde-20170930/libcdata/libcdata_range_list.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_range_list.c 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * Range list * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * @@ -1859,12 +1859,13 @@ } /* Inserts the range list value in the range list after the range list element + * If range_list_element is NULL the value is inserted before the first element in the list * Returns 1 if successful, or -1 on error */ int libcdata_range_list_insert_value( libcdata_range_list_t *range_list, libcdata_list_element_t *range_list_element, - libcdata_range_list_value_t *range_list_value, + libcdata_range_list_value_t *value, libcerror_error_t **error ) { libcdata_list_element_t *list_element = NULL; @@ -1896,7 +1897,7 @@ } if( libcdata_list_element_set_value( list_element, - (intptr_t *) range_list_value, + (intptr_t *) value, error ) != 1 ) { libcerror_error_set( diff -Nru libfvde-20170930/libcdata/libcdata_range_list.h libfvde-20180108/libcdata/libcdata_range_list.h --- libfvde-20170930/libcdata/libcdata_range_list.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_range_list.h 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * Range list * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * @@ -156,7 +156,7 @@ int libcdata_range_list_insert_value( libcdata_range_list_t *range_list, libcdata_list_element_t *range_list_element, - libcdata_range_list_value_t *range_list_value, + libcdata_range_list_value_t *value, libcerror_error_t **error ); int libcdata_range_list_remove_element( diff -Nru libfvde-20170930/libcdata/libcdata_range_list_value.c libfvde-20180108/libcdata/libcdata_range_list_value.c --- libfvde-20170930/libcdata/libcdata_range_list_value.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_range_list_value.c 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * Range list value * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcdata/libcdata_range_list_value.h libfvde-20180108/libcdata/libcdata_range_list_value.h --- libfvde-20170930/libcdata/libcdata_range_list_value.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_range_list_value.h 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * Range list value * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcdata/libcdata_support.c libfvde-20180108/libcdata/libcdata_support.c --- libfvde-20170930/libcdata/libcdata_support.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_support.c 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * Support functions * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcdata/libcdata_support.h libfvde-20180108/libcdata/libcdata_support.h --- libfvde-20170930/libcdata/libcdata_support.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_support.h 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * Support functions * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcdata/libcdata_tree_node.c libfvde-20180108/libcdata/libcdata_tree_node.c --- libfvde-20170930/libcdata/libcdata_tree_node.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_tree_node.c 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * Tree functions * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * @@ -1614,14 +1614,12 @@ libcerror_error_t **error ) { libcdata_internal_tree_node_t *internal_node = NULL; + libcdata_internal_tree_node_t *internal_parent_node = NULL; libcdata_internal_tree_node_t *internal_replacement_node = NULL; - libcdata_tree_node_t *first_sub_node = NULL; - libcdata_tree_node_t *last_sub_node = NULL; - libcdata_tree_node_t *sub_node = NULL; - intptr_t *value = NULL; + libcdata_tree_node_t *next_node = NULL; + libcdata_tree_node_t *parent_node = NULL; + libcdata_tree_node_t *previous_node = NULL; static char *function = "libcdata_tree_node_replace_node"; - int number_of_sub_nodes = 0; - int sub_node_index = 0; if( node == NULL ) { @@ -1673,57 +1671,27 @@ return( -1 ); } - value = internal_node->value; - first_sub_node = internal_node->first_sub_node; - last_sub_node = internal_node->last_sub_node; - number_of_sub_nodes = internal_node->number_of_sub_nodes; - - internal_node->value = internal_replacement_node->value; - internal_node->first_sub_node = internal_replacement_node->first_sub_node; - internal_node->last_sub_node = internal_replacement_node->last_sub_node; - internal_node->number_of_sub_nodes = internal_replacement_node->number_of_sub_nodes; - - internal_replacement_node->value = value; - internal_replacement_node->first_sub_node = first_sub_node; - internal_replacement_node->last_sub_node = last_sub_node; - internal_replacement_node->number_of_sub_nodes = number_of_sub_nodes; + parent_node = internal_node->parent_node; + internal_node->parent_node = internal_replacement_node->parent_node; + internal_replacement_node->parent_node = parent_node; + + previous_node = internal_node->previous_node; + internal_node->previous_node = internal_replacement_node->previous_node; + internal_replacement_node->previous_node = previous_node; + + next_node = internal_node->next_node; + internal_node->next_node = internal_replacement_node->next_node; + internal_replacement_node->next_node = next_node; - sub_node = internal_node->first_sub_node; + internal_parent_node = (libcdata_internal_tree_node_t *) parent_node; - for( sub_node_index = 0; - sub_node_index < internal_node->number_of_sub_nodes; - sub_node_index++ ) + if( internal_parent_node->first_sub_node == node ) { - if( libcdata_tree_node_set_parent_node( - sub_node, - node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_SET_FAILED, - "%s: unable to set parent node value of sub node: %d.", - function, - sub_node_index ); - - return( -1 ); - } - if( libcdata_tree_node_get_next_node( - sub_node, - &sub_node, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_GET_FAILED, - "%s: unable to retrieve next node of sub node: %d.", - function, - sub_node_index ); - - return( -1 ); - } + internal_parent_node->first_sub_node = replacement_node; + } + if( internal_parent_node->last_sub_node == node ) + { + internal_parent_node->last_sub_node = replacement_node; } return( 1 ); } @@ -2126,30 +2094,33 @@ } } } - else if( internal_node->value == NULL ) + else { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid node - missing value.", - function ); + if( internal_node->value == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, + "%s: invalid node - missing value.", + function ); - return( -1 ); - } - else if( libcdata_list_append_value( - *leaf_node_list, - internal_node->value, - error ) != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, - "%s: unable to append tree node to leaf node list.", - function ); + return( -1 ); + } + if( libcdata_list_append_value( + *leaf_node_list, + internal_node->value, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, + "%s: unable to append tree node to leaf node list.", + function ); - return( -1 ); + return( -1 ); + } } return( 1 ); } diff -Nru libfvde-20170930/libcdata/libcdata_tree_node.h libfvde-20180108/libcdata/libcdata_tree_node.h --- libfvde-20170930/libcdata/libcdata_tree_node.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_tree_node.h 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * Tree functions * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcdata/libcdata_types.h libfvde-20180108/libcdata/libcdata_types.h --- libfvde-20170930/libcdata/libcdata_types.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_types.h 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal type definitions * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcdata/libcdata_unused.h libfvde-20180108/libcdata/libcdata_unused.h --- libfvde-20170930/libcdata/libcdata_unused.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcdata/libcdata_unused.h 2018-01-08 20:18:40.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal unused definition * - * Copyright (C) 2006-2017, Joachim Metz + * Copyright (C) 2006-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcdata/Makefile.in libfvde-20180108/libcdata/Makefile.in --- libfvde-20170930/libcdata/Makefile.in 2017-10-04 19:28:14.000000000 +0000 +++ libfvde-20180108/libcdata/Makefile.in 2018-01-08 20:19:37.000000000 +0000 @@ -499,6 +499,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/libcerror/libcerror_definitions.h libfvde-20180108/libcerror/libcerror_definitions.h --- libfvde-20170930/libcerror/libcerror_definitions.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcerror/libcerror_definitions.h 2018-01-08 20:18:45.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal definitions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * @@ -35,11 +35,11 @@ */ #else -#define LIBCERROR_VERSION 20170925 +#define LIBCERROR_VERSION 20180102 /* The libcerror version string */ -#define LIBCERROR_VERSION_STRING "20170925" +#define LIBCERROR_VERSION_STRING "20180102" /* The error domains */ diff -Nru libfvde-20170930/libcerror/libcerror_error.c libfvde-20180108/libcerror/libcerror_error.c --- libfvde-20170930/libcerror/libcerror_error.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcerror/libcerror_error.c 2018-01-08 20:18:45.000000000 +0000 @@ -1,7 +1,7 @@ /* * Error functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * @@ -494,9 +494,16 @@ FILE *stream ) { libcerror_internal_error_t *internal_error = NULL; + system_character_t *error_string = NULL; int message_index = 0; int print_count = 0; +#if defined( WINAPI ) + const char *format_string = "%" PRIs_SYSTEM "\r\n"; +#else + const char *format_string = "%" PRIs_SYSTEM "\n"; +#endif + if( error == NULL ) { return( -1 ); @@ -512,20 +519,15 @@ return( -1 ); } message_index = internal_error->number_of_messages - 1; + error_string = internal_error->messages[ message_index ]; - if( internal_error->messages[ message_index ] != NULL ) + if( error_string != NULL ) { -#if defined( WINAPI ) print_count = fprintf( stream, - "%" PRIs_SYSTEM "\r\n", - internal_error->messages[ message_index ] ); -#else - print_count = fprintf( - stream, - "%" PRIs_SYSTEM "\n", - internal_error->messages[ message_index ] ); -#endif + format_string, + error_string ); + if( print_count <= -1 ) { return( -1 ); @@ -544,8 +546,13 @@ size_t size ) { libcerror_internal_error_t *internal_error = NULL; + system_character_t *error_string = NULL; size_t print_count = 0; - int message_index = 0; + size_t message_index = 0; + +#if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) + size_t error_string_size = 0; +#endif if( error == NULL ) { @@ -557,6 +564,10 @@ { return( -1 ); } + if( internal_error->sizes == NULL ) + { + return( -1 ); + } if( string == NULL ) { return( -1 ); @@ -570,8 +581,9 @@ return( -1 ); } message_index = internal_error->number_of_messages - 1; + error_string = internal_error->messages[ message_index ]; - if( internal_error->messages[ message_index ] != NULL ) + if( error_string != NULL ) { #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) #if defined( _MSC_VER ) @@ -579,7 +591,7 @@ &print_count, string, size, - internal_error->messages[ message_index ], + error_string, _TRUNCATE ) != 0 ) { return( -1 ); @@ -587,7 +599,7 @@ #else print_count = wcstombs( string, - internal_error->messages[ message_index ], + error_string, size ); if( print_count == (size_t) -1 ) @@ -601,22 +613,20 @@ return( -1 ); } #else - if( ( internal_error->sizes[ message_index ] + 1 ) >= size ) + error_string_size = internal_error->sizes[ message_index ]; + + if( size < ( error_string_size + 1 ) ) { return( -1 ); } if( narrow_string_copy( string, - internal_error->messages[ message_index ], - internal_error->sizes[ message_index ] ) == NULL ) + error_string, + error_string_size ) == NULL ) { - string[ 0 ] = (system_character_t) 0; - return( -1 ); } - print_count = internal_error->sizes[ message_index ]; - - string[ print_count ] = (system_character_t) 0; + print_count = error_string_size; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ } @@ -635,10 +645,17 @@ FILE *stream ) { libcerror_internal_error_t *internal_error = NULL; + system_character_t *error_string = NULL; int message_index = 0; int print_count = 0; int total_print_count = 0; +#if defined( WINAPI ) + const char *format_string = "%" PRIs_SYSTEM "\r\n"; +#else + const char *format_string = "%" PRIs_SYSTEM "\n"; +#endif + if( error == NULL ) { return( -1 ); @@ -657,19 +674,15 @@ message_index < internal_error->number_of_messages; message_index++ ) { - if( internal_error->messages[ message_index ] != NULL ) + error_string = internal_error->messages[ message_index ]; + + if( error_string != NULL ) { -#if defined( WINAPI ) print_count = fprintf( stream, - "%" PRIs_SYSTEM "\r\n", - internal_error->messages[ message_index ] ); -#else - print_count = fprintf( - stream, - "%" PRIs_SYSTEM "\n", - internal_error->messages[ message_index ] ); -#endif + format_string, + error_string ); + if( print_count <= -1 ) { return( -1 ); @@ -690,11 +703,14 @@ size_t size ) { libcerror_internal_error_t *internal_error = NULL; + system_character_t *error_string = NULL; size_t string_index = 0; int message_index = 0; #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) size_t print_count = 0; +#else + size_t error_string_size = 0; #endif if( error == NULL ) @@ -727,7 +743,9 @@ message_index < internal_error->number_of_messages; message_index++ ) { - if( internal_error->messages[ message_index ] != NULL ) + error_string = internal_error->messages[ message_index ]; + + if( error_string != NULL ) { if( string_index > 0 ) { @@ -753,7 +771,7 @@ &print_count, &( string[ string_index ] ), size - string_index, - internal_error->messages[ message_index ], + error_string, _TRUNCATE ) != 0 ) { return( -1 ); @@ -761,7 +779,7 @@ #else print_count = wcstombs( &( string[ string_index ] ), - internal_error->messages[ message_index ], + error_string, size - string_index ); if( print_count == (size_t) -1 ) @@ -781,20 +799,20 @@ string_index--; } #else - if( ( string_index + internal_error->sizes[ message_index ] + 1 ) >= size ) + error_string_size = internal_error->sizes[ message_index ]; + + if( size < ( string_index + error_string_size + 1 ) ) { return( -1 ); } if( narrow_string_copy( &( string[ string_index ] ), - internal_error->messages[ message_index ], - internal_error->sizes[ message_index ] ) == NULL ) + error_string, + error_string_size ) == NULL ) { return( -1 ); } - string_index += internal_error->sizes[ message_index ] - 1; - - string[ string_index ] = (system_character_t) 0; + string_index += error_string_size - 1; #endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ } diff -Nru libfvde-20170930/libcerror/libcerror_error.h libfvde-20180108/libcerror/libcerror_error.h --- libfvde-20170930/libcerror/libcerror_error.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcerror/libcerror_error.h 2018-01-08 20:18:45.000000000 +0000 @@ -1,7 +1,7 @@ /* * Error functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * @@ -72,11 +72,15 @@ int libcerror_error_resize( libcerror_internal_error_t *internal_error ); +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + void libcerror_error_get_system_format_string( const char *format_string, size_t format_string_length, system_character_t **system_format_string ); +#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ + LIBCERROR_EXTERN \ void libcerror_error_set( libcerror_error_t **error, diff -Nru libfvde-20170930/libcerror/libcerror_extern.h libfvde-20180108/libcerror/libcerror_extern.h --- libfvde-20170930/libcerror/libcerror_extern.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcerror/libcerror_extern.h 2018-01-08 20:18:45.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal extern definition * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcerror/libcerror_support.c libfvde-20180108/libcerror/libcerror_support.c --- libfvde-20170930/libcerror/libcerror_support.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcerror/libcerror_support.c 2018-01-08 20:18:45.000000000 +0000 @@ -1,7 +1,7 @@ /* * Support functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcerror/libcerror_support.h libfvde-20180108/libcerror/libcerror_support.h --- libfvde-20170930/libcerror/libcerror_support.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcerror/libcerror_support.h 2018-01-08 20:18:45.000000000 +0000 @@ -1,7 +1,7 @@ /* * Support functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcerror/libcerror_system.c libfvde-20180108/libcerror/libcerror_system.c --- libfvde-20170930/libcerror/libcerror_system.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcerror/libcerror_system.c 2018-01-08 20:18:45.000000000 +0000 @@ -1,7 +1,7 @@ /* * System functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * @@ -47,6 +47,8 @@ #include "libcerror_system.h" #include "libcerror_types.h" +#if defined( WINAPI ) + /* The make language identifier macro for the WINAPI FormatMessage function */ #if !defined( MAKELANGID ) @@ -62,6 +64,8 @@ #define SUBLANG_DEFAULT 1 #endif +#endif /* defined( WINAPI ) */ + #if defined( WINAPI ) && ( WINVER <= 0x0500 ) /* Cross Windows safe version of FormatMessageA @@ -170,9 +174,24 @@ return( result ); } +#endif /* defined( WINAPI ) && ( WINVER <= 0x0500 ) */ + +#if defined( WINAPI ) + +#if ( WINVER <= 0x0500 ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) +#define libcerror_system_FormatMessage libcerror_FormatMessageW +#else +#define libcerror_system_FormatMessage libcerror_FormatMessageA #endif -#if defined( WINAPI ) && ( WINVER >= 0x0501 ) +#else +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) +#define libcerror_system_FormatMessage FormatMessageW +#else +#define libcerror_system_FormatMessage FormatMessageA +#endif +#endif /* ( WINVER <= 0x0500 ) */ /* Retrieves a descriptive string of the error number * This function uses the WINAPI functions for Windows XP or later @@ -196,33 +215,7 @@ { return( -1 ); } -#if ( WINVER <= 0x0500 ) -#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) - print_count = libcerror_FormatMessageW( - flags, - NULL, - (DWORD) error_number, - MAKELANGID( - LANG_NEUTRAL, - SUBLANG_DEFAULT ), - string, - (DWORD) string_size, - NULL ); -#else - print_count = libcerror_FormatMessageA( - flags, - NULL, - (DWORD) error_number, - MAKELANGID( - LANG_NEUTRAL, - SUBLANG_DEFAULT ), - string, - (DWORD) string_size, - NULL ); -#endif -#else -#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) - print_count = FormatMessageW( + print_count = libcerror_system_FormatMessage( flags, NULL, (DWORD) error_number, @@ -232,20 +225,6 @@ string, (DWORD) string_size, NULL ); -#else - print_count = FormatMessageA( - flags, - NULL, - (DWORD) error_number, - MAKELANGID( - LANG_NEUTRAL, - SUBLANG_DEFAULT ), - string, - (DWORD) string_size, - NULL ); -#endif -#endif /* ( WINVER <= 0x0500 ) */ - if( print_count == 0 ) { @@ -256,6 +235,10 @@ #elif defined( HAVE_STRERROR_R ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) +#error Missing wide character strerror_r function +#endif + /* Retrieves a descriptive string of the error number * This function uses the POSIX strerror_r function or equivalent * Returns the string_length if successful or -1 on error @@ -275,12 +258,6 @@ { return( -1 ); } -/* Sanity check - */ -#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) -#error Missing wide character strerror_r function -#endif - #if defined( STRERROR_R_CHAR_P ) if( strerror_r( (int) error_number, @@ -303,7 +280,11 @@ return( (int) string_length ); } -#elif defined( HAVE_STRERROR ) || defined( WINAPI ) +#elif defined( HAVE_STRERROR ) + +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) +#error Missing wide character strerror function +#endif /* Retrieves a descriptive string of the error number * This function uses the POSIX strerror function or equivalent @@ -329,12 +310,6 @@ { return( -1 ); } -/* Sanity check - */ -#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) && !defined( WINAPI ) -#error Missing wide character strerror function -#endif - #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) static_error_string = _wcserror( (int) error_number ); diff -Nru libfvde-20170930/libcerror/libcerror_system.h libfvde-20180108/libcerror/libcerror_system.h --- libfvde-20170930/libcerror/libcerror_system.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcerror/libcerror_system.h 2018-01-08 20:18:45.000000000 +0000 @@ -1,7 +1,7 @@ /* * System functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcerror/libcerror_types.h libfvde-20180108/libcerror/libcerror_types.h --- libfvde-20170930/libcerror/libcerror_types.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcerror/libcerror_types.h 2018-01-08 20:18:45.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal type definitions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcerror/libcerror_unused.h libfvde-20180108/libcerror/libcerror_unused.h --- libfvde-20170930/libcerror/libcerror_unused.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcerror/libcerror_unused.h 2018-01-08 20:18:45.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal unused definition * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcerror/Makefile.in libfvde-20180108/libcerror/Makefile.in --- libfvde-20170930/libcerror/Makefile.in 2017-10-04 19:28:14.000000000 +0000 +++ libfvde-20180108/libcerror/Makefile.in 2018-01-08 20:19:37.000000000 +0000 @@ -489,6 +489,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/libcfile/libcfile_definitions.h libfvde-20180108/libcfile/libcfile_definitions.h --- libfvde-20170930/libcfile/libcfile_definitions.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libcfile/libcfile_definitions.h 2018-01-08 20:18:48.000000000 +0000 @@ -35,11 +35,11 @@ */ #else -#define LIBCFILE_VERSION 20170917 +#define LIBCFILE_VERSION 20170105 /* The libcfile version string */ -#define LIBCFILE_VERSION_STRING "20170917" +#define LIBCFILE_VERSION_STRING "20170105" /* The file access flags * bit 1 set to 1 for read access diff -Nru libfvde-20170930/libcfile/libcfile_libuna.h libfvde-20180108/libcfile/libcfile_libuna.h --- libfvde-20170930/libcfile/libcfile_libuna.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libcfile/libcfile_libuna.h 2018-01-08 20:18:48.000000000 +0000 @@ -3,8 +3,6 @@ * * Copyright (C) 2008-2017, Joachim Metz * - * Refer to AUTHORS for acknowledgements. - * * This software is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or diff -Nru libfvde-20170930/libcfile/libcfile_system_string.c libfvde-20180108/libcfile/libcfile_system_string.c --- libfvde-20170930/libcfile/libcfile_system_string.c 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libcfile/libcfile_system_string.c 2018-01-08 20:18:48.000000000 +0000 @@ -513,7 +513,7 @@ error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to set narrow string.", + "%s: unable to set narrow_string.", function ); return( -1 ); @@ -952,7 +952,7 @@ error, LIBCERROR_ERROR_DOMAIN_MEMORY, LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to set wide string.", + "%s: unable to set wide_string.", function ); return( -1 ); diff -Nru libfvde-20170930/libcfile/Makefile.in libfvde-20180108/libcfile/Makefile.in --- libfvde-20170930/libcfile/Makefile.in 2017-10-04 19:28:14.000000000 +0000 +++ libfvde-20180108/libcfile/Makefile.in 2018-01-08 20:19:37.000000000 +0000 @@ -492,6 +492,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/libclocale/libclocale_definitions.h libfvde-20180108/libclocale/libclocale_definitions.h --- libfvde-20170930/libclocale/libclocale_definitions.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libclocale/libclocale_definitions.h 2018-01-08 20:18:50.000000000 +0000 @@ -34,11 +34,11 @@ */ #else -#define LIBCLOCALE_VERSION 20170917 +#define LIBCLOCALE_VERSION 20170105 /* The libclocale version string */ -#define LIBCLOCALE_VERSION_STRING "20170917" +#define LIBCLOCALE_VERSION_STRING "20170105" /* The codepage feature flag definitions */ diff -Nru libfvde-20170930/libclocale/Makefile.in libfvde-20180108/libclocale/Makefile.in --- libfvde-20170930/libclocale/Makefile.in 2017-10-04 19:28:15.000000000 +0000 +++ libfvde-20180108/libclocale/Makefile.in 2018-01-08 20:19:37.000000000 +0000 @@ -492,6 +492,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/libcnotify/libcnotify_definitions.h libfvde-20180108/libcnotify/libcnotify_definitions.h --- libfvde-20170930/libcnotify/libcnotify_definitions.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcnotify/libcnotify_definitions.h 2018-01-08 20:18:52.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal definitions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * @@ -35,11 +35,11 @@ */ #else -#define LIBCNOTIFY_VERSION 20170917 +#define LIBCNOTIFY_VERSION 20180102 /* The libcnotify version string */ -#define LIBCNOTIFY_VERSION_STRING "20170917" +#define LIBCNOTIFY_VERSION_STRING "20180102" /* The print data flags */ diff -Nru libfvde-20170930/libcnotify/libcnotify_extern.h libfvde-20180108/libcnotify/libcnotify_extern.h --- libfvde-20170930/libcnotify/libcnotify_extern.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcnotify/libcnotify_extern.h 2018-01-08 20:18:52.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal extern definition * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcnotify/libcnotify_libcerror.h libfvde-20180108/libcnotify/libcnotify_libcerror.h --- libfvde-20170930/libcnotify/libcnotify_libcerror.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcnotify/libcnotify_libcerror.h 2018-01-08 20:18:52.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libcerror header * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcnotify/libcnotify_print.c libfvde-20180108/libcnotify/libcnotify_print.c --- libfvde-20170930/libcnotify/libcnotify_print.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcnotify/libcnotify_print.c 2018-01-08 20:18:52.000000000 +0000 @@ -1,7 +1,7 @@ /* * Notification print functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcnotify/libcnotify_print.h libfvde-20180108/libcnotify/libcnotify_print.h --- libfvde-20170930/libcnotify/libcnotify_print.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcnotify/libcnotify_print.h 2018-01-08 20:18:52.000000000 +0000 @@ -1,7 +1,7 @@ /* * Notification print functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcnotify/libcnotify_stream.c libfvde-20180108/libcnotify/libcnotify_stream.c --- libfvde-20170930/libcnotify/libcnotify_stream.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcnotify/libcnotify_stream.c 2018-01-08 20:18:52.000000000 +0000 @@ -1,7 +1,7 @@ /* * Notification stream functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcnotify/libcnotify_stream.h libfvde-20180108/libcnotify/libcnotify_stream.h --- libfvde-20170930/libcnotify/libcnotify_stream.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcnotify/libcnotify_stream.h 2018-01-08 20:18:52.000000000 +0000 @@ -1,7 +1,7 @@ /* * Notification stream functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcnotify/libcnotify_support.c libfvde-20180108/libcnotify/libcnotify_support.c --- libfvde-20170930/libcnotify/libcnotify_support.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcnotify/libcnotify_support.c 2018-01-08 20:18:52.000000000 +0000 @@ -1,7 +1,7 @@ /* * Support functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcnotify/libcnotify_support.h libfvde-20180108/libcnotify/libcnotify_support.h --- libfvde-20170930/libcnotify/libcnotify_support.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcnotify/libcnotify_support.h 2018-01-08 20:18:52.000000000 +0000 @@ -1,7 +1,7 @@ /* * Support functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcnotify/libcnotify_unused.h libfvde-20180108/libcnotify/libcnotify_unused.h --- libfvde-20170930/libcnotify/libcnotify_unused.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcnotify/libcnotify_unused.h 2018-01-08 20:18:52.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal unused definition * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcnotify/libcnotify_verbose.c libfvde-20180108/libcnotify/libcnotify_verbose.c --- libfvde-20170930/libcnotify/libcnotify_verbose.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcnotify/libcnotify_verbose.c 2018-01-08 20:18:52.000000000 +0000 @@ -1,7 +1,7 @@ /* * Verbose functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcnotify/libcnotify_verbose.h libfvde-20180108/libcnotify/libcnotify_verbose.h --- libfvde-20170930/libcnotify/libcnotify_verbose.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcnotify/libcnotify_verbose.h 2018-01-08 20:18:52.000000000 +0000 @@ -1,7 +1,7 @@ /* * Verbose functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcnotify/Makefile.in libfvde-20180108/libcnotify/Makefile.in --- libfvde-20170930/libcnotify/Makefile.in 2017-10-04 19:28:15.000000000 +0000 +++ libfvde-20180108/libcnotify/Makefile.in 2018-01-08 20:19:37.000000000 +0000 @@ -491,6 +491,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/libcpath/libcpath_definitions.h libfvde-20180108/libcpath/libcpath_definitions.h --- libfvde-20170930/libcpath/libcpath_definitions.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libcpath/libcpath_definitions.h 2018-01-08 20:18:55.000000000 +0000 @@ -35,11 +35,11 @@ */ #else -#define LIBCPATH_VERSION 20170917 +#define LIBCPATH_VERSION 20171210 /* The libcpath version string */ -#define LIBCPATH_VERSION_STRING "20170917" +#define LIBCPATH_VERSION_STRING "20171210" #if defined( WINAPI ) #define LIBCPATH_SEPARATOR '\\' diff -Nru libfvde-20170930/libcpath/Makefile.in libfvde-20180108/libcpath/Makefile.in --- libfvde-20170930/libcpath/Makefile.in 2017-10-04 19:28:15.000000000 +0000 +++ libfvde-20180108/libcpath/Makefile.in 2018-01-08 20:19:37.000000000 +0000 @@ -490,6 +490,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/libcsplit/libcsplit_definitions.h libfvde-20180108/libcsplit/libcsplit_definitions.h --- libfvde-20170930/libcsplit/libcsplit_definitions.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcsplit/libcsplit_definitions.h 2018-01-08 20:18:57.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal definitions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * @@ -35,11 +35,11 @@ */ #else -#define LIBCSPLIT_VERSION 20170917 +#define LIBCSPLIT_VERSION 20180103 /* The libcsplit version string */ -#define LIBCSPLIT_VERSION_STRING "20170917" +#define LIBCSPLIT_VERSION_STRING "20180103" #endif /* !defined( HAVE_LOCAL_LIBCSPLIT ) */ diff -Nru libfvde-20170930/libcsplit/libcsplit_error.c libfvde-20180108/libcsplit/libcsplit_error.c --- libfvde-20170930/libcsplit/libcsplit_error.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcsplit/libcsplit_error.c 2018-01-08 20:18:57.000000000 +0000 @@ -1,7 +1,7 @@ /* * Error functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcsplit/libcsplit_error.h libfvde-20180108/libcsplit/libcsplit_error.h --- libfvde-20170930/libcsplit/libcsplit_error.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcsplit/libcsplit_error.h 2018-01-08 20:18:57.000000000 +0000 @@ -1,7 +1,7 @@ /* * Error functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcsplit/libcsplit_extern.h libfvde-20180108/libcsplit/libcsplit_extern.h --- libfvde-20170930/libcsplit/libcsplit_extern.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcsplit/libcsplit_extern.h 2018-01-08 20:18:57.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal extern definition * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcsplit/libcsplit_libcerror.h libfvde-20180108/libcsplit/libcsplit_libcerror.h --- libfvde-20170930/libcsplit/libcsplit_libcerror.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcsplit/libcsplit_libcerror.h 2018-01-08 20:18:57.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libcerror header * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcsplit/libcsplit_narrow_split_string.c libfvde-20180108/libcsplit/libcsplit_narrow_split_string.c --- libfvde-20170930/libcsplit/libcsplit_narrow_split_string.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcsplit/libcsplit_narrow_split_string.c 2018-01-08 20:18:57.000000000 +0000 @@ -1,7 +1,7 @@ /* * Split narrow string functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * @@ -514,7 +514,7 @@ } string_segment_offset = (size_t) ( string_segment - internal_split_string->string ); - if( string_segment_offset > internal_split_string->string_size ) + if( string_segment_offset >= internal_split_string->string_size ) { libcerror_error_set( error, diff -Nru libfvde-20170930/libcsplit/libcsplit_narrow_split_string.h libfvde-20180108/libcsplit/libcsplit_narrow_split_string.h --- libfvde-20170930/libcsplit/libcsplit_narrow_split_string.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcsplit/libcsplit_narrow_split_string.h 2018-01-08 20:18:57.000000000 +0000 @@ -1,7 +1,7 @@ /* * Split narrow string functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcsplit/libcsplit_narrow_string.c libfvde-20180108/libcsplit/libcsplit_narrow_string.c --- libfvde-20170930/libcsplit/libcsplit_narrow_string.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcsplit/libcsplit_narrow_string.c 2018-01-08 20:18:57.000000000 +0000 @@ -1,7 +1,7 @@ /* * Narrow character string functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcsplit/libcsplit_narrow_string.h libfvde-20180108/libcsplit/libcsplit_narrow_string.h --- libfvde-20170930/libcsplit/libcsplit_narrow_string.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcsplit/libcsplit_narrow_string.h 2018-01-08 20:18:57.000000000 +0000 @@ -1,7 +1,7 @@ /* * Narrow character string functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcsplit/libcsplit_support.c libfvde-20180108/libcsplit/libcsplit_support.c --- libfvde-20170930/libcsplit/libcsplit_support.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcsplit/libcsplit_support.c 2018-01-08 20:18:57.000000000 +0000 @@ -1,7 +1,7 @@ /* * Support functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcsplit/libcsplit_support.h libfvde-20180108/libcsplit/libcsplit_support.h --- libfvde-20170930/libcsplit/libcsplit_support.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcsplit/libcsplit_support.h 2018-01-08 20:18:57.000000000 +0000 @@ -1,7 +1,7 @@ /* * Support functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcsplit/libcsplit_types.h libfvde-20180108/libcsplit/libcsplit_types.h --- libfvde-20170930/libcsplit/libcsplit_types.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libcsplit/libcsplit_types.h 2018-01-08 20:18:57.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal type definitions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcsplit/libcsplit_unused.h libfvde-20180108/libcsplit/libcsplit_unused.h --- libfvde-20170930/libcsplit/libcsplit_unused.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libcsplit/libcsplit_unused.h 2018-01-08 20:18:57.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal unused definition * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcsplit/libcsplit_wide_split_string.c libfvde-20180108/libcsplit/libcsplit_wide_split_string.c --- libfvde-20170930/libcsplit/libcsplit_wide_split_string.c 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libcsplit/libcsplit_wide_split_string.c 2018-01-08 20:18:57.000000000 +0000 @@ -1,7 +1,7 @@ /* * Split wide string functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * @@ -516,7 +516,7 @@ } string_segment_offset = (size_t) ( string_segment - internal_split_string->string ); - if( string_segment_offset > internal_split_string->string_size ) + if( string_segment_offset >= internal_split_string->string_size ) { libcerror_error_set( error, diff -Nru libfvde-20170930/libcsplit/libcsplit_wide_split_string.h libfvde-20180108/libcsplit/libcsplit_wide_split_string.h --- libfvde-20170930/libcsplit/libcsplit_wide_split_string.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libcsplit/libcsplit_wide_split_string.h 2018-01-08 20:18:57.000000000 +0000 @@ -1,7 +1,7 @@ /* * Split wide string functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcsplit/libcsplit_wide_string.c libfvde-20180108/libcsplit/libcsplit_wide_string.c --- libfvde-20170930/libcsplit/libcsplit_wide_string.c 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libcsplit/libcsplit_wide_string.c 2018-01-08 20:18:57.000000000 +0000 @@ -1,7 +1,7 @@ /* * Wide character string functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcsplit/libcsplit_wide_string.h libfvde-20180108/libcsplit/libcsplit_wide_string.h --- libfvde-20170930/libcsplit/libcsplit_wide_string.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libcsplit/libcsplit_wide_string.h 2018-01-08 20:18:57.000000000 +0000 @@ -1,7 +1,7 @@ /* * Wide character string functions * - * Copyright (C) 2008-2017, Joachim Metz + * Copyright (C) 2008-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libcsplit/Makefile.in libfvde-20180108/libcsplit/Makefile.in --- libfvde-20170930/libcsplit/Makefile.in 2017-10-04 19:28:15.000000000 +0000 +++ libfvde-20180108/libcsplit/Makefile.in 2018-01-08 20:19:37.000000000 +0000 @@ -497,6 +497,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/libcthreads/libcthreads_definitions.h libfvde-20180108/libcthreads/libcthreads_definitions.h --- libfvde-20170930/libcthreads/libcthreads_definitions.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcthreads/libcthreads_definitions.h 2018-01-08 20:18:59.000000000 +0000 @@ -35,11 +35,11 @@ */ #else -#define LIBCTHREADS_VERSION 20170918 +#define LIBCTHREADS_VERSION 20170101 /* The libcthreads version string */ -#define LIBCTHREADS_VERSION_STRING "20170918" +#define LIBCTHREADS_VERSION_STRING "20170101" /* The comparison function definitions */ diff -Nru libfvde-20170930/libcthreads/libcthreads_read_write_lock.c libfvde-20180108/libcthreads/libcthreads_read_write_lock.c --- libfvde-20170930/libcthreads/libcthreads_read_write_lock.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcthreads/libcthreads_read_write_lock.c 2018-01-08 20:18:59.000000000 +0000 @@ -50,7 +50,7 @@ libcthreads_internal_read_write_lock_t *internal_read_write_lock = NULL; static char *function = "libcthreads_read_write_lock_initialize"; -#if defined( WINAPI ) && ( WINVER >= 0x0400 ) && ( WINVER < 0x0600 ) +#if defined( WINAPI ) && ( WINVER > 0x0500 ) && ( WINVER < 0x0600 ) DWORD error_code = 0; #elif defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) @@ -114,7 +114,7 @@ InitializeSRWLock( &( internal_read_write_lock->slim_read_write_lock ) ); -#elif defined( WINAPI ) && ( WINVER >= 0x0400 ) +#elif defined( WINAPI ) && ( WINVER > 0x0500 ) InitializeCriticalSection( &( internal_read_write_lock->write_critical_section ) ); @@ -141,10 +141,6 @@ goto on_error; } -#elif defined( WINAPI ) - -#error libcthreads_read_write_lock_initialize for Windows earlier than NT4 not implemented - #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_rwlock_init( &( internal_read_write_lock->read_write_lock ), @@ -170,7 +166,7 @@ on_error: if( internal_read_write_lock != NULL ) { -#if defined( WINAPI ) && ( WINVER >= 0x0400 ) && ( WINVER < 0x0600 ) +#if defined( WINAPI ) && ( WINVER > 0x0500 ) && ( WINVER < 0x0600 ) DeleteCriticalSection( &( internal_read_write_lock->read_critical_section ) ); @@ -194,7 +190,7 @@ static char *function = "libcthreads_read_write_lock_free"; int result = 1; -#if defined( WINAPI ) && ( WINVER >= 0x0400 ) && ( WINVER < 0x0600 ) +#if defined( WINAPI ) && ( WINVER > 0x0500 ) && ( WINVER < 0x0600 ) DWORD error_code = 0; #elif defined( HAVE_PTHREAD_H ) && !defined( WINAPI ) @@ -217,7 +213,7 @@ internal_read_write_lock = (libcthreads_internal_read_write_lock_t *) *read_write_lock; *read_write_lock = NULL; -#if defined( WINAPI ) && ( WINVER >= 0x0400 ) && ( WINVER < 0x0600 ) +#if defined( WINAPI ) && ( WINVER > 0x0500 ) && ( WINVER < 0x0600 ) if( CloseHandle( internal_read_write_lock->no_read_event_handle ) == 0 ) { @@ -239,10 +235,6 @@ DeleteCriticalSection( &( internal_read_write_lock->write_critical_section ) ); -#elif defined( WINAPI ) && ( WINVER < 0x0400 ) - -#error libcthreads_read_write_lock_free for Windows earlier than NT4 not implemented - #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_rwlock_destroy( &( internal_read_write_lock->read_write_lock ) ); @@ -291,7 +283,7 @@ libcthreads_internal_read_write_lock_t *internal_read_write_lock = NULL; static char *function = "libcthreads_read_write_lock_grab_for_read"; -#if defined( WINAPI ) && ( WINVER >= 0x0400 ) && ( WINVER < 0x0600 ) +#if defined( WINAPI ) && ( WINVER > 0x0500 ) && ( WINVER < 0x0600 ) DWORD error_code = 0; BOOL result = 0; @@ -316,7 +308,7 @@ AcquireSRWLockShared( &( internal_read_write_lock->slim_read_write_lock ) ); -#elif defined( WINAPI ) && ( WINVER >= 0x0400 ) +#elif defined( WINAPI ) && ( WINVER > 0x0500 ) EnterCriticalSection( &( internal_read_write_lock->write_critical_section ) ); @@ -359,9 +351,6 @@ return( -1 ); } -#elif defined( WINAPI ) - -#error libcthreads_read_write_lock_grab_for_read for Windows earlier than NT4 not implemented #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_rwlock_rdlock( @@ -393,7 +382,7 @@ libcthreads_internal_read_write_lock_t *internal_read_write_lock = NULL; static char *function = "libcthreads_read_write_lock_grab_for_write"; -#if defined( WINAPI ) && ( WINVER >= 0x0400 ) && ( WINVER < 0x0600 ) +#if defined( WINAPI ) && ( WINVER > 0x0500 ) && ( WINVER < 0x0600 ) DWORD error_code = 0; DWORD wait_status = 0; @@ -418,7 +407,7 @@ AcquireSRWLockExclusive( &( internal_read_write_lock->slim_read_write_lock ) ); -#elif defined( WINAPI ) && ( WINVER >= 0x0400 ) +#elif defined( WINAPI ) && ( WINVER > 0x0500 ) EnterCriticalSection( &( internal_read_write_lock->write_critical_section ) ); @@ -443,9 +432,6 @@ return( -1 ); } -#elif defined( WINAPI ) - -#error libcthreads_read_write_lock_grab_for_write for Windows earlier than NT4 not implemented #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_rwlock_wrlock( @@ -477,7 +463,7 @@ libcthreads_internal_read_write_lock_t *internal_read_write_lock = NULL; static char *function = "libcthreads_read_write_lock_release_for_read"; -#if defined( WINAPI ) && ( WINVER >= 0x0400 ) && ( WINVER < 0x0600 ) +#if defined( WINAPI ) && ( WINVER > 0x0500 ) && ( WINVER < 0x0600 ) DWORD error_code = 0; BOOL result = 0; @@ -502,7 +488,7 @@ ReleaseSRWLockShared( &( internal_read_write_lock->slim_read_write_lock ) ); -#elif defined( WINAPI ) && ( WINVER >= 0x0400 ) +#elif defined( WINAPI ) && ( WINVER > 0x0500 ) EnterCriticalSection( &( internal_read_write_lock->read_critical_section ) ); @@ -539,9 +525,6 @@ return( -1 ); } -#elif defined( WINAPI ) - -#error libcthreads_read_write_lock_release_for_read for Windows earlier than NT4 not implemented #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_rwlock_unlock( @@ -594,14 +577,10 @@ ReleaseSRWLockExclusive( &( internal_read_write_lock->slim_read_write_lock ) ); -#elif defined( WINAPI ) && ( WINVER >= 0x0400 ) +#elif defined( WINAPI ) && ( WINVER > 0x0500 ) LeaveCriticalSection( &( internal_read_write_lock->write_critical_section ) ); -#elif defined( WINAPI ) - -#error libcthreads_read_write_lock_release_for_write for Windows earlier than NT4 not implemented - #elif defined( HAVE_PTHREAD_H ) pthread_result = pthread_rwlock_unlock( &( internal_read_write_lock->read_write_lock ) ); diff -Nru libfvde-20170930/libcthreads/libcthreads_read_write_lock.h libfvde-20180108/libcthreads/libcthreads_read_write_lock.h --- libfvde-20170930/libcthreads/libcthreads_read_write_lock.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libcthreads/libcthreads_read_write_lock.h 2018-01-08 20:18:59.000000000 +0000 @@ -52,7 +52,7 @@ */ SRWLOCK slim_read_write_lock; -#elif defined( WINAPI ) +#elif defined( WINAPI ) && ( WINVER > 0x0500 ) /* The read critical section */ CRITICAL_SECTION read_critical_section; @@ -69,6 +69,11 @@ */ HANDLE no_read_event_handle; +#elif defined( WINAPI ) + +/* TODO */ +#error WINAPI read/write lock for Windows 2000 or earlier NOT implemented yet + #elif defined( HAVE_PTHREAD_H ) /* The read/write lock */ diff -Nru libfvde-20170930/libcthreads/Makefile.in libfvde-20180108/libcthreads/Makefile.in --- libfvde-20170930/libcthreads/Makefile.in 2017-10-04 19:28:15.000000000 +0000 +++ libfvde-20180108/libcthreads/Makefile.in 2018-01-08 20:19:37.000000000 +0000 @@ -506,6 +506,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/libfcache/libfcache_cache_value.h libfvde-20180108/libfcache/libfcache_cache_value.h --- libfvde-20170930/libfcache/libfcache_cache_value.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libfcache/libfcache_cache_value.h 2018-01-08 20:19:02.000000000 +0000 @@ -69,7 +69,6 @@ libfcache_cache_value_t **cache_value, libcerror_error_t **error ); -LIBFCACHE_EXTERN \ int libfcache_cache_value_free( libfcache_cache_value_t **cache_value, libcerror_error_t **error ); diff -Nru libfvde-20170930/libfcache/libfcache_definitions.h libfvde-20180108/libfcache/libfcache_definitions.h --- libfvde-20170930/libfcache/libfcache_definitions.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libfcache/libfcache_definitions.h 2018-01-08 20:19:02.000000000 +0000 @@ -33,11 +33,11 @@ * for local use of libfcache */ #else -#define LIBFCACHE_VERSION 20170904 +#define LIBFCACHE_VERSION 20170111 /* The libfcache version string */ -#define LIBFCACHE_VERSION_STRING "20170904" +#define LIBFCACHE_VERSION_STRING "20170111" /* The cache value flags definitions */ diff -Nru libfvde-20170930/libfcache/Makefile.in libfvde-20180108/libfcache/Makefile.in --- libfvde-20170930/libfcache/Makefile.in 2017-10-04 19:28:15.000000000 +0000 +++ libfvde-20180108/libfcache/Makefile.in 2018-01-08 20:19:37.000000000 +0000 @@ -494,6 +494,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/libfdata/libfdata_definitions.h libfvde-20180108/libfdata/libfdata_definitions.h --- libfvde-20170930/libfdata/libfdata_definitions.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libfdata/libfdata_definitions.h 2018-01-08 20:19:05.000000000 +0000 @@ -33,11 +33,11 @@ * for local use of libfdata */ #else -#define LIBFDATA_VERSION 20170905 +#define LIBFDATA_VERSION 20170112 /* The libfdata version string */ -#define LIBFDATA_VERSION_STRING "20170905" +#define LIBFDATA_VERSION_STRING "20170112" /* The library flag definitions */ diff -Nru libfvde-20170930/libfdata/Makefile.in libfvde-20180108/libfdata/Makefile.in --- libfvde-20170930/libfdata/Makefile.in 2017-10-04 19:28:15.000000000 +0000 +++ libfvde-20180108/libfdata/Makefile.in 2018-01-08 20:19:37.000000000 +0000 @@ -513,6 +513,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/libfguid/libfguid_definitions.h libfvde-20180108/libfguid/libfguid_definitions.h --- libfvde-20170930/libfguid/libfguid_definitions.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libfguid/libfguid_definitions.h 2018-01-08 20:19:07.000000000 +0000 @@ -36,11 +36,11 @@ #else #include -#define LIBFGUID_VERSION 20170906 +#define LIBFGUID_VERSION 20170112 /* The version string */ -#define LIBFGUID_VERSION_STRING "20170906" +#define LIBFGUID_VERSION_STRING "20170112" /* The byte order definitions */ diff -Nru libfvde-20170930/libfguid/Makefile.in libfvde-20180108/libfguid/Makefile.in --- libfvde-20170930/libfguid/Makefile.in 2017-10-04 19:28:15.000000000 +0000 +++ libfvde-20180108/libfguid/Makefile.in 2018-01-08 20:19:37.000000000 +0000 @@ -489,6 +489,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/libfplist/libfplist_definitions.h libfvde-20180108/libfplist/libfplist_definitions.h --- libfvde-20170930/libfplist/libfplist_definitions.h 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_definitions.h 2018-01-08 20:19:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal definitions * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * @@ -36,11 +36,11 @@ #else #include -#define LIBFPLIST_VERSION 20170919 +#define LIBFPLIST_VERSION 20180108 /* The version string */ -#define LIBFPLIST_VERSION_STRING "20170919" +#define LIBFPLIST_VERSION_STRING "20180108" enum LIBFPLIST_VALUE_TYPES { diff -Nru libfvde-20170930/libfplist/libfplist_error.c libfvde-20180108/libfplist/libfplist_error.c --- libfvde-20170930/libfplist/libfplist_error.c 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_error.c 2018-01-08 20:19:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * Error functions * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_error.h libfvde-20180108/libfplist/libfplist_error.h --- libfvde-20170930/libfplist/libfplist_error.h 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_error.h 2018-01-08 20:19:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * Error functions * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_extern.h libfvde-20180108/libfplist/libfplist_extern.h --- libfvde-20170930/libfplist/libfplist_extern.h 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_extern.h 2018-01-08 20:19:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal extern definition * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_libcdata.h libfvde-20180108/libfplist/libfplist_libcdata.h --- libfvde-20170930/libfplist/libfplist_libcdata.h 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_libcdata.h 2018-01-08 20:19:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libcdata header * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_libcerror.h libfvde-20180108/libfplist/libfplist_libcerror.h --- libfvde-20170930/libfplist/libfplist_libcerror.h 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_libcerror.h 2018-01-08 20:19:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libcerror header * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_libcnotify.h libfvde-20180108/libfplist/libfplist_libcnotify.h --- libfvde-20170930/libfplist/libfplist_libcnotify.h 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_libcnotify.h 2018-01-08 20:19:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libcnotify header * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_libfguid.h libfvde-20180108/libfplist/libfplist_libfguid.h --- libfvde-20170930/libfplist/libfplist_libfguid.h 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_libfguid.h 2018-01-08 20:19:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * The libfguid header wrapper * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_libfvalue.h libfvde-20180108/libfplist/libfplist_libfvalue.h --- libfvde-20170930/libfplist/libfplist_libfvalue.h 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_libfvalue.h 2018-01-08 20:19:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * The libfvalue header wrapper * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_libuna.h libfvde-20180108/libfplist/libfplist_libuna.h --- libfvde-20170930/libfplist/libfplist_libuna.h 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_libuna.h 2018-01-08 20:19:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * The libuna header wrapper * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_property.c libfvde-20180108/libfplist/libfplist_property.c --- libfvde-20170930/libfplist/libfplist_property.c 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_property.c 2018-01-08 20:19:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * Property functions * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_property.h libfvde-20180108/libfplist/libfplist_property.h --- libfvde-20170930/libfplist/libfplist_property.h 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_property.h 2018-01-08 20:19:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * Property functions * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_property_list.c libfvde-20180108/libfplist/libfplist_property_list.c --- libfvde-20170930/libfplist/libfplist_property_list.c 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_property_list.c 2018-01-08 20:19:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * Property list functions * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_property_list.h libfvde-20180108/libfplist/libfplist_property_list.h --- libfvde-20170930/libfplist/libfplist_property_list.h 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_property_list.h 2018-01-08 20:19:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * Property list functions * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_support.c libfvde-20180108/libfplist/libfplist_support.c --- libfvde-20170930/libfplist/libfplist_support.c 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_support.c 2018-01-08 20:19:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * Support functions * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_support.h libfvde-20180108/libfplist/libfplist_support.h --- libfvde-20170930/libfplist/libfplist_support.h 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_support.h 2018-01-08 20:19:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * Support functions * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_types.h libfvde-20180108/libfplist/libfplist_types.h --- libfvde-20170930/libfplist/libfplist_types.h 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_types.h 2018-01-08 20:19:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal type definitions * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_unused.h libfvde-20180108/libfplist/libfplist_unused.h --- libfvde-20170930/libfplist/libfplist_unused.h 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_unused.h 2018-01-08 20:19:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal unused definition * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_xml_attribute.c libfvde-20180108/libfplist/libfplist_xml_attribute.c --- libfvde-20170930/libfplist/libfplist_xml_attribute.c 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_xml_attribute.c 2018-01-08 20:19:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * XML attribute functions * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_xml_attribute.h libfvde-20180108/libfplist/libfplist_xml_attribute.h --- libfvde-20170930/libfplist/libfplist_xml_attribute.h 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_xml_attribute.h 2018-01-08 20:19:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * XML attribute functions * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_xml_parser.c libfvde-20180108/libfplist/libfplist_xml_parser.c --- libfvde-20170930/libfplist/libfplist_xml_parser.c 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_xml_parser.c 2018-01-08 20:20:24.000000000 +0000 @@ -75,7 +75,7 @@ /* * XML parser functions * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_xml_parser.y libfvde-20180108/libfplist/libfplist_xml_parser.y --- libfvde-20170930/libfplist/libfplist_xml_parser.y 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_xml_parser.y 2018-01-08 20:19:10.000000000 +0000 @@ -2,7 +2,7 @@ /* * XML parser functions * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_xml_scanner.c libfvde-20180108/libfplist/libfplist_xml_scanner.c --- libfvde-20170930/libfplist/libfplist_xml_scanner.c 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_xml_scanner.c 2018-01-08 20:20:26.000000000 +0000 @@ -2871,7 +2871,7 @@ /* * XML scanner functions * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_xml_scanner.l libfvde-20180108/libfplist/libfplist_xml_scanner.l --- libfvde-20170930/libfplist/libfplist_xml_scanner.l 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_xml_scanner.l 2018-01-08 20:19:10.000000000 +0000 @@ -7,7 +7,7 @@ /* * XML scanner functions * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_xml_tag.c libfvde-20180108/libfplist/libfplist_xml_tag.c --- libfvde-20170930/libfplist/libfplist_xml_tag.c 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_xml_tag.c 2018-01-08 20:19:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * XML tag functions * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/libfplist_xml_tag.h libfvde-20180108/libfplist/libfplist_xml_tag.h --- libfvde-20170930/libfplist/libfplist_xml_tag.h 2017-09-19 06:01:19.000000000 +0000 +++ libfvde-20180108/libfplist/libfplist_xml_tag.h 2018-01-08 20:19:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * XML tag functions * - * Copyright (C) 2016-2017, Joachim Metz + * Copyright (C) 2016-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfplist/Makefile.in libfvde-20180108/libfplist/Makefile.in --- libfvde-20170930/libfplist/Makefile.in 2017-10-04 19:28:15.000000000 +0000 +++ libfvde-20180108/libfplist/Makefile.in 2018-01-08 20:19:37.000000000 +0000 @@ -520,6 +520,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/libfvalue/libfvalue_definitions.h libfvde-20180108/libfvalue/libfvalue_definitions.h --- libfvde-20170930/libfvalue/libfvalue_definitions.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libfvalue/libfvalue_definitions.h 2018-01-08 20:19:12.000000000 +0000 @@ -36,11 +36,11 @@ #else #include -#define LIBFVALUE_VERSION 20170908 +#define LIBFVALUE_VERSION 20170113 /* The libfvalue version string */ -#define LIBFVALUE_VERSION_STRING "20170908" +#define LIBFVALUE_VERSION_STRING "20170113" /* The endian definitions */ diff -Nru libfvde-20170930/libfvalue/libfvalue_libuna.h libfvde-20180108/libfvalue/libfvalue_libuna.h --- libfvde-20170930/libfvalue/libfvalue_libuna.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libfvalue/libfvalue_libuna.h 2018-01-08 20:19:12.000000000 +0000 @@ -3,8 +3,6 @@ * * Copyright (C) 2010-2017, Joachim Metz * - * Refer to AUTHORS for acknowledgements. - * * This software is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or diff -Nru libfvde-20170930/libfvalue/libfvalue_types.h libfvde-20180108/libfvalue/libfvalue_types.h --- libfvde-20170930/libfvalue/libfvalue_types.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libfvalue/libfvalue_types.h 2018-01-08 20:19:12.000000000 +0000 @@ -35,15 +35,15 @@ */ #if defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) typedef struct libfvalue_data_handle {} libfvalue_data_handle_t; -typedef struct libfvalue_split_utf16_string {} libfvalue_split_utf16_string_t; typedef struct libfvalue_split_utf8_string {} libfvalue_split_utf8_string_t; +typedef struct libfvalue_split_utf16_string {} libfvalue_split_utf16_string_t; typedef struct libfvalue_table {} libfvalue_table_t; typedef struct libfvalue_value {} libfvalue_value_t; #else typedef intptr_t libfvalue_data_handle_t; -typedef intptr_t libfvalue_split_utf16_string_t; typedef intptr_t libfvalue_split_utf8_string_t; +typedef intptr_t libfvalue_split_utf16_string_t; typedef intptr_t libfvalue_table_t; typedef intptr_t libfvalue_value_t; diff -Nru libfvde-20170930/libfvalue/Makefile.in libfvde-20180108/libfvalue/Makefile.in --- libfvde-20170930/libfvalue/Makefile.in 2017-10-04 19:28:15.000000000 +0000 +++ libfvde-20180108/libfvalue/Makefile.in 2018-01-08 20:19:37.000000000 +0000 @@ -512,6 +512,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/libfvde/fvde_metadata.h libfvde-20180108/libfvde/fvde_metadata.h --- libfvde-20170930/libfvde/fvde_metadata.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/fvde_metadata.h 2018-01-08 17:42:47.000000000 +0000 @@ -2,7 +2,7 @@ * The MacOS-X File Vault disk encryption (FVDE) metadata definition * (also known as CoreStorage) * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/fvde_volume.h libfvde-20180108/libfvde/fvde_volume.h --- libfvde-20170930/libfvde/fvde_volume.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/fvde_volume.h 2018-01-08 17:42:47.000000000 +0000 @@ -2,7 +2,7 @@ * The MacOS-X File Vault disk encryption (FVDE) volume definition * (also known as CoreStorage) * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde.c libfvde-20180108/libfvde/libfvde.c --- libfvde-20170930/libfvde/libfvde.c 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Library to access the FileVault Drive Encryption (FVDE) format * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_checksum.c libfvde-20180108/libfvde/libfvde_checksum.c --- libfvde-20170930/libfvde/libfvde_checksum.c 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_checksum.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Checksum functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfvde/libfvde_checksum.h libfvde-20180108/libfvde/libfvde_checksum.h --- libfvde-20170930/libfvde/libfvde_checksum.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_checksum.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Checksum functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfvde/libfvde_codepage.h libfvde-20180108/libfvde/libfvde_codepage.h --- libfvde-20170930/libfvde/libfvde_codepage.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_codepage.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Codepage functions * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_compression.c libfvde-20180108/libfvde/libfvde_compression.c --- libfvde-20170930/libfvde/libfvde_compression.c 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_compression.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Compression handling functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfvde/libfvde_compression.h libfvde-20180108/libfvde/libfvde_compression.h --- libfvde-20170930/libfvde/libfvde_compression.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_compression.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Compression handling functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfvde/libfvde_data_area_descriptor.c libfvde-20180108/libfvde/libfvde_data_area_descriptor.c --- libfvde-20170930/libfvde/libfvde_data_area_descriptor.c 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_data_area_descriptor.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Data area descriptor functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_data_area_descriptor.h libfvde-20180108/libfvde/libfvde_data_area_descriptor.h --- libfvde-20170930/libfvde/libfvde_data_area_descriptor.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_data_area_descriptor.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Data area descriptor functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_debug.c libfvde-20180108/libfvde/libfvde_debug.c --- libfvde-20170930/libfvde/libfvde_debug.c 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_debug.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Debug functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_debug.h libfvde-20180108/libfvde/libfvde_debug.h --- libfvde-20170930/libfvde/libfvde_debug.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_debug.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Debug functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_definitions.h libfvde-20180108/libfvde/libfvde_definitions.h --- libfvde-20170930/libfvde/libfvde_definitions.h 2017-10-04 19:28:35.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_definitions.h 2018-01-08 20:19:52.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal definitions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. @@ -38,11 +38,11 @@ * for local use of libfvde */ #else -#define LIBFVDE_VERSION 20170930 +#define LIBFVDE_VERSION 20180108 /* The version string */ -#define LIBFVDE_VERSION_STRING "20170930" +#define LIBFVDE_VERSION_STRING "20180108" /* The file access * bit 1 set to 1 for read access diff -Nru libfvde-20170930/libfvde/libfvde_definitions.h.in libfvde-20180108/libfvde/libfvde_definitions.h.in --- libfvde-20170930/libfvde/libfvde_definitions.h.in 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_definitions.h.in 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal definitions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_deflate.c libfvde-20180108/libfvde/libfvde_deflate.c --- libfvde-20170930/libfvde/libfvde_deflate.c 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_deflate.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Deflate (zlib) (un)compression functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfvde/libfvde_deflate.h libfvde-20180108/libfvde/libfvde_deflate.h --- libfvde-20170930/libfvde/libfvde_deflate.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_deflate.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Deflate (zlib) (un)compression functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/libfvde/libfvde_encrypted_metadata.c libfvde-20180108/libfvde/libfvde_encrypted_metadata.c --- libfvde-20170930/libfvde/libfvde_encrypted_metadata.c 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_encrypted_metadata.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Encrypted metadata functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. @@ -43,6 +43,7 @@ #include "libfvde_libfvalue.h" #include "libfvde_metadata_block.h" #include "libfvde_password.h" +#include "libfvde_segment_descriptor.h" #include "fvde_metadata.h" @@ -140,7 +141,21 @@ error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, - "%s: unable to create date array descriptors array.", + "%s: unable to create data area descriptors array.", + function ); + + goto on_error; + } + if( libcdata_array_initialize( + &( ( *encrypted_metadata )->segment_descriptors ), + 0, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED, + "%s: unable to create segment descriptors array.", function ); goto on_error; @@ -150,6 +165,13 @@ on_error: if( *encrypted_metadata != NULL ) { + if( ( *encrypted_metadata )->data_area_descriptors != NULL ) + { + libcdata_array_free( + &( ( *encrypted_metadata )->data_area_descriptors ), + NULL, + NULL ); + } if( ( *encrypted_metadata )->encryption_context_plist != NULL ) { libfvde_encryption_context_plist_free( @@ -200,6 +222,23 @@ result = -1; } + if( ( *encrypted_metadata )->segment_descriptors != NULL ) + { + if( libcdata_array_free( + &( ( *encrypted_metadata )->segment_descriptors ), + (int (*)(intptr_t **, libcerror_error_t **)) &libfvde_segment_descriptor_free, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free segment descriptors array.", + function ); + + result = -1; + } + } if( ( *encrypted_metadata )->data_area_descriptors != NULL ) { if( libcdata_array_free( @@ -675,14 +714,23 @@ #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) { - byte_stream_copy_to_uint64_little_endian( + byte_stream_copy_to_uint32_little_endian( &( block_data[ block_data_offset ] ), - value_64bit ); + value_32bit ); libcnotify_printf( - "%s: entry2: %03d unknown1\t\t: 0x%08" PRIx64 "\n", + "%s: entry2: %03d unknown1\t\t: 0x%08" PRIx32 "\n", function, entry_index, - value_64bit ); + value_32bit ); + + byte_stream_copy_to_uint32_little_endian( + &( block_data[ block_data_offset + 4 ] ), + value_32bit ); + libcnotify_printf( + "%s: entry2: %03d unknown2\t\t: 0x%08" PRIx32 "\n", + function, + entry_index, + value_32bit ); } #endif block_data_offset += 8; @@ -882,7 +930,7 @@ &( block_data[ 24 ] ), value_64bit ); libcnotify_printf( - "%s: unknown1\t\t\t\t: 0x%08" PRIx64 "\n", + "%s: block number1\t\t\t: %" PRIu64 "\n", function, value_64bit ); @@ -2232,7 +2280,7 @@ &( block_data[ block_data_offset + 16 ] ), value_64bit ); libcnotify_printf( - "%s: entry: %02d unknown3\t\t: 0x%08" PRIx64 "\n", + "%s: entry: %02d block number1\t: %" PRIu64 "\n", function, entry_index, value_64bit ); @@ -2241,7 +2289,7 @@ &( block_data[ block_data_offset + 24 ] ), value_64bit ); libcnotify_printf( - "%s: entry: %02d unknown4\t\t: 0x%08" PRIx64 "\n", + "%s: entry: %02d block number2\t: %" PRIu64 "\n", function, entry_index, value_64bit ); @@ -3087,16 +3135,18 @@ uint64_t block_group, libcerror_error_t **error ) { - static char *function = "libfvde_encrypted_metadata_read_type_0x0305"; - size_t block_data_offset = 0; - uint32_t block_number = 0; - uint32_t entry_index = 0; - uint32_t number_of_blocks = 0; - uint32_t number_of_entries = 0; + libfvde_segment_descriptor_t *segment_descriptor = NULL; + static char *function = "libfvde_encrypted_metadata_read_type_0x0305"; + size_t block_data_offset = 0; + uint32_t block_number = 0xffffffffUL; + uint32_t entry_index = 0; + uint32_t number_of_blocks = 0; + uint32_t number_of_entries = 0; + int segment_descriptor_index = 0; #if defined( HAVE_DEBUG_OUTPUT ) - uint64_t value_64bit = 0; - uint32_t value_32bit = 0; + uint64_t value_64bit = 0; + uint32_t value_32bit = 0; #endif if( encrypted_metadata == NULL ) @@ -3169,6 +3219,25 @@ #endif block_data_offset = 8; + /* Use the most recent 0x0305 metadata block + */ + if( encrypted_metadata->block_group_0x0305 < block_group ) + { + if( libcdata_array_empty( + encrypted_metadata->segment_descriptors, + (int (*)(intptr_t **, libcerror_error_t **)) &libfvde_segment_descriptor_free, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to empty segment descriptors array.", + function ); + + goto on_error; + } + } if( number_of_entries > 0 ) { if( ( (size_t) number_of_entries * 40 ) > ( block_data_size - block_data_offset ) ) @@ -3180,19 +3249,36 @@ "%s: invalid number of entries value out of bounds.", function ); - return( -1 ); + goto on_error; } for( entry_index = 0; entry_index < number_of_entries; entry_index++ ) { + if( libfvde_segment_descriptor_initialize( + &segment_descriptor, + error ) == -1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ENCRYPTION, + LIBCERROR_ENCRYPTION_ERROR_GENERIC, + "%s: unable to create segment descriptor.", + function ); + + goto on_error; + } + byte_stream_copy_to_uint64_little_endian( + &( block_data[ block_data_offset + 8 ] ), + segment_descriptor->logical_block_number ); + byte_stream_copy_to_uint32_little_endian( &( block_data[ block_data_offset + 16 ] ), - number_of_blocks ); + segment_descriptor->number_of_blocks ); byte_stream_copy_to_uint32_little_endian( &( block_data[ block_data_offset + 32 ] ), - block_number ); + segment_descriptor->physical_block_number ); #if defined( HAVE_DEBUG_OUTPUT ) if( libcnotify_verbose != 0 ) @@ -3206,20 +3292,17 @@ entry_index, value_64bit ); - byte_stream_copy_to_uint64_little_endian( - &( block_data[ block_data_offset + 8 ] ), - value_64bit ); libcnotify_printf( "%s: entry: %03d logical block number\t: %" PRIi64 "\n", function, entry_index, - value_64bit ); + segment_descriptor->logical_block_number ); libcnotify_printf( "%s: entry: %03d number of blocks\t: %" PRIu32 "\n", function, entry_index, - number_of_blocks ); + segment_descriptor->number_of_blocks ); byte_stream_copy_to_uint32_little_endian( &( block_data[ block_data_offset + 20 ] ), @@ -3252,7 +3335,7 @@ "%s: entry: %03d physical block number\t: %" PRIu32 "\n", function, entry_index, - block_number ); + segment_descriptor->physical_block_number ); byte_stream_copy_to_uint32_little_endian( &( block_data[ block_data_offset + 36 ] ), @@ -3268,9 +3351,48 @@ } #endif block_data_offset += 40; + + if( encrypted_metadata->block_group_0x0305 < block_group ) + { + if( libcdata_array_append_entry( + encrypted_metadata->segment_descriptors, + &segment_descriptor_index, + (intptr_t *) segment_descriptor, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_APPEND_FAILED, + "%s: unable to append segment descriptor to array.", + function ); + + goto on_error; + } + if( block_number > segment_descriptor->physical_block_number ) + { + block_number = segment_descriptor->physical_block_number; + } + number_of_blocks += segment_descriptor->number_of_blocks; + segment_descriptor = NULL; + } + else + { + if( libfvde_segment_descriptor_free( + &segment_descriptor, + error ) != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED, + "%s: unable to free segment descriptor.", + function ); + + goto on_error; + } + } } - /* Use the most recent 0x0305 metadata block - */ if( encrypted_metadata->block_group_0x0305 < block_group ) { if( number_of_entries == 1 ) @@ -3283,6 +3405,15 @@ } } return( 1 ); + +on_error: + if( segment_descriptor != NULL ) + { + libfvde_segment_descriptor_free( + &segment_descriptor, + NULL ); + } + return( -1 ); } /* Reads the encrypted metadata block type 0x00404 diff -Nru libfvde-20170930/libfvde/libfvde_encrypted_metadata.h libfvde-20180108/libfvde/libfvde_encrypted_metadata.h --- libfvde-20170930/libfvde/libfvde_encrypted_metadata.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_encrypted_metadata.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Encrypted metadata functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. @@ -104,6 +104,10 @@ */ uint64_t logical_volume_number_of_blocks_0x0505; + /* The segment descriptors + */ + libcdata_array_t *segment_descriptors; + /* The data area descriptors */ libcdata_array_t *data_area_descriptors; diff -Nru libfvde-20170930/libfvde/libfvde_encryption.c libfvde-20180108/libfvde/libfvde_encryption.c --- libfvde-20170930/libfvde/libfvde_encryption.c 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_encryption.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Encryption functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_encryption_context_plist.c libfvde-20180108/libfvde/libfvde_encryption_context_plist.c --- libfvde-20170930/libfvde/libfvde_encryption_context_plist.c 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_encryption_context_plist.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * LVF encryption context and EncryptedRoot.plist file functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_encryption_context_plist.h libfvde-20180108/libfvde/libfvde_encryption_context_plist.h --- libfvde-20170930/libfvde/libfvde_encryption_context_plist.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_encryption_context_plist.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * LVF encryption context and EncryptedRoot.plist file functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_encryption.h libfvde-20180108/libfvde/libfvde_encryption.h --- libfvde-20170930/libfvde/libfvde_encryption.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_encryption.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Encryption functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_error.c libfvde-20180108/libfvde/libfvde_error.c --- libfvde-20170930/libfvde/libfvde_error.c 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_error.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Error functions * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_error.h libfvde-20180108/libfvde/libfvde_error.h --- libfvde-20170930/libfvde/libfvde_error.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_error.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Error functions * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_extern.h libfvde-20180108/libfvde/libfvde_extern.h --- libfvde-20170930/libfvde/libfvde_extern.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_extern.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal extern definition * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_io_handle.c libfvde-20180108/libfvde/libfvde_io_handle.c --- libfvde-20170930/libfvde/libfvde_io_handle.c 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_io_handle.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Input/Output (IO) handle functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_io_handle.h libfvde-20180108/libfvde/libfvde_io_handle.h --- libfvde-20170930/libfvde/libfvde_io_handle.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_io_handle.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Input/Output (IO) handle functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. @@ -36,6 +36,8 @@ extern "C" { #endif +extern const char *libfvde_core_storage_signature; + typedef struct libfvde_io_handle libfvde_io_handle_t; struct libfvde_io_handle diff -Nru libfvde-20170930/libfvde/libfvde_keyring.c libfvde-20180108/libfvde/libfvde_keyring.c --- libfvde-20170930/libfvde/libfvde_keyring.c 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_keyring.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Keyring functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_keyring.h libfvde-20180108/libfvde/libfvde_keyring.h --- libfvde-20170930/libfvde/libfvde_keyring.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_keyring.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Keyring functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_legacy.c libfvde-20180108/libfvde/libfvde_legacy.c --- libfvde-20170930/libfvde/libfvde_legacy.c 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_legacy.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Legacy functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_legacy.h libfvde-20180108/libfvde/libfvde_legacy.h --- libfvde-20170930/libfvde/libfvde_legacy.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_legacy.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Legacy functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_libbfio.h libfvde-20180108/libfvde/libfvde_libbfio.h --- libfvde-20170930/libfvde/libfvde_libbfio.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_libbfio.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The libbfio header wrapper * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_libcaes.h libfvde-20180108/libfvde/libfvde_libcaes.h --- libfvde-20170930/libfvde/libfvde_libcaes.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_libcaes.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libcaes header * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_libcdata.h libfvde-20180108/libfvde/libfvde_libcdata.h --- libfvde-20170930/libfvde/libfvde_libcdata.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_libcdata.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libcdata header * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_libcerror.h libfvde-20180108/libfvde/libfvde_libcerror.h --- libfvde-20170930/libfvde/libfvde_libcerror.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_libcerror.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libcerror header * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_libclocale.h libfvde-20180108/libfvde/libfvde_libclocale.h --- libfvde-20170930/libfvde/libfvde_libclocale.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_libclocale.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libclocale header * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_libcnotify.h libfvde-20180108/libfvde/libfvde_libcnotify.h --- libfvde-20170930/libfvde/libfvde_libcnotify.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_libcnotify.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libcnotify header * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_libcthreads.h libfvde-20180108/libfvde/libfvde_libcthreads.h --- libfvde-20170930/libfvde/libfvde_libcthreads.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_libcthreads.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libcthreads header * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_libfcache.h libfvde-20180108/libfvde/libfvde_libfcache.h --- libfvde-20170930/libfvde/libfvde_libfcache.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_libfcache.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libfcache header * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_libfdata.h libfvde-20180108/libfvde/libfvde_libfdata.h --- libfvde-20170930/libfvde/libfvde_libfdata.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_libfdata.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The libfdata header wrapper * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_libfguid.h libfvde-20180108/libfvde/libfvde_libfguid.h --- libfvde-20170930/libfvde/libfvde_libfguid.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_libfguid.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The libfguid header wrapper * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_libfplist.h libfvde-20180108/libfvde/libfvde_libfplist.h --- libfvde-20170930/libfvde/libfvde_libfplist.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_libfplist.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The libfplist header wrapper * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_libfvalue.h libfvde-20180108/libfvde/libfvde_libfvalue.h --- libfvde-20170930/libfvde/libfvde_libfvalue.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_libfvalue.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The libfvalue header wrapper * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_libhmac.h libfvde-20180108/libfvde/libfvde_libhmac.h --- libfvde-20170930/libfvde/libfvde_libhmac.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_libhmac.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libhmac header * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_libuna.h libfvde-20180108/libfvde/libfvde_libuna.h --- libfvde-20170930/libfvde/libfvde_libuna.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_libuna.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The libuna header wrapper * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_metadata_block.c libfvde-20180108/libfvde/libfvde_metadata_block.c --- libfvde-20170930/libfvde/libfvde_metadata_block.c 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_metadata_block.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Metadata block functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. @@ -362,7 +362,7 @@ if( metadata_block->is_lvf_wiped == 0 ) { libcnotify_printf( - "%s: checksum\t\t\t\t\t: 0x%08" PRIx32 "\n", + "%s: checksum\t\t\t\t: 0x%08" PRIx32 "\n", function, stored_checksum ); @@ -374,11 +374,11 @@ else { libcnotify_printf( - "%s: signature\t\t\t\t\t: LVFwiped\n", + "%s: signature\t\t\t\t: LVFwiped\n", function ); } libcnotify_printf( - "%s: version\t\t\t\t\t: %" PRIu16 "\n", + "%s: version\t\t\t\t: %" PRIu16 "\n", function, version ); @@ -401,12 +401,12 @@ ( (fvde_metadata_block_header_t *) block_data )->unknown3, value_64bit ); libcnotify_printf( - "%s: unknown3\t\t\t\t\t: 0x%08" PRIx64 "\n", + "%s: unknown3\t\t\t\t: 0x%08" PRIx64 "\n", function, value_64bit ); libcnotify_printf( - "%s: number\t\t\t\t\t: %" PRIu64 "\n", + "%s: number\t\t\t\t: %" PRIu64 "\n", function, metadata_block->number ); @@ -414,7 +414,7 @@ ( (fvde_metadata_block_header_t *) block_data )->unknown5, value_64bit ); libcnotify_printf( - "%s: unknown5\t\t\t\t\t: 0x%08" PRIx64 "\n", + "%s: unknown5\t\t\t\t: 0x%08" PRIx64 "\n", function, value_64bit ); @@ -427,7 +427,7 @@ ( (fvde_metadata_block_header_t *) block_data )->unknown6, value_32bit ); libcnotify_printf( - "%s: unknown6\t\t\t\t\t: 0x%08" PRIx32 "\n", + "%s: unknown6\t\t\t\t: 0x%08" PRIx32 "\n", function, value_32bit ); @@ -435,7 +435,7 @@ ( (fvde_metadata_block_header_t *) block_data )->unknown7, value_64bit ); libcnotify_printf( - "%s: unknown7\t\t\t\t\t: 0x%08" PRIx64 "\n", + "%s: unknown7\t\t\t\t: 0x%08" PRIx64 "\n", function, value_64bit ); diff -Nru libfvde-20170930/libfvde/libfvde_metadata_block.h libfvde-20180108/libfvde/libfvde_metadata_block.h --- libfvde-20170930/libfvde/libfvde_metadata_block.h 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_metadata_block.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Metadata block functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_metadata.c libfvde-20180108/libfvde/libfvde_metadata.c --- libfvde-20170930/libfvde/libfvde_metadata.c 2017-09-30 13:37:23.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_metadata.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Metadata functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_metadata.h libfvde-20180108/libfvde/libfvde_metadata.h --- libfvde-20170930/libfvde/libfvde_metadata.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_metadata.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Metadata functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_notify.c libfvde-20180108/libfvde/libfvde_notify.c --- libfvde-20170930/libfvde/libfvde_notify.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_notify.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Notification functions * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_notify.h libfvde-20180108/libfvde/libfvde_notify.h --- libfvde-20170930/libfvde/libfvde_notify.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_notify.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Notification functions * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_password.c libfvde-20180108/libfvde/libfvde_password.c --- libfvde-20170930/libfvde/libfvde_password.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_password.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Password functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_password.h libfvde-20180108/libfvde/libfvde_password.h --- libfvde-20170930/libfvde/libfvde_password.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_password.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Password functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde.rc libfvde-20180108/libfvde/libfvde.rc --- libfvde-20170930/libfvde/libfvde.rc 2017-10-04 19:28:35.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde.rc 2018-01-08 20:19:52.000000000 +0000 @@ -22,12 +22,12 @@ BLOCK "040904E4" BEGIN VALUE "FileDescription", "Library to access the FileVault Drive Encryption (FVDE) format\0" - VALUE "FileVersion", "20170930" "\0" + VALUE "FileVersion", "20180108" "\0" VALUE "InternalName", "libfvde.dll\0" - VALUE "LegalCopyright", "(C) 2011-2017, Omar Choudary , Joachim Metz \0" + VALUE "LegalCopyright", "(C) 2011-2018, Omar Choudary , Joachim Metz \0" VALUE "OriginalFilename", "libfvde.dll\0" VALUE "ProductName", "libfvde\0" - VALUE "ProductVersion", "20170930" "\0" + VALUE "ProductVersion", "20180108" "\0" VALUE "Comments", "For more information visit https://github.com/libyal/libfvde/\0" END END diff -Nru libfvde-20170930/libfvde/libfvde.rc.in libfvde-20180108/libfvde/libfvde.rc.in --- libfvde-20170930/libfvde/libfvde.rc.in 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde.rc.in 2018-01-08 17:42:47.000000000 +0000 @@ -24,7 +24,7 @@ VALUE "FileDescription", "Library to access the FileVault Drive Encryption (FVDE) format\0" VALUE "FileVersion", "@VERSION@" "\0" VALUE "InternalName", "libfvde.dll\0" - VALUE "LegalCopyright", "(C) 2011-2017, Omar Choudary , Joachim Metz \0" + VALUE "LegalCopyright", "(C) 2011-2018, Omar Choudary , Joachim Metz \0" VALUE "OriginalFilename", "libfvde.dll\0" VALUE "ProductName", "libfvde\0" VALUE "ProductVersion", "@VERSION@" "\0" diff -Nru libfvde-20170930/libfvde/libfvde_sector_data.c libfvde-20180108/libfvde/libfvde_sector_data.c --- libfvde-20170930/libfvde/libfvde_sector_data.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_sector_data.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Sector data functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_sector_data.h libfvde-20180108/libfvde/libfvde_sector_data.h --- libfvde-20170930/libfvde/libfvde_sector_data.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_sector_data.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Sector data functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_segment_descriptor.c libfvde-20180108/libfvde/libfvde_segment_descriptor.c --- libfvde-20170930/libfvde/libfvde_segment_descriptor.c 1970-01-01 00:00:00.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_segment_descriptor.c 2018-01-08 17:42:47.000000000 +0000 @@ -0,0 +1,137 @@ +/* + * Segment descriptor functions + * + * Copyright (C) 2011-2018, Omar Choudary + * Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This software is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software. If not, see . + */ + +#include +#include +#include + +#include "libfvde_libcerror.h" +#include "libfvde_segment_descriptor.h" + +/* Creates data area descriptor + * Make sure the value segment_descriptor is referencing, is set to NULL + * Returns 1 if successful or -1 on error + */ +int libfvde_segment_descriptor_initialize( + libfvde_segment_descriptor_t **segment_descriptor, + libcerror_error_t **error ) +{ + static char *function = "libfvde_segment_descriptor_initialize"; + + if( segment_descriptor == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid data area descriptor.", + function ); + + return( -1 ); + } + if( *segment_descriptor != NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET, + "%s: invalid data area descriptor value already set.", + function ); + + return( -1 ); + } + *segment_descriptor = memory_allocate_structure( + libfvde_segment_descriptor_t ); + + if( *segment_descriptor == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_INSUFFICIENT, + "%s: unable to data area descriptor.", + function ); + + goto on_error; + } + if( memory_set( + *segment_descriptor, + 0, + sizeof( libfvde_segment_descriptor_t ) ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_SET_FAILED, + "%s: unable to clear data area descriptor.", + function ); + + memory_free( + *segment_descriptor ); + + *segment_descriptor = NULL; + + return( -1 ); + } + return( 1 ); + +on_error: + if( *segment_descriptor != NULL ) + { + memory_free( + *segment_descriptor ); + + *segment_descriptor = NULL; + } + return( -1 ); +} + +/* Frees data area descriptor + * Returns 1 if successful or -1 on error + */ +int libfvde_segment_descriptor_free( + libfvde_segment_descriptor_t **segment_descriptor, + libcerror_error_t **error ) +{ + static char *function = "libfvde_segment_descriptor_free"; + + if( segment_descriptor == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid data area descriptor.", + function ); + + return( -1 ); + } + if( *segment_descriptor != NULL ) + { + memory_free( + *segment_descriptor ); + + *segment_descriptor = NULL; + } + return( 1 ); +} + diff -Nru libfvde-20170930/libfvde/libfvde_segment_descriptor.h libfvde-20180108/libfvde/libfvde_segment_descriptor.h --- libfvde-20170930/libfvde/libfvde_segment_descriptor.h 1970-01-01 00:00:00.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_segment_descriptor.h 2018-01-08 17:42:47.000000000 +0000 @@ -0,0 +1,65 @@ +/* + * Segment descriptor functions + * + * Copyright (C) 2011-2018, Omar Choudary + * Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This software is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software. If not, see . + */ + +#if !defined( _LIBFVDE_SEGMENT_DESCRIPTOR_H ) +#define _LIBFVDE_SEGMENT_DESCRIPTOR_H + +#include +#include + +#include "libfvde_libcerror.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +typedef struct libfvde_segment_descriptor libfvde_segment_descriptor_t; + +struct libfvde_segment_descriptor +{ + /* The logical block number + */ + uint64_t logical_block_number; + + /* The number of blocks + */ + uint64_t number_of_blocks; + + /* The physical block number + */ + uint64_t physical_block_number; +}; + +int libfvde_segment_descriptor_initialize( + libfvde_segment_descriptor_t **segment_descriptor, + libcerror_error_t **error ); + +int libfvde_segment_descriptor_free( + libfvde_segment_descriptor_t **segment_descriptor, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _LIBFVDE_SEGMENT_DESCRIPTOR_H ) */ + diff -Nru libfvde-20170930/libfvde/libfvde_support.c libfvde-20180108/libfvde/libfvde_support.c --- libfvde-20170930/libfvde/libfvde_support.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_support.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Support functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. @@ -325,11 +325,12 @@ libbfio_handle_t *file_io_handle, libcerror_error_t **error ) { - uint8_t signature[ 12 ]; + uint8_t signature[ 2 ]; static char *function = "libfvde_check_volume_signature_file_io_handle"; ssize_t read_count = 0; int file_io_handle_is_open = 0; + int result = 0; if( file_io_handle == NULL ) { @@ -376,7 +377,7 @@ } if( libbfio_handle_seek_offset( file_io_handle, - 0, + 88, SEEK_SET, error ) == -1 ) { @@ -384,7 +385,7 @@ error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_SEEK_FAILED, - "%s: unable to seek file header offset: 0.", + "%s: unable to seek file header offset: 88.", function ); goto on_error; @@ -392,10 +393,10 @@ read_count = libbfio_handle_read_buffer( file_io_handle, signature, - 12, + 2, error ); - if( read_count != 12 ) + if( read_count != 2 ) { libcerror_error_set( error, @@ -422,7 +423,14 @@ goto on_error; } } - return( 1 ); + else if( memory_compare( + signature, + libfvde_core_storage_signature, + 2 ) == 0 ) + { + result = 1; + } + return( result ); on_error: if( file_io_handle_is_open == 0 ) diff -Nru libfvde-20170930/libfvde/libfvde_support.h libfvde-20180108/libfvde/libfvde_support.h --- libfvde-20170930/libfvde/libfvde_support.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_support.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Support functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_types.h libfvde-20180108/libfvde/libfvde_types.h --- libfvde-20170930/libfvde/libfvde_types.h 2017-09-30 13:40:08.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_types.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal type definitions * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_unused.h libfvde-20180108/libfvde/libfvde_unused.h --- libfvde-20170930/libfvde/libfvde_unused.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_unused.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal unused definition * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_volume.c libfvde-20180108/libfvde/libfvde_volume.c --- libfvde-20170930/libfvde/libfvde_volume.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_volume.c 2018-01-08 19:24:57.000000000 +0000 @@ -1,7 +1,7 @@ /* * Volume functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. @@ -1131,13 +1131,13 @@ } internal_volume = (libfvde_internal_volume_t *) volume; - if( internal_volume->io_handle == NULL ) + if( internal_volume->file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_RUNTIME, LIBCERROR_RUNTIME_ERROR_VALUE_MISSING, - "%s: invalid volume - missing IO handle.", + "%s: invalid volume - missing file IO handle.", function ); return( -1 ); diff -Nru libfvde-20170930/libfvde/libfvde_volume_group.c libfvde-20180108/libfvde/libfvde_volume_group.c --- libfvde-20170930/libfvde/libfvde_volume_group.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_volume_group.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Volume group functions * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_volume_group.h libfvde-20180108/libfvde/libfvde_volume_group.h --- libfvde-20170930/libfvde/libfvde_volume_group.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_volume_group.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Volume group functions * - * Copyright (C) 2011-2017, Omar Choudary , + * Copyright (C) 2011-2018, Omar Choudary , * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/libfvde_volume.h libfvde-20180108/libfvde/libfvde_volume.h --- libfvde-20170930/libfvde/libfvde_volume.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/libfvde/libfvde_volume.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Volume functions * - * Copyright (C) 2011-2017, Omar Choudary + * Copyright (C) 2011-2018, Omar Choudary * Joachim Metz * * Refer to AUTHORS for acknowledgements. diff -Nru libfvde-20170930/libfvde/Makefile.am libfvde-20180108/libfvde/Makefile.am --- libfvde-20170930/libfvde/Makefile.am 2016-11-09 13:19:45.000000000 +0000 +++ libfvde-20180108/libfvde/Makefile.am 2017-10-07 15:07:47.000000000 +0000 @@ -61,6 +61,7 @@ libfvde_notify.c libfvde_notify.h \ libfvde_password.c libfvde_password.h \ libfvde_sector_data.c libfvde_sector_data.h \ + libfvde_segment_descriptor.c libfvde_segment_descriptor.h \ libfvde_support.c libfvde_support.h \ libfvde_types.h \ libfvde_unused.h \ diff -Nru libfvde-20170930/libfvde/Makefile.in libfvde-20180108/libfvde/Makefile.in --- libfvde-20170930/libfvde/Makefile.in 2017-10-04 19:28:15.000000000 +0000 +++ libfvde-20180108/libfvde/Makefile.in 2018-01-08 20:19:37.000000000 +0000 @@ -157,7 +157,8 @@ libfvde_io_handle.lo libfvde_keyring.lo libfvde_legacy.lo \ libfvde_metadata.lo libfvde_metadata_block.lo \ libfvde_notify.lo libfvde_password.lo libfvde_sector_data.lo \ - libfvde_support.lo libfvde_volume.lo libfvde_volume_group.lo + libfvde_segment_descriptor.lo libfvde_support.lo \ + libfvde_volume.lo libfvde_volume_group.lo libfvde_la_OBJECTS = $(am_libfvde_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -521,6 +522,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -672,6 +674,7 @@ libfvde_notify.c libfvde_notify.h \ libfvde_password.c libfvde_password.h \ libfvde_sector_data.c libfvde_sector_data.h \ + libfvde_segment_descriptor.c libfvde_segment_descriptor.h \ libfvde_support.c libfvde_support.h \ libfvde_types.h \ libfvde_unused.h \ @@ -810,6 +813,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvde_notify.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvde_password.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvde_sector_data.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvde_segment_descriptor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvde_support.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvde_volume.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfvde_volume_group.Plo@am__quote@ diff -Nru libfvde-20170930/libfvde.spec libfvde-20180108/libfvde.spec --- libfvde-20170930/libfvde.spec 2017-10-04 19:28:35.000000000 +0000 +++ libfvde-20180108/libfvde.spec 2018-01-08 20:19:52.000000000 +0000 @@ -1,17 +1,17 @@ Name: libfvde -Version: 20170930 +Version: 20180108 Release: 1 Summary: Library to access the FileVault Drive Encryption (FVDE) format Group: System Environment/Libraries License: LGPL Source: %{name}-%{version}.tar.gz -URL: https://github.com/libyal/libfvde/ +URL: https://github.com/libyal/libfvde BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: openssl zlib -BuildRequires: openssl-devel zlib-devel +BuildRequires: openssl-devel zlib-devel %description -libfvde is a library to access the FileVault Drive Encryption (FVDE) format +Library to access the FileVault Drive Encryption (FVDE) format %package devel Summary: Header files and libraries for developing applications for libfvde @@ -21,15 +21,6 @@ %description devel Header files and libraries for developing applications for libfvde. -%package tools -Summary: Several tools for accessing FileVault Drive Encryption volumes -Group: Applications/System -Requires: libfvde = %{version}-%{release} fuse-libs -BuildRequires: fuse-devel - -%description tools -Several tools for accessing the FileVault Drive Encryption volumes - %package python Summary: Python 2 bindings for libfvde Group: System Environment/Libraries @@ -48,6 +39,15 @@ %description python3 Python 3 bindings for libfvde +%package tools +Summary: Several tools for reading FileVault Drive Encryption volumes +Group: Applications/System +Requires: libfvde = %{version}-%{release} fuse-libs +BuildRequires: fuse-devel + +%description tools +Several tools for reading FileVault Drive Encryption volumes + %prep %setup -q @@ -68,12 +68,14 @@ %files %defattr(644,root,root,755) -%doc AUTHORS COPYING NEWS README +%license COPYING +%doc AUTHORS README %attr(755,root,root) %{_libdir}/*.so.* %files devel %defattr(644,root,root,755) -%doc AUTHORS COPYING NEWS README ChangeLog +%license COPYING +%doc AUTHORS README ChangeLog %{_libdir}/*.a %{_libdir}/*.la %{_libdir}/*.so @@ -81,29 +83,30 @@ %{_includedir}/* %{_mandir}/man3/* -%files tools -%defattr(644,root,root,755) -%doc AUTHORS COPYING NEWS README -%attr(755,root,root) %{_bindir}/fvdeinfo -%attr(755,root,root) %{_bindir}/fvdemount -%attr(755,root,root) %{_bindir}/fvdewipekey -%{_mandir}/man1/* - %files python %defattr(644,root,root,755) -%doc AUTHORS COPYING NEWS README +%license COPYING +%doc AUTHORS README %{_libdir}/python2*/site-packages/*.a %{_libdir}/python2*/site-packages/*.la %{_libdir}/python2*/site-packages/*.so %files python3 %defattr(644,root,root,755) -%doc AUTHORS COPYING NEWS README +%license COPYING +%doc AUTHORS README %{_libdir}/python3*/site-packages/*.a %{_libdir}/python3*/site-packages/*.la %{_libdir}/python3*/site-packages/*.so +%files tools +%defattr(644,root,root,755) +%license COPYING +%doc AUTHORS README +%attr(755,root,root) %{_bindir}/* +%{_mandir}/man1/* + %changelog -* Wed Oct 4 2017 Joachim Metz 20170930-1 +* Mon Jan 8 2018 Joachim Metz 20180108-1 - Auto-generated diff -Nru libfvde-20170930/libfvde.spec.in libfvde-20180108/libfvde.spec.in --- libfvde-20170930/libfvde.spec.in 2017-09-30 13:39:59.000000000 +0000 +++ libfvde-20180108/libfvde.spec.in 2018-01-08 17:02:13.000000000 +0000 @@ -5,13 +5,13 @@ Group: System Environment/Libraries License: LGPL Source: %{name}-%{version}.tar.gz -URL: https://github.com/libyal/libfvde/ +URL: https://github.com/libyal/libfvde BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @libfvde_spec_requires@ @ax_libbfio_spec_requires@ @ax_libcaes_spec_requires@ @ax_libcdata_spec_requires@ @ax_libcerror_spec_requires@ @ax_libcfile_spec_requires@ @ax_libclocale_spec_requires@ @ax_libcnotify_spec_requires@ @ax_libcpath_spec_requires@ @ax_libcrypto_spec_requires@ @ax_libcsplit_spec_requires@ @ax_libcthreads_spec_requires@ @ax_libfcache_spec_requires@ @ax_libfdata_spec_requires@ @ax_libfguid_spec_requires@ @ax_libfplist_spec_requires@ @ax_libfvalue_spec_requires@ @ax_libhmac_spec_requires@ @ax_libuna_spec_requires@ @ax_zlib_spec_requires@ -@libfvde_spec_build_requires@ @ax_libbfio_spec_build_requires@ @ax_libcaes_spec_build_requires@ @ax_libcdata_spec_build_requires@ @ax_libcerror_spec_build_requires@ @ax_libcfile_spec_build_requires@ @ax_libclocale_spec_build_requires@ @ax_libcnotify_spec_build_requires@ @ax_libcpath_spec_build_requires@ @ax_libcrypto_spec_build_requires@ @ax_libcsplit_spec_build_requires@ @ax_libcthreads_spec_build_requires@ @ax_libfcache_spec_build_requires@ @ax_libfdata_spec_build_requires@ @ax_libfguid_spec_build_requires@ @ax_libfplist_spec_build_requires@ @ax_libfvalue_spec_build_requires@ @ax_libuna_spec_build_requires@ @ax_zlib_spec_build_requires@ +@libfvde_spec_build_requires@ @ax_libbfio_spec_build_requires@ @ax_libcaes_spec_build_requires@ @ax_libcdata_spec_build_requires@ @ax_libcerror_spec_build_requires@ @ax_libcfile_spec_build_requires@ @ax_libclocale_spec_build_requires@ @ax_libcnotify_spec_build_requires@ @ax_libcpath_spec_build_requires@ @ax_libcrypto_spec_build_requires@ @ax_libcsplit_spec_build_requires@ @ax_libcthreads_spec_build_requires@ @ax_libfcache_spec_build_requires@ @ax_libfdata_spec_build_requires@ @ax_libfguid_spec_build_requires@ @ax_libfplist_spec_build_requires@ @ax_libfvalue_spec_build_requires@ @ax_libhmac_spec_build_requires@ @ax_libuna_spec_build_requires@ @ax_zlib_spec_build_requires@ %description -libfvde is a library to access the FileVault Drive Encryption (FVDE) format +Library to access the FileVault Drive Encryption (FVDE) format %package devel Summary: Header files and libraries for developing applications for libfvde @@ -21,15 +21,6 @@ %description devel Header files and libraries for developing applications for libfvde. -%package tools -Summary: Several tools for accessing FileVault Drive Encryption volumes -Group: Applications/System -Requires: libfvde = %{version}-%{release} @ax_libfuse_spec_requires@ -@libfvde_spec_tools_build_requires@ @ax_libfuse_spec_build_requires@ - -%description tools -Several tools for accessing the FileVault Drive Encryption volumes - %package python Summary: Python 2 bindings for libfvde Group: System Environment/Libraries @@ -48,6 +39,15 @@ %description python3 Python 3 bindings for libfvde +%package tools +Summary: Several tools for reading FileVault Drive Encryption volumes +Group: Applications/System +Requires: libfvde = %{version}-%{release} @ax_libfuse_spec_requires@ +@libfvde_spec_tools_build_requires@ @ax_libfuse_spec_build_requires@ + +%description tools +Several tools for reading FileVault Drive Encryption volumes + %prep %setup -q @@ -68,12 +68,14 @@ %files %defattr(644,root,root,755) -%doc AUTHORS COPYING NEWS README +%license COPYING +%doc AUTHORS README %attr(755,root,root) %{_libdir}/*.so.* %files devel %defattr(644,root,root,755) -%doc AUTHORS COPYING NEWS README ChangeLog +%license COPYING +%doc AUTHORS README ChangeLog %{_libdir}/*.a %{_libdir}/*.la %{_libdir}/*.so @@ -81,28 +83,29 @@ %{_includedir}/* %{_mandir}/man3/* -%files tools -%defattr(644,root,root,755) -%doc AUTHORS COPYING NEWS README -%attr(755,root,root) %{_bindir}/fvdeinfo -%attr(755,root,root) %{_bindir}/fvdemount -%attr(755,root,root) %{_bindir}/fvdewipekey -%{_mandir}/man1/* - %files python %defattr(644,root,root,755) -%doc AUTHORS COPYING NEWS README +%license COPYING +%doc AUTHORS README %{_libdir}/python2*/site-packages/*.a %{_libdir}/python2*/site-packages/*.la %{_libdir}/python2*/site-packages/*.so %files python3 %defattr(644,root,root,755) -%doc AUTHORS COPYING NEWS README +%license COPYING +%doc AUTHORS README %{_libdir}/python3*/site-packages/*.a %{_libdir}/python3*/site-packages/*.la %{_libdir}/python3*/site-packages/*.so +%files tools +%defattr(644,root,root,755) +%license COPYING +%doc AUTHORS README +%attr(755,root,root) %{_bindir}/* +%{_mandir}/man1/* + %changelog * @SPEC_DATE@ Joachim Metz @VERSION@-1 - Auto-generated diff -Nru libfvde-20170930/libhmac/libhmac_definitions.h libfvde-20180108/libhmac/libhmac_definitions.h --- libfvde-20170930/libhmac/libhmac_definitions.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libhmac/libhmac_definitions.h 2018-01-08 20:19:14.000000000 +0000 @@ -34,11 +34,11 @@ * for local use of libhmac */ #else -#define LIBHMAC_VERSION 20170909 +#define LIBHMAC_VERSION 20170117 /* The libhmac version string */ -#define LIBHMAC_VERSION_STRING "20170909" +#define LIBHMAC_VERSION_STRING "20170117" /* The digest hash sizes */ diff -Nru libfvde-20170930/libhmac/libhmac_md5.c libfvde-20180108/libhmac/libhmac_md5.c --- libfvde-20170930/libhmac/libhmac_md5.c 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libhmac/libhmac_md5.c 2018-01-08 20:19:14.000000000 +0000 @@ -24,7 +24,7 @@ #include #include -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) @@ -484,7 +484,7 @@ return( -1 ); } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) && defined( CALG_MD5 ) /* Request the AES crypt provider, fail back to the RSA crypt provider */ if( CryptAcquireContext( @@ -636,7 +636,7 @@ internal_context = (libhmac_internal_md5_context_t *) *context; *context = NULL; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) && defined( CALG_MD5 ) if( internal_context->crypt_provider != 0 ) { CryptReleaseContext( @@ -710,7 +710,7 @@ } internal_context = (libhmac_internal_md5_context_t *) context; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) && defined( CALG_MD5 ) if( internal_context->hash == 0 ) { libcerror_error_set( @@ -734,7 +734,7 @@ return( -1 ); } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) && defined( CALG_MD5 ) #if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) if( size > (size_t) UINT32_MAX ) { @@ -950,7 +950,7 @@ libhmac_internal_md5_context_t *internal_context = NULL; static char *function = "libhmac_md5_finalize"; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) && defined( CALG_MD5 ) DWORD safe_hash_size = 0; #elif defined( HAVE_LIBCRYPTO ) && !defined( HAVE_OPENSSL_MD5_H ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_MD5 ) @@ -981,7 +981,7 @@ } internal_context = (libhmac_internal_md5_context_t *) context; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) && defined( CALG_MD5 ) if( internal_context->hash == 0 ) { libcerror_error_set( @@ -1016,7 +1016,7 @@ return( -1 ); } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) && defined( CALG_MD5 ) #if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) if( hash_size > (size_t) UINT32_MAX ) { diff -Nru libfvde-20170930/libhmac/libhmac_md5.h libfvde-20180108/libhmac/libhmac_md5.h --- libfvde-20170930/libhmac/libhmac_md5.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libhmac/libhmac_md5.h 2018-01-08 20:19:14.000000000 +0000 @@ -25,7 +25,7 @@ #include #include -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) @@ -44,7 +44,7 @@ extern "C" { #endif -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) && defined( CALG_MD5 ) #define LIBHMAC_HAVE_MD5_SUPPORT #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_MD5_H ) && defined( MD5_DIGEST_LENGTH ) @@ -63,7 +63,7 @@ struct libhmac_internal_md5_context { -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_MD5 ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) && defined( CALG_MD5 ) HCRYPTPROV crypt_provider; HCRYPTHASH hash; diff -Nru libfvde-20170930/libhmac/libhmac_sha1.c libfvde-20180108/libhmac/libhmac_sha1.c --- libfvde-20170930/libhmac/libhmac_sha1.c 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libhmac/libhmac_sha1.c 2018-01-08 20:19:14.000000000 +0000 @@ -24,7 +24,7 @@ #include #include -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) @@ -558,7 +558,7 @@ return( -1 ); } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA1 ) /* Request the AES crypt provider, fail back to the RSA crypt provider */ if( CryptAcquireContext( @@ -710,7 +710,7 @@ internal_context = (libhmac_internal_sha1_context_t *) *context; *context = NULL; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA1 ) if( internal_context->crypt_provider != 0 ) { CryptReleaseContext( @@ -784,7 +784,7 @@ } internal_context = (libhmac_internal_sha1_context_t *) context; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA1 ) if( internal_context->hash == 0 ) { libcerror_error_set( @@ -808,7 +808,7 @@ return( -1 ); } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA1 ) #if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) if( size > (size_t) UINT32_MAX ) { @@ -1024,7 +1024,7 @@ libhmac_internal_sha1_context_t *internal_context = NULL; static char *function = "libhmac_sha1_finalize"; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA1 ) DWORD safe_hash_size = 0; #elif defined( HAVE_LIBCRYPTO ) && !defined( HAVE_OPENSSL_SHA_H ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA1 ) @@ -1055,7 +1055,7 @@ } internal_context = (libhmac_internal_sha1_context_t *) context; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA1 ) if( internal_context->hash == 0 ) { libcerror_error_set( @@ -1090,7 +1090,7 @@ return( -1 ); } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA1 ) #if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) if( hash_size > (size_t) UINT32_MAX ) { diff -Nru libfvde-20170930/libhmac/libhmac_sha1.h libfvde-20180108/libhmac/libhmac_sha1.h --- libfvde-20170930/libhmac/libhmac_sha1.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libhmac/libhmac_sha1.h 2018-01-08 20:19:14.000000000 +0000 @@ -25,7 +25,7 @@ #include #include -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) @@ -44,7 +44,7 @@ extern "C" { #endif -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA1 ) #define LIBHMAC_HAVE_SHA1_SUPPORT #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA_DIGEST_LENGTH ) @@ -63,7 +63,7 @@ struct libhmac_internal_sha1_context { -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA1 ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA1 ) HCRYPTPROV crypt_provider; HCRYPTHASH hash; diff -Nru libfvde-20170930/libhmac/libhmac_sha224.c libfvde-20180108/libhmac/libhmac_sha224.c --- libfvde-20170930/libhmac/libhmac_sha224.c 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libhmac/libhmac_sha224.c 2018-01-08 20:19:14.000000000 +0000 @@ -24,7 +24,7 @@ #include #include -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) @@ -517,7 +517,7 @@ return( -1 ); } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_224 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA_224 ) /* Request the AES crypt provider, fail back to the RSA crypt provider */ if( CryptAcquireContext( @@ -669,7 +669,7 @@ internal_context = (libhmac_internal_sha224_context_t *) *context; *context = NULL; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_224 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA_224 ) if( internal_context->crypt_provider != 0 ) { CryptReleaseContext( @@ -743,7 +743,7 @@ } internal_context = (libhmac_internal_sha224_context_t *) context; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_224 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA_224 ) if( internal_context->hash == 0 ) { libcerror_error_set( @@ -771,7 +771,7 @@ { return( 1 ); } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_224 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA_224 ) #if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) if( size > (size_t) UINT32_MAX ) { @@ -988,7 +988,7 @@ libhmac_internal_sha224_context_t *internal_context = NULL; static char *function = "libhmac_sha224_finalize"; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_224 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA_224 ) DWORD safe_hash_size = 0; #elif defined( HAVE_LIBCRYPTO ) && !defined( HAVE_OPENSSL_SHA_H ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA224 ) @@ -1018,7 +1018,7 @@ } internal_context = (libhmac_internal_sha224_context_t *) context; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_224 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA_224 ) if( internal_context->hash == 0 ) { libcerror_error_set( @@ -1053,7 +1053,7 @@ return( -1 ); } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_224 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA_224 ) #if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) if( hash_size > (size_t) UINT32_MAX ) { diff -Nru libfvde-20170930/libhmac/libhmac_sha224.h libfvde-20180108/libhmac/libhmac_sha224.h --- libfvde-20170930/libhmac/libhmac_sha224.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libhmac/libhmac_sha224.h 2018-01-08 20:19:14.000000000 +0000 @@ -25,7 +25,7 @@ #include #include -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) @@ -47,7 +47,7 @@ /* Make sure the WINAPI version is Vista or later otherwise * a cross compilation will contain broken SHA-224 support */ -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_224 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA_224 ) #define LIBHMAC_HAVE_SHA224_SUPPORT #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA224_DIGEST_LENGTH ) @@ -66,7 +66,7 @@ struct libhmac_internal_sha224_context { -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_224 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA_224 ) HCRYPTPROV crypt_provider; HCRYPTHASH hash; diff -Nru libfvde-20170930/libhmac/libhmac_sha256.c libfvde-20180108/libhmac/libhmac_sha256.c --- libfvde-20170930/libhmac/libhmac_sha256.c 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libhmac/libhmac_sha256.c 2018-01-08 20:19:14.000000000 +0000 @@ -24,7 +24,7 @@ #include #include -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) @@ -517,7 +517,7 @@ return( -1 ); } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_256 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA_256 ) /* Request the AES crypt provider, fail back to the RSA crypt provider */ if( CryptAcquireContext( @@ -669,7 +669,7 @@ internal_context = (libhmac_internal_sha256_context_t *) *context; *context = NULL; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_256 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA_256 ) if( internal_context->crypt_provider != 0 ) { CryptReleaseContext( @@ -743,7 +743,7 @@ } internal_context = (libhmac_internal_sha256_context_t *) context; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_256 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA_256 ) if( internal_context->hash == 0 ) { libcerror_error_set( @@ -771,7 +771,7 @@ { return( 1 ); } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_256 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA_256 ) #if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) if( size > (size_t) UINT32_MAX ) { @@ -988,7 +988,7 @@ libhmac_internal_sha256_context_t *internal_context = NULL; static char *function = "libhmac_sha256_finalize"; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_256 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA_256 ) DWORD safe_hash_size = 0; #elif defined( HAVE_LIBCRYPTO ) && !defined( HAVE_OPENSSL_SHA_H ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA256 ) @@ -1018,7 +1018,7 @@ } internal_context = (libhmac_internal_sha256_context_t *) context; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_256 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA_256 ) if( internal_context->hash == 0 ) { libcerror_error_set( @@ -1053,7 +1053,7 @@ return( -1 ); } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_256 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA_256 ) #if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) if( hash_size > (size_t) UINT32_MAX ) { diff -Nru libfvde-20170930/libhmac/libhmac_sha256.h libfvde-20180108/libhmac/libhmac_sha256.h --- libfvde-20170930/libhmac/libhmac_sha256.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libhmac/libhmac_sha256.h 2018-01-08 20:19:14.000000000 +0000 @@ -25,7 +25,7 @@ #include #include -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) @@ -47,7 +47,7 @@ /* Make sure the WINAPI version is Vista or later otherwise * a cross compilation will contain broken SHA-256 support */ -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_256 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA_256 ) #define LIBHMAC_HAVE_SHA256_SUPPORT #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA256_DIGEST_LENGTH ) @@ -66,7 +66,7 @@ struct libhmac_internal_sha256_context { -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_256 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA_256 ) HCRYPTPROV crypt_provider; HCRYPTHASH hash; diff -Nru libfvde-20170930/libhmac/libhmac_sha512.c libfvde-20180108/libhmac/libhmac_sha512.c --- libfvde-20170930/libhmac/libhmac_sha512.c 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libhmac/libhmac_sha512.c 2018-01-08 20:19:14.000000000 +0000 @@ -24,7 +24,7 @@ #include #include -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) +#if defined( WINAPI ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) @@ -553,7 +553,7 @@ return( -1 ); } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_512 ) +#if defined( WINAPI ) && defined( CALG_SHA_512 ) && ( WINVER >= 0x0600 ) /* Request the AES crypt provider, fail back to the RSA crypt provider */ if( CryptAcquireContext( @@ -705,7 +705,7 @@ internal_context = (libhmac_internal_sha512_context_t *) *context; *context = NULL; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_512 ) +#if defined( WINAPI ) && defined( CALG_SHA_512 ) && ( WINVER >= 0x0600 ) if( internal_context->crypt_provider != 0 ) { CryptReleaseContext( @@ -779,7 +779,7 @@ } internal_context = (libhmac_internal_sha512_context_t *) context; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_512 ) +#if defined( WINAPI ) && defined( CALG_SHA_512 ) && ( WINVER >= 0x0600 ) if( internal_context->hash == 0 ) { libcerror_error_set( @@ -807,7 +807,7 @@ { return( 1 ); } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_512 ) +#if defined( WINAPI ) && defined( CALG_SHA_512 ) && ( WINVER >= 0x0600 ) #if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) if( size > (size_t) UINT32_MAX ) { @@ -1024,7 +1024,7 @@ libhmac_internal_sha512_context_t *internal_context = NULL; static char *function = "libhmac_sha512_finalize"; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_512 ) +#if defined( WINAPI ) && defined( CALG_SHA_512 ) && ( WINVER >= 0x0600 ) DWORD safe_hash_size = 0; #elif defined( HAVE_LIBCRYPTO ) && !defined( HAVE_OPENSSL_SHA_H ) && defined( HAVE_OPENSSL_EVP_H ) && defined( HAVE_EVP_SHA512 ) @@ -1054,7 +1054,7 @@ } internal_context = (libhmac_internal_sha512_context_t *) context; -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_256 ) && ( WINVER >= 0x0600 ) +#if defined( WINAPI ) && defined( CALG_SHA_256 ) && ( WINVER >= 0x0600 ) if( internal_context->hash == 0 ) { libcerror_error_set( @@ -1089,7 +1089,7 @@ return( -1 ); } -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && defined( CALG_SHA_256 ) && ( WINVER >= 0x0600 ) +#if defined( WINAPI ) && defined( CALG_SHA_256 ) && ( WINVER >= 0x0600 ) #if ( SIZEOF_SIZE_T == 8 ) || defined( _WIN64 ) if( hash_size > (size_t) UINT32_MAX ) { diff -Nru libfvde-20170930/libhmac/libhmac_sha512.h libfvde-20180108/libhmac/libhmac_sha512.h --- libfvde-20170930/libhmac/libhmac_sha512.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libhmac/libhmac_sha512.h 2018-01-08 20:19:14.000000000 +0000 @@ -25,7 +25,7 @@ #include #include -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) +#if defined( WINAPI ) && defined( HAVE_WINCRYPT ) #include #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) @@ -47,7 +47,7 @@ /* Make sure the WINAPI version is Vista or later otherwise * a cross compilation will contain broken SHA-512 support */ -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_512 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA_512 ) #define LIBHMAC_HAVE_SHA512_SUPPORT #elif defined( HAVE_LIBCRYPTO ) && defined( HAVE_OPENSSL_SHA_H ) && defined( SHA512_DIGEST_LENGTH ) @@ -66,7 +66,7 @@ struct libhmac_internal_sha512_context { -#if defined( HAVE_WINCRYPT ) && defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( CALG_SHA_512 ) +#if defined( WINAPI ) && ( WINVER >= 0x0600 ) && defined( HAVE_WINCRYPT ) && defined( CALG_SHA_512 ) HCRYPTPROV crypt_provider; HCRYPTHASH hash; diff -Nru libfvde-20170930/libhmac/Makefile.in libfvde-20180108/libhmac/Makefile.in --- libfvde-20170930/libhmac/Makefile.in 2017-10-04 19:28:15.000000000 +0000 +++ libfvde-20180108/libhmac/Makefile.in 2018-01-08 20:19:37.000000000 +0000 @@ -492,6 +492,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/libuna/libuna_definitions.h libfvde-20180108/libuna/libuna_definitions.h --- libfvde-20170930/libuna/libuna_definitions.h 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libuna/libuna_definitions.h 2018-01-08 20:19:20.000000000 +0000 @@ -35,11 +35,11 @@ #else #include -#define LIBUNA_VERSION 20170909 +#define LIBUNA_VERSION 20170825 /* The libuna version string */ -#define LIBUNA_VERSION_STRING "20170909" +#define LIBUNA_VERSION_STRING "20170825" /* The endian definitions */ diff -Nru libfvde-20170930/libuna/libuna_unicode_character.c libfvde-20180108/libuna/libuna_unicode_character.c --- libfvde-20170930/libuna/libuna_unicode_character.c 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/libuna/libuna_unicode_character.c 2018-01-08 20:19:20.000000000 +0000 @@ -5449,9 +5449,9 @@ { *unicode_character = utf32_stream[ *utf32_stream_index + 3 ]; *unicode_character <<= 8; - *unicode_character += utf32_stream[ *utf32_stream_index + 2 ]; + *unicode_character = utf32_stream[ *utf32_stream_index + 2 ]; *unicode_character <<= 8; - *unicode_character += utf32_stream[ *utf32_stream_index + 1 ]; + *unicode_character = utf32_stream[ *utf32_stream_index + 1 ]; *unicode_character <<= 8; *unicode_character += utf32_stream[ *utf32_stream_index ]; } diff -Nru libfvde-20170930/libuna/Makefile.in libfvde-20180108/libuna/Makefile.in --- libfvde-20170930/libuna/Makefile.in 2017-10-04 19:28:15.000000000 +0000 +++ libfvde-20180108/libuna/Makefile.in 2018-01-08 20:19:38.000000000 +0000 @@ -570,6 +570,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/m4/libfuse.m4 libfvde-20180108/m4/libfuse.m4 --- libfvde-20170930/m4/libfuse.m4 2013-04-12 05:15:11.000000000 +0000 +++ libfvde-20180108/m4/libfuse.m4 2018-01-08 17:42:47.000000000 +0000 @@ -1,201 +1,201 @@ dnl Functions for libfuse dnl -dnl Version: 20130409 +dnl Version: 20180108 dnl Function to detect if libfuse is available dnl ac_libfuse_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments AC_DEFUN([AX_LIBFUSE_CHECK_LIB], - [dnl Check if parameters were provided - AS_IF( - [test "x$ac_cv_with_libfuse" != x && test "x$ac_cv_with_libfuse" != xno && test "x$ac_cv_with_libfuse" != xauto-detect], - [AS_IF( - [test -d "$ac_cv_with_libfuse"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libfuse}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libfuse}/lib"], - [AC_MSG_WARN([no such directory: $ac_cv_with_libfuse]) - ]) - ]) - - AS_IF( - [test "x$ac_cv_with_libfuse" = xno], - [ac_cv_libfuse=no], - [dnl Check for a pkg-config file - AS_IF( - [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], - [PKG_CHECK_MODULES( - [fuse], - [fuse >= 2.6], - [ac_cv_libfuse=libfuse], - [ac_cv_libfuse=no]) - ]) - - AS_IF( - [test "x$ac_cv_libfuse" = xlibfuse], - [ac_cv_libfuse_CPPFLAGS="$pkg_cv_fuse_CFLAGS" - ac_cv_libfuse_LIBADD="$pkg_cv_fuse_LIBS"], - [dnl Check for headers - AC_CHECK_HEADERS( - [fuse.h], - [ac_cv_header_fuse_h=yes], - [ac_cv_header_fuse_h=no]) - - dnl libfuse sometimes requires -D_FILE_OFFSET_BITS=64 to be set - AS_IF( - [test "x$ac_cv_header_fuse_h" = xno], - [AS_UNSET([ac_cv_header_fuse_h]) - CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" - AC_CHECK_HEADERS([fuse.h]) - ]) - - AS_IF( - [test "x$ac_cv_header_fuse_h" = xno], - [ac_cv_libfuse=no], - [dnl Check for the individual functions - ac_cv_libfuse=libfuse - - AC_CHECK_LIB( - fuse, - fuse_daemonize, - [ac_cv_libfuse_dummy=yes], - [ac_cv_libfuse=no]) - AC_CHECK_LIB( - fuse, - fuse_destroy, - [ac_cv_libfuse_dummy=yes], - [ac_cv_libfuse=no]) - AC_CHECK_LIB( - fuse, - fuse_mount, - [ac_cv_libfuse_dummy=yes], - [ac_cv_libfuse=no]) - AC_CHECK_LIB( - fuse, - fuse_new, - [ac_cv_libfuse_dummy=yes], - [ac_cv_libfuse=no]) - - ac_cv_libfuse_LIBADD="-lfuse"; - ]) - ]) - - dnl Check for libosxfuse - AS_IF( - [test "x$ac_cv_with_libfuse" != xno && test "x$ac_cv_header_fuse_h" = xno], - [CPPFLAGS="$CPPFLAGS -DFUSE_USE_VERSION=26" - AC_CHECK_HEADERS([osxfuse/fuse.h]) - - dnl libosxfuse sometimes requires -D_FILE_OFFSET_BITS=64 to be set - AS_IF( - [test "x$ac_cv_header_osxfuse_fuse_h" = xno], - [AS_UNSET([ac_cv_header_osxfuse_fuse_h]) - CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" - AC_CHECK_HEADERS([osxfuse/fuse.h]) - ]) + [dnl Check if parameters were provided + AS_IF( + [test "x$ac_cv_with_libfuse" != x && test "x$ac_cv_with_libfuse" != xno && test "x$ac_cv_with_libfuse" != xauto-detect], + [AS_IF( + [test -d "$ac_cv_with_libfuse"], + [CFLAGS="$CFLAGS -I${ac_cv_with_libfuse}/include" + LDFLAGS="$LDFLAGS -L${ac_cv_with_libfuse}/lib"], + [AC_MSG_WARN([no such directory: $ac_cv_with_libfuse]) + ]) + ]) - AS_IF( - [test "x$ac_cv_header_osxfuse_fuse_h" = xno], + AS_IF( + [test "x$ac_cv_with_libfuse" = xno], [ac_cv_libfuse=no], - [dnl Check for the individual functions - ac_cv_libfuse=libosxfuse + [dnl Check for a pkg-config file + AS_IF( + [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], + [PKG_CHECK_MODULES( + [fuse], + [fuse >= 2.6], + [ac_cv_libfuse=libfuse], + [ac_cv_libfuse=no]) + ]) + + AS_IF( + [test "x$ac_cv_libfuse" = xlibfuse], + [ac_cv_libfuse_CPPFLAGS="$pkg_cv_fuse_CFLAGS" + ac_cv_libfuse_LIBADD="$pkg_cv_fuse_LIBS"], + [dnl Check for headers + AC_CHECK_HEADERS( + [fuse.h], + [ac_cv_header_fuse_h=yes], + [ac_cv_header_fuse_h=no]) + + dnl libfuse sometimes requires -D_FILE_OFFSET_BITS=64 to be set + AS_IF( + [test "x$ac_cv_header_fuse_h" = xno], + [AS_UNSET([ac_cv_header_fuse_h]) + CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" + AC_CHECK_HEADERS([fuse.h]) + ]) + + AS_IF( + [test "x$ac_cv_header_fuse_h" = xno], + [ac_cv_libfuse=no], + [dnl Check for the individual functions + ac_cv_libfuse=libfuse + + AC_CHECK_LIB( + fuse, + fuse_daemonize, + [ac_cv_libfuse_dummy=yes], + [ac_cv_libfuse=no]) + AC_CHECK_LIB( + fuse, + fuse_destroy, + [ac_cv_libfuse_dummy=yes], + [ac_cv_libfuse=no]) + AC_CHECK_LIB( + fuse, + fuse_mount, + [ac_cv_libfuse_dummy=yes], + [ac_cv_libfuse=no]) + AC_CHECK_LIB( + fuse, + fuse_new, + [ac_cv_libfuse_dummy=yes], + [ac_cv_libfuse=no]) + + ac_cv_libfuse_LIBADD="-lfuse"; + ]) + ]) + + dnl Check for libosxfuse + AS_IF( + [test "x$ac_cv_with_libfuse" != xno && test "x$ac_cv_header_fuse_h" = xno], + [CPPFLAGS="$CPPFLAGS -DFUSE_USE_VERSION=26" + AC_CHECK_HEADERS([osxfuse/fuse.h]) + + dnl libosxfuse sometimes requires -D_FILE_OFFSET_BITS=64 to be set + AS_IF( + [test "x$ac_cv_header_osxfuse_fuse_h" = xno], + [AS_UNSET([ac_cv_header_osxfuse_fuse_h]) + CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" + AC_CHECK_HEADERS([osxfuse/fuse.h]) + ]) + + AS_IF( + [test "x$ac_cv_header_osxfuse_fuse_h" = xno], + [ac_cv_libfuse=no], + [dnl Check for the individual functions + ac_cv_libfuse=libosxfuse + + AC_CHECK_LIB( + osxfuse, + fuse_daemonize, + [ac_cv_libfuse_dummy=yes], + [ac_cv_libfuse=no]) + AC_CHECK_LIB( + osxfuse, + fuse_destroy, + [ac_cv_libfuse_dummy=yes], + [ac_cv_libfuse=no]) + AC_CHECK_LIB( + osxfuse, + fuse_mount, + [ac_cv_libfuse_dummy=yes], + [ac_cv_libfuse=no]) + AC_CHECK_LIB( + osxfuse, + fuse_new, + [ac_cv_libfuse_dummy=yes], + [ac_cv_libfuse=no]) + + ac_cv_libfuse_LIBADD="-losxfuse"; + ]) + ]) + ]) - AC_CHECK_LIB( - osxfuse, - fuse_daemonize, - [ac_cv_libfuse_dummy=yes], - [ac_cv_libfuse=no]) - AC_CHECK_LIB( - osxfuse, - fuse_destroy, - [ac_cv_libfuse_dummy=yes], - [ac_cv_libfuse=no]) - AC_CHECK_LIB( - osxfuse, - fuse_mount, - [ac_cv_libfuse_dummy=yes], - [ac_cv_libfuse=no]) - AC_CHECK_LIB( - osxfuse, - fuse_new, - [ac_cv_libfuse_dummy=yes], - [ac_cv_libfuse=no]) + AS_IF( + [test "x$ac_cv_libfuse" = xlibfuse], + [AC_DEFINE( + [HAVE_LIBFUSE], + [1], + [Define to 1 if you have the 'fuse' library (-lfuse).]) + ]) + AS_IF( + [test "x$ac_cv_libfuse" = xlibosxfuse], + [AC_DEFINE( + [HAVE_LIBOSXFUSE], + [1], + [Define to 1 if you have the 'osxfuse' library (-losxfuse).]) + ]) - ac_cv_libfuse_LIBADD="-losxfuse"; + AS_IF( + [test "x$ac_cv_libfuse" != xno], + [AC_SUBST( + [HAVE_LIBFUSE], + [1]) ], + [AC_SUBST( + [HAVE_LIBFUSE], + [0]) ]) - ]) ]) - AS_IF( - [test "x$ac_cv_libfuse" = xlibfuse], - [AC_DEFINE( - [HAVE_LIBFUSE], - [1], - [Define to 1 if you have the 'fuse' library (-lfuse).]) - ]) - AS_IF( - [test "x$ac_cv_libfuse" = xlibosxfuse], - [AC_DEFINE( - [HAVE_LIBOSXFUSE], - [1], - [Define to 1 if you have the 'osxfuse' library (-losxfuse).]) - ]) +dnl Function to detect how to enable libfuse +AC_DEFUN([AX_LIBFUSE_CHECK_ENABLE], + [AX_COMMON_ARG_WITH( + [libfuse], + [libfuse], + [search for libfuse in includedir and libdir or in the specified DIR, or no if not to use libfuse], + [auto-detect], + [DIR]) - AS_IF( - [test "x$ac_cv_libfuse" != xno], - [AC_SUBST( - [HAVE_LIBFUSE], - [1]) ], - [AC_SUBST( - [HAVE_LIBFUSE], - [0]) - ]) - ]) + dnl Check for a shared library version + AX_LIBFUSE_CHECK_LIB -dnl Function to detect how to enable libfuse -AC_DEFUN([AX_LIBFUSE_CHECK_ENABLE], - [AX_COMMON_ARG_WITH( - [libfuse], - [libfuse], - [search for libfuse in includedir and libdir or in the specified DIR, or no if not to use libfuse], - [auto-detect], - [DIR]) - - dnl Check for a shared library version - AX_LIBFUSE_CHECK_LIB - - AS_IF( - [test "x$ac_cv_libfuse_CPPFLAGS" != "x"], - [AC_SUBST( - [LIBFUSE_CPPFLAGS], - [$ac_cv_libfuse_CPPFLAGS]) - ]) - AS_IF( - [test "x$ac_cv_libfuse_LIBADD" != "x"], - [AC_SUBST( - [LIBFUSE_LIBADD], - [$ac_cv_libfuse_LIBADD]) - ]) + AS_IF( + [test "x$ac_cv_libfuse_CPPFLAGS" != "x"], + [AC_SUBST( + [LIBFUSE_CPPFLAGS], + [$ac_cv_libfuse_CPPFLAGS]) + ]) + AS_IF( + [test "x$ac_cv_libfuse_LIBADD" != "x"], + [AC_SUBST( + [LIBFUSE_LIBADD], + [$ac_cv_libfuse_LIBADD]) + ]) - AS_IF( - [test "x$ac_cv_libfuse" = xlibfuse], - [AC_SUBST( - [ax_libfuse_pc_libs_private], - [-lfuse]) - ]) - AS_IF( - [test "x$ac_cv_libfuse" = xlibosxfuse], - [AC_SUBST( - [ax_libfuse_pc_libs_private], - [-losxfuse]) - ]) + AS_IF( + [test "x$ac_cv_libfuse" = xlibfuse], + [AC_SUBST( + [ax_libfuse_pc_libs_private], + [-lfuse]) + ]) + AS_IF( + [test "x$ac_cv_libfuse" = xlibosxfuse], + [AC_SUBST( + [ax_libfuse_pc_libs_private], + [-losxfuse]) + ]) - AS_IF( - [test "x$ac_cv_libfuse" = xlibfuse], - [AC_SUBST( - [ax_libfuse_spec_requires], - [fuse-libs]) - AC_SUBST( - [ax_libfuse_spec_build_requires], - [fuse-devel]) + AS_IF( + [test "x$ac_cv_libfuse" = xlibfuse], + [AC_SUBST( + [ax_libfuse_spec_requires], + [fuse-libs]) + AC_SUBST( + [ax_libfuse_spec_build_requires], + [fuse-devel]) + ]) ]) - ]) diff -Nru libfvde-20170930/m4/zlib.m4 libfvde-20180108/m4/zlib.m4 --- libfvde-20170930/m4/zlib.m4 2016-06-09 19:17:15.000000000 +0000 +++ libfvde-20180108/m4/zlib.m4 2017-10-20 19:52:12.000000000 +0000 @@ -1,272 +1,275 @@ -dnl Functions for zlib +dnl Checks for zlib or required headers and functions dnl -dnl Version: 20160318 +dnl Version: 20171008 dnl Function to detect if zlib is available AC_DEFUN([AX_ZLIB_CHECK_LIB], - [dnl Check if parameters were provided - AS_IF( - [test "x$ac_cv_with_zlib" != x && test "x$ac_cv_with_zlib" != xno && test "x$ac_cv_with_zlib" != xauto-detect], - [AS_IF( - [test -d "$ac_cv_with_zlib"], - [CFLAGS="$CFLAGS -I${ac_cv_with_zlib}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_zlib}/lib"], - [AC_MSG_WARN([no such directory: $ac_cv_with_zlib]) - ]) - ]) - - AS_IF( - [test "x$ac_cv_with_zlib" = xno], - [ac_cv_zlib=no], - [dnl Check for a pkg-config file + [dnl Check if parameters were provided AS_IF( - [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], - [PKG_CHECK_MODULES( - [zlib], - [zlib >= 1.2.5], - [ac_cv_zlib=zlib], - [ac_cv_zlib=no]) - ]) + [test "x$ac_cv_with_zlib" != x && test "x$ac_cv_with_zlib" != xno && test "x$ac_cv_with_zlib" != xauto-detect], + [AS_IF( + [test -d "$ac_cv_with_zlib"], + [CFLAGS="$CFLAGS -I${ac_cv_with_zlib}/include" + LDFLAGS="$LDFLAGS -L${ac_cv_with_zlib}/lib"], + [AC_MSG_WARN([no such directory: $ac_cv_with_zlib]) + ]) + ]) AS_IF( - [test "x$ac_cv_zlib" = xzlib], - [ac_cv_zlib_CPPFLAGS="$pkg_cv_zlib_CFLAGS" - ac_cv_zlib_LIBADD="$pkg_cv_zlib_LIBS"], - [dnl Check for headers - AC_CHECK_HEADERS([zlib.h]) - - AS_IF( - [test "x$ac_cv_header_zlib_h" = xno], + [test "x$ac_cv_with_zlib" = xno], [ac_cv_zlib=no], - [dnl Check for the individual functions - ac_cv_zlib=zlib - - AC_CHECK_LIB( - z, - zlibVersion, - [], - [ac_cv_zlib=no]) - + [dnl Check for a pkg-config file AS_IF( - [test "x$ac_cv_lib_z_zlibVersion" = xno], - [AC_MSG_FAILURE( - [Missing function: zlibVersion in library: zlib.], - [1]) - ]) + [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], + [PKG_CHECK_MODULES( + [zlib], + [zlib >= 1.2.5], + [ac_cv_zlib=zlib], + [ac_cv_zlib=no]) + ]) - ac_cv_zlib_LIBADD="-lz"; + AS_IF( + [test "x$ac_cv_zlib" = xzlib], + [ac_cv_zlib_CPPFLAGS="$pkg_cv_zlib_CFLAGS" + ac_cv_zlib_LIBADD="$pkg_cv_zlib_LIBS"], + [dnl Check for headers + AC_CHECK_HEADERS([zlib.h]) + + AS_IF( + [test "x$ac_cv_header_zlib_h" = xno], + [ac_cv_zlib=no], + [dnl Check for the individual functions + ac_cv_zlib=zlib + + AC_CHECK_LIB( + z, + zlibVersion, + [], + [ac_cv_zlib=no]) + + AS_IF( + [test "x$ac_cv_lib_z_zlibVersion" = xno], + [AC_MSG_FAILURE( + [Missing function: zlibVersion in library: zlib.], + [1]) + ]) + + ac_cv_zlib_LIBADD="-lz"; + ]) + ]) ]) - ]) - ]) - AS_IF( - [test "x$ac_cv_zlib" = xzlib], - [AC_DEFINE( - [HAVE_ZLIB], - [1], - [Define to 1 if you have the 'zlib' library (-lz).]) - ]) + AS_IF( + [test "x$ac_cv_zlib" = xzlib], + [AC_DEFINE( + [HAVE_ZLIB], + [1], + [Define to 1 if you have the 'zlib' library (-lz).]) + ]) - AS_IF( - [test "x$ac_cv_zlib" != xno], - [AC_SUBST( - [HAVE_ZLIB], - [1]) ], - [AC_SUBST( - [HAVE_ZLIB], - [0]) + AS_IF( + [test "x$ac_cv_zlib" != xno], + [AC_SUBST( + [HAVE_ZLIB], + [1]) ], + [AC_SUBST( + [HAVE_ZLIB], + [0]) + ]) ]) - ]) dnl Function to detect if the adler32 function is available AC_DEFUN([AX_ZLIB_CHECK_ADLER32], - [AX_COMMON_ARG_WITH( - [adler32], - [adler32], - [specify which alder32 implementation to use, options: 'auto-detect', 'zlib' or 'local'], - [auto-detect], - [auto-detect]) - - AS_IF( - [test "x$ac_cv_zlib" != xzlib], - [ac_cv_adler32=local], - [AC_CHECK_LIB( - z, - adler32, - [ac_zlib_dummy=yes]) + [AX_COMMON_ARG_WITH( + [adler32], + [adler32], + [specify which alder32 implementation to use, options: 'auto-detect', 'zlib' or 'local'], + [auto-detect], + [auto-detect]) AS_IF( - [test "x$ac_cv_lib_z_adler32" = xyes], - [AS_IF( - [test "x$ac_cv_with_adler32" != xzlib && test "x$ac_cv_with_adler32" != xauto-detect], + [test "x$ac_cv_zlib" != xzlib], [ac_cv_adler32=local], - [AC_DEFINE( - [HAVE_ZLIB_ADLER32], - [1], - [Define to 1 if adler32 funtion is available in zlib.]) - ac_cv_adler32=zlib])], - [AS_IF( - [test "x$ac_cv_with_adler32" = xzlib], - [AC_MSG_FAILURE( - [Missing function: adler32 in library: zlib.], - [1]) + [AC_CHECK_LIB( + z, + adler32, + [ac_zlib_dummy=yes]) + + AS_IF( + [test "x$ac_cv_lib_z_adler32" = xyes], + [AS_IF( + [test "x$ac_cv_with_adler32" != xzlib && test "x$ac_cv_with_adler32" != xauto-detect], + [ac_cv_adler32=local], + [AC_DEFINE( + [HAVE_ZLIB_ADLER32], + [1], + [Define to 1 if adler32 funtion is available in zlib.]) + ac_cv_adler32=zlib])], + [AS_IF( + [test "x$ac_cv_with_adler32" = xzlib], + [AC_MSG_FAILURE( + [Missing function: adler32 in library: zlib.], + [1]) + ]) + ac_cv_adler32=local]) ]) - ac_cv_adler32=local]) ]) - ]) dnl Function to detect if the compress2 function is available AC_DEFUN([AX_ZLIB_CHECK_COMPRESS2], - [AS_IF( - [test "x$ac_cv_zlib" = xzlib], - [AC_CHECK_LIB( - z, - compress2, - [ac_zlib_dummy=yes]) + [AS_IF( + [test "x$ac_cv_zlib" = xzlib], + [AC_CHECK_LIB( + z, + compress2, + [ac_zlib_dummy=yes]) - AS_IF( - [test "x$ac_cv_lib_z_compress2" = xyes], - [AC_DEFINE( - [HAVE_ZLIB_COMPRESS2], - [1], - [Define to 1 if compress2 funtion is available in zlib.]) - ]) + AS_IF( + [test "x$ac_cv_lib_z_compress2" = xyes], + [AC_DEFINE( + [HAVE_ZLIB_COMPRESS2], + [1], + [Define to 1 if compress2 funtion is available in zlib.]) + ]) + ]) ]) - ]) dnl Function to detect if the compressBound function is available AC_DEFUN([AX_ZLIB_CHECK_COMPRESSBOUND], - [AS_IF( - [test "x$ac_cv_zlib" = xzlib], - [AC_CHECK_LIB( - z, - compressBound, - [ac_zlib_dummy=yes]) + [AS_IF( + [test "x$ac_cv_zlib" = xzlib], + [AC_CHECK_LIB( + z, + compressBound, + [ac_zlib_dummy=yes]) - AS_IF( - [test "x$ac_cv_lib_z_compressBound" = xyes], - [AC_DEFINE( - [HAVE_ZLIB_COMPRESSBOUND], - [1], - [Define to 1 if compressBound funtion is available in zlib.]) - ]) + AS_IF( + [test "x$ac_cv_lib_z_compressBound" = xyes], + [AC_DEFINE( + [HAVE_ZLIB_COMPRESSBOUND], + [1], + [Define to 1 if compressBound funtion is available in zlib.]) + ]) + ]) ]) - ]) dnl Function to detect if the inflate functions are available AC_DEFUN([AX_ZLIB_CHECK_INFLATE], - [AS_IF( - [test "x$ac_cv_zlib" != xzlib], - [ac_cv_inflate=local], - [AC_CHECK_LIB( - z, - inflate, - [ac_cv_inflate=zlib], - [ac_cv_inflate=local]) - - AC_CHECK_LIB( - z, - inflateInit2, - [ac_zlib_dummy=yes]) + [AS_IF( + [test "x$ac_cv_zlib" != xzlib], + [ac_cv_inflate=local], + [AC_CHECK_LIB( + z, + inflate, + [ac_cv_inflate=zlib], + [ac_cv_inflate=local]) - dnl Some versions of zlib provide inflateInit2_ instead of inflateInit2 - AS_IF( - [test "x$ac_cv_lib_z_inflateinit2" = xno], - [AC_CHECK_LIB( - z, - inflateInit2_, - [ac_zlib_dummy=yes], - [ac_cv_inflate=local]) - ]) - - AC_CHECK_LIB( - z, - inflateEnd, - [ac_zlib_dummy=yes], - [ac_cv_inflate=local]) + AC_CHECK_LIB( + z, + inflateInit2, + [ac_zlib_dummy=yes]) - AS_IF( - [test "x$ac_cv_inflate" = xzlib], - [AC_DEFINE( - [HAVE_ZLIB_INFLATE], - [1], - [Define to 1 if you have the `inflateInit', `inflate', `inflateEnd' functions.]) - ]) + dnl Some versions of zlib provide inflateInit2_ instead of inflateInit2 + AS_IF( + [test "x$ac_cv_lib_z_inflateinit2" = xno], + [AC_CHECK_LIB( + z, + inflateInit2_, + [ac_zlib_dummy=yes], + [ac_cv_inflate=local]) + ]) - AS_IF( - [test "x$ac_cv_lib_z_inflateinit2" != xno], - [AC_DEFINE( - [HAVE_ZLIB_INFLATE_INIT2], - [1], - [Define to 1 if you have the `inflateInit2' function.]) - ]) + AC_CHECK_LIB( + z, + inflateEnd, + [ac_zlib_dummy=yes], + [ac_cv_inflate=local]) + + AS_IF( + [test "x$ac_cv_inflate" = xzlib], + [AC_DEFINE( + [HAVE_ZLIB_INFLATE], + [1], + [Define to 1 if you have the `inflateInit', `inflate', `inflateEnd' functions.]) + ]) + + AS_IF( + [test "x$ac_cv_lib_z_inflateinit2" != xno], + [AC_DEFINE( + [HAVE_ZLIB_INFLATE_INIT2], + [1], + [Define to 1 if you have the `inflateInit2' function.]) + ]) + ]) ]) - ]) dnl Function to detect if the uncompress function is available AC_DEFUN([AX_ZLIB_CHECK_UNCOMPRESS], - [AS_IF( - [test "x$ac_cv_zlib" != xzlib], - [ac_cv_uncompress=local], - [AC_CHECK_LIB( - z, - uncompress, - [ac_cv_uncompress=zlib], - [ac_cv_uncompress=local]) + [AS_IF( + [test "x$ac_cv_zlib" != xzlib], + [ac_cv_uncompress=local], + [AC_CHECK_LIB( + z, + uncompress, + [ac_cv_uncompress=zlib], + [ac_cv_uncompress=local]) - AS_IF( - [test "x$ac_cv_uncompress" = xzlib], - [AC_DEFINE( - [HAVE_ZLIB_UNCOMPRESS], - [1], - [Define to 1 if you have the `uncompress' function.]) - ]) + AS_IF( + [test "x$ac_cv_uncompress" = xzlib], + [AC_DEFINE( + [HAVE_ZLIB_UNCOMPRESS], + [1], + [Define to 1 if you have the `uncompress' function.]) + ]) + ]) ]) - ]) dnl Function to detect how to enable zlib AC_DEFUN([AX_ZLIB_CHECK_ENABLE], - [AX_COMMON_ARG_WITH( - [zlib], - [zlib], - [search for zlib in includedir and libdir or in the specified DIR, or no if not to use zlib], - [auto-detect], - [DIR]) - - dnl Check for a shared library version - AX_ZLIB_CHECK_LIB - - AS_IF( - [test "x$ac_cv_zlib_CPPFLAGS" != "x"], - [AC_SUBST( - [ZLIB_CPPFLAGS], - [$ac_cv_zlib_CPPFLAGS]) - ]) - AS_IF( - [test "x$ac_cv_zlib_LIBADD" != "x"], - [AC_SUBST( - [ZLIB_LIBADD], - [$ac_cv_zlib_LIBADD]) - ]) + [AX_COMMON_ARG_WITH( + [zlib], + [zlib], + [search for zlib in includedir and libdir or in the specified DIR, or no if not to use zlib], + [auto-detect], + [DIR]) - AS_IF( - [test "x$ac_cv_zlib" = xzlib], - [AC_SUBST( - [ax_zlib_pc_libs_private], - [-lz]) - ]) + dnl Check for a shared library version + AX_ZLIB_CHECK_LIB + + AS_IF( + [test "x$ac_cv_zlib_CPPFLAGS" != "x"], + [AC_SUBST( + [ZLIB_CPPFLAGS], + [$ac_cv_zlib_CPPFLAGS]) + ]) + AS_IF( + [test "x$ac_cv_zlib_LIBADD" != "x"], + [AC_SUBST( + [ZLIB_LIBADD], + [$ac_cv_zlib_LIBADD]) + ]) - AS_IF( - [test "x$ac_cv_zlib" = xzlib], - [AC_SUBST( - [ax_zlib_spec_requires], - [zlib]) - AC_SUBST( - [ax_zlib_spec_build_requires], - [zlib-devel]) - AC_SUBST( - [ax_zlib_static_spec_build_requires], - [zlib-static]) + AS_IF( + [test "x$ac_cv_zlib" = xzlib], + [AC_SUBST( + [ax_zlib_pc_libs_private], + [-lz]) + ]) + + AS_IF( + [test "x$ac_cv_zlib" = xzlib], + [AC_SUBST( + [ax_zlib_spec_requires], + [zlib]) + AC_SUBST( + [ax_zlib_spec_build_requires], + [zlib-devel]) + AC_SUBST( + [ax_zlib_static_spec_requires], + [zlib-static]) + AC_SUBST( + [ax_zlib_static_spec_build_requires], + [zlib-static]) + ]) ]) - ]) diff -Nru libfvde-20170930/Makefile.in libfvde-20180108/Makefile.in --- libfvde-20170930/Makefile.in 2017-10-04 19:28:14.000000000 +0000 +++ libfvde-20180108/Makefile.in 2018-01-08 20:19:37.000000000 +0000 @@ -550,6 +550,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/manuals/fvdeinfo.1 libfvde-20180108/manuals/fvdeinfo.1 --- libfvde-20170930/manuals/fvdeinfo.1 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/manuals/fvdeinfo.1 2018-01-08 17:42:47.000000000 +0000 @@ -34,7 +34,7 @@ shows this help .It Fl o Ar offset specify the volume offset -.It fl p Ar password +.It Fl p Ar password specify the password .It Fl r Ar password specify the recovery password @@ -71,7 +71,7 @@ .Sh AUTHOR These man pages were written by Joachim Metz. .Sh COPYRIGHT -Copyright (C) 2011-2017, Joachim Metz . +Copyright (C) 2011-2018, Joachim Metz . This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .Sh SEE ALSO .Xr fvdemount 1 diff -Nru libfvde-20170930/manuals/fvdemount.1 libfvde-20180108/manuals/fvdemount.1 --- libfvde-20170930/manuals/fvdemount.1 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/manuals/fvdemount.1 2018-01-08 17:42:47.000000000 +0000 @@ -65,7 +65,7 @@ .Sh AUTHOR These man pages were written by Joachim Metz. .Sh COPYRIGHT -Copyright (C) 2011-2017, Joachim Metz . +Copyright (C) 2011-2018, Joachim Metz . This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .Sh SEE ALSO .Xr fvdeinfo 1 diff -Nru libfvde-20170930/manuals/libfvde.3 libfvde-20180108/manuals/libfvde.3 --- libfvde-20170930/manuals/libfvde.3 2017-09-30 13:40:21.000000000 +0000 +++ libfvde-20180108/manuals/libfvde.3 2018-01-08 17:42:47.000000000 +0000 @@ -157,7 +157,7 @@ .Sh AUTHOR These man pages are generated from "libfvde.h". .Sh COPYRIGHT -Copyright (C) 2011-2017, Omar Choudary , Joachim Metz . +Copyright (C) 2011-2018, Omar Choudary , Joachim Metz . This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff -Nru libfvde-20170930/manuals/Makefile.in libfvde-20180108/manuals/Makefile.in --- libfvde-20170930/manuals/Makefile.in 2017-10-04 19:28:15.000000000 +0000 +++ libfvde-20180108/manuals/Makefile.in 2018-01-08 20:19:38.000000000 +0000 @@ -464,6 +464,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/msvscpp/fvde_test_segment_descriptor/fvde_test_segment_descriptor.vcproj libfvde-20180108/msvscpp/fvde_test_segment_descriptor/fvde_test_segment_descriptor.vcproj --- libfvde-20170930/msvscpp/fvde_test_segment_descriptor/fvde_test_segment_descriptor.vcproj 1970-01-01 00:00:00.000000000 +0000 +++ libfvde-20180108/msvscpp/fvde_test_segment_descriptor/fvde_test_segment_descriptor.vcproj 2018-01-08 17:02:24.000000000 +0000 @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru libfvde-20170930/msvscpp/fvde_test_support/fvde_test_support.vcproj libfvde-20180108/msvscpp/fvde_test_support/fvde_test_support.vcproj --- libfvde-20170930/msvscpp/fvde_test_support/fvde_test_support.vcproj 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/msvscpp/fvde_test_support/fvde_test_support.vcproj 2018-01-08 17:02:24.000000000 +0000 @@ -176,6 +176,10 @@ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > + + @@ -190,6 +194,10 @@ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > + + @@ -221,6 +229,10 @@ RelativePath="..\..\tests\fvde_test_macros.h" > + + + + @@ -194,10 +198,18 @@ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > + + + + @@ -225,6 +237,10 @@ RelativePath="..\..\tests\fvde_test_memory.h" > + + + + @@ -406,6 +410,10 @@ > + + diff -Nru libfvde-20170930/msvscpp/libfvde.sln libfvde-20180108/msvscpp/libfvde.sln --- libfvde-20170930/msvscpp/libfvde.sln 2017-09-30 13:38:20.000000000 +0000 +++ libfvde-20180108/msvscpp/libfvde.sln 2018-01-08 17:03:06.000000000 +0000 @@ -71,6 +71,12 @@ {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} = {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fvde_test_segment_descriptor", "fvde_test_segment_descriptor\fvde_test_segment_descriptor.vcproj", "{1BE4EC1D-D4C1-422E-9D0D-C042FDB6BCB0}" + ProjectSection(ProjectDependencies) = postProject + {542112B5-4CA5-4EA9-B28D-0BACEFE72AC9} = {542112B5-4CA5-4EA9-B28D-0BACEFE72AC9} + {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} = {BD3A95FA-A3DE-4B79-A889-A7E5ECA4B69C} + EndProjectSection +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fvde_test_support", "fvde_test_support\fvde_test_support.vcproj", "{73B17EC7-6BB9-4D24-88F1-EF465E8F2D18}" ProjectSection(ProjectDependencies) = postProject {41CFAFBF-A1C8-4704-AFEF-31979E6452B9} = {41CFAFBF-A1C8-4704-AFEF-31979E6452B9} @@ -87,7 +93,11 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fvde_test_volume", "fvde_test_volume\fvde_test_volume.vcproj", "{807C5455-E8B5-433E-9012-A284FD098D36}" ProjectSection(ProjectDependencies) = postProject + {41CFAFBF-A1C8-4704-AFEF-31979E6452B9} = {41CFAFBF-A1C8-4704-AFEF-31979E6452B9} + {3FFB9C05-1145-45A7-9ADE-5C8D70FBD7CA} = {3FFB9C05-1145-45A7-9ADE-5C8D70FBD7CA} + {4C93BDD3-1804-47F3-9B34-F2DE0CAE1AE0} = {4C93BDD3-1804-47F3-9B34-F2DE0CAE1AE0} {BC27FF34-C859-4A1A-95D6-FC89952E1910} = {BC27FF34-C859-4A1A-95D6-FC89952E1910} + {B86FB73A-4ACC-42DE-9545-586D93955B06} = {B86FB73A-4ACC-42DE-9545-586D93955B06} {5304AD69-D449-4589-B2C9-E4607E56A51D} = {5304AD69-D449-4589-B2C9-E4607E56A51D} {CEDF8919-00B2-4D8A-88CC-84ADB2D2FF89} = {CEDF8919-00B2-4D8A-88CC-84ADB2D2FF89} {B9332DC8-7594-47DF-80C1-38922E0F4DFB} = {B9332DC8-7594-47DF-80C1-38922E0F4DFB} @@ -342,6 +352,10 @@ {C3F8CF07-A6E9-4ACC-B05B-745F8316D686}.Release|Win32.Build.0 = Release|Win32 {C3F8CF07-A6E9-4ACC-B05B-745F8316D686}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {C3F8CF07-A6E9-4ACC-B05B-745F8316D686}.VSDebug|Win32.Build.0 = VSDebug|Win32 + {1BE4EC1D-D4C1-422E-9D0D-C042FDB6BCB0}.Release|Win32.ActiveCfg = Release|Win32 + {1BE4EC1D-D4C1-422E-9D0D-C042FDB6BCB0}.Release|Win32.Build.0 = Release|Win32 + {1BE4EC1D-D4C1-422E-9D0D-C042FDB6BCB0}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 + {1BE4EC1D-D4C1-422E-9D0D-C042FDB6BCB0}.VSDebug|Win32.Build.0 = VSDebug|Win32 {73B17EC7-6BB9-4D24-88F1-EF465E8F2D18}.Release|Win32.ActiveCfg = Release|Win32 {73B17EC7-6BB9-4D24-88F1-EF465E8F2D18}.Release|Win32.Build.0 = Release|Win32 {73B17EC7-6BB9-4D24-88F1-EF465E8F2D18}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 diff -Nru libfvde-20170930/msvscpp/Makefile.am libfvde-20180108/msvscpp/Makefile.am --- libfvde-20170930/msvscpp/Makefile.am 2017-09-30 13:38:20.000000000 +0000 +++ libfvde-20180108/msvscpp/Makefile.am 2018-01-08 17:03:06.000000000 +0000 @@ -10,6 +10,7 @@ fvde_test_metadata_block/fvde_test_metadata_block.vcproj \ fvde_test_notify/fvde_test_notify.vcproj \ fvde_test_sector_data/fvde_test_sector_data.vcproj \ + fvde_test_segment_descriptor/fvde_test_segment_descriptor.vcproj \ fvde_test_support/fvde_test_support.vcproj \ fvde_test_volume/fvde_test_volume.vcproj \ fvde_test_volume_group/fvde_test_volume_group.vcproj \ diff -Nru libfvde-20170930/msvscpp/Makefile.in libfvde-20180108/msvscpp/Makefile.in --- libfvde-20170930/msvscpp/Makefile.in 2017-10-04 19:28:15.000000000 +0000 +++ libfvde-20180108/msvscpp/Makefile.in 2018-01-08 20:19:38.000000000 +0000 @@ -432,6 +432,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -533,6 +534,7 @@ fvde_test_metadata_block/fvde_test_metadata_block.vcproj \ fvde_test_notify/fvde_test_notify.vcproj \ fvde_test_sector_data/fvde_test_sector_data.vcproj \ + fvde_test_segment_descriptor/fvde_test_segment_descriptor.vcproj \ fvde_test_support/fvde_test_support.vcproj \ fvde_test_volume/fvde_test_volume.vcproj \ fvde_test_volume_group/fvde_test_volume_group.vcproj \ diff -Nru libfvde-20170930/pyfvde/Makefile.in libfvde-20180108/pyfvde/Makefile.in --- libfvde-20170930/pyfvde/Makefile.in 2017-10-04 19:28:16.000000000 +0000 +++ libfvde-20180108/pyfvde/Makefile.in 2018-01-08 20:19:38.000000000 +0000 @@ -526,6 +526,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/pyfvde/pyfvde.c libfvde-20180108/pyfvde/pyfvde.c --- libfvde-20170930/pyfvde/pyfvde.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/pyfvde/pyfvde.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Python bindings module for libfvde (pyfvde) * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/pyfvde/pyfvde_datetime.c libfvde-20180108/pyfvde/pyfvde_datetime.c --- libfvde-20170930/pyfvde/pyfvde_datetime.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/pyfvde/pyfvde_datetime.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Date and time functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/pyfvde/pyfvde_datetime.h libfvde-20180108/pyfvde/pyfvde_datetime.h --- libfvde-20170930/pyfvde/pyfvde_datetime.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/pyfvde/pyfvde_datetime.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Date and time functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/pyfvde/pyfvde_error.c libfvde-20180108/pyfvde/pyfvde_error.c --- libfvde-20170930/pyfvde/pyfvde_error.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/pyfvde/pyfvde_error.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Error functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/pyfvde/pyfvde_error.h libfvde-20180108/pyfvde/pyfvde_error.h --- libfvde-20170930/pyfvde/pyfvde_error.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/pyfvde/pyfvde_error.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Error functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/pyfvde/pyfvde_file_object_io_handle.c libfvde-20180108/pyfvde/pyfvde_file_object_io_handle.c --- libfvde-20170930/pyfvde/pyfvde_file_object_io_handle.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/pyfvde/pyfvde_file_object_io_handle.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Python file object IO handle functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/pyfvde/pyfvde_file_object_io_handle.h libfvde-20180108/pyfvde/pyfvde_file_object_io_handle.h --- libfvde-20170930/pyfvde/pyfvde_file_object_io_handle.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/pyfvde/pyfvde_file_object_io_handle.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Python file object IO handle functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/pyfvde/pyfvde_guid.c libfvde-20180108/pyfvde/pyfvde_guid.c --- libfvde-20170930/pyfvde/pyfvde_guid.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/pyfvde/pyfvde_guid.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * GUID functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/pyfvde/pyfvde_guid.h libfvde-20180108/pyfvde/pyfvde_guid.h --- libfvde-20170930/pyfvde/pyfvde_guid.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/pyfvde/pyfvde_guid.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * GUID functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/pyfvde/pyfvde.h libfvde-20180108/pyfvde/pyfvde.h --- libfvde-20170930/pyfvde/pyfvde.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/pyfvde/pyfvde.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Python bindings for libfvde (pyfvde) * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/pyfvde/pyfvde_integer.c libfvde-20180108/pyfvde/pyfvde_integer.c --- libfvde-20170930/pyfvde/pyfvde_integer.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/pyfvde/pyfvde_integer.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Integer functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/pyfvde/pyfvde_integer.h libfvde-20180108/pyfvde/pyfvde_integer.h --- libfvde-20170930/pyfvde/pyfvde_integer.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/pyfvde/pyfvde_integer.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Integer functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/pyfvde/pyfvde_libbfio.h libfvde-20180108/pyfvde/pyfvde_libbfio.h --- libfvde-20170930/pyfvde/pyfvde_libbfio.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/pyfvde/pyfvde_libbfio.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The libbfio header wrapper * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/pyfvde/pyfvde_libcerror.h libfvde-20180108/pyfvde/pyfvde_libcerror.h --- libfvde-20170930/pyfvde/pyfvde_libcerror.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/pyfvde/pyfvde_libcerror.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libcerror header * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/pyfvde/pyfvde_libclocale.h libfvde-20180108/pyfvde/pyfvde_libclocale.h --- libfvde-20170930/pyfvde/pyfvde_libclocale.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/pyfvde/pyfvde_libclocale.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libclocale header * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/pyfvde/pyfvde_libfguid.h libfvde-20180108/pyfvde/pyfvde_libfguid.h --- libfvde-20170930/pyfvde/pyfvde_libfguid.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/pyfvde/pyfvde_libfguid.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libfguid header * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/pyfvde/pyfvde_libfvde.h libfvde-20180108/pyfvde/pyfvde_libfvde.h --- libfvde-20170930/pyfvde/pyfvde_libfvde.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/pyfvde/pyfvde_libfvde.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libfvde header * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/pyfvde/pyfvde_python.h libfvde-20180108/pyfvde/pyfvde_python.h --- libfvde-20170930/pyfvde/pyfvde_python.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/pyfvde/pyfvde_python.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The python header wrapper * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/pyfvde/pyfvde_unused.h libfvde-20180108/pyfvde/pyfvde_unused.h --- libfvde-20170930/pyfvde/pyfvde_unused.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/pyfvde/pyfvde_unused.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal unused definition * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/pyfvde/pyfvde_volume.c libfvde-20180108/pyfvde/pyfvde_volume.c --- libfvde-20170930/pyfvde/pyfvde_volume.c 2017-09-30 13:38:20.000000000 +0000 +++ libfvde-20180108/pyfvde/pyfvde_volume.c 2018-01-08 19:21:11.000000000 +0000 @@ -1,7 +1,7 @@ /* * Python object definition of the libfvde volume * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * @@ -42,13 +42,15 @@ #include "pyfvde_volume.h" #if !defined( LIBFVDE_HAVE_BFIO ) + LIBFVDE_EXTERN \ int libfvde_volume_open_file_io_handle( libfvde_volume_t *volume, libbfio_handle_t *file_io_handle, int access_flags, libfvde_error_t **error ); -#endif + +#endif /* !defined( LIBFVDE_HAVE_BFIO ) */ PyMethodDef pyfvde_volume_object_methods[] = { @@ -792,6 +794,16 @@ return( NULL ); } + if( pyfvde_volume->file_io_handle != NULL ) + { + pyfvde_error_raise( + error, + PyExc_IOError, + "%s: invalid volume - file IO handle already set.", + function ); + + goto on_error; + } if( pyfvde_file_object_initialize( &( pyfvde_volume->file_io_handle ), file_object, diff -Nru libfvde-20170930/pyfvde/pyfvde_volume.h libfvde-20180108/pyfvde/pyfvde_volume.h --- libfvde-20170930/pyfvde/pyfvde_volume.h 2017-09-30 13:38:20.000000000 +0000 +++ libfvde-20180108/pyfvde/pyfvde_volume.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Python object definition of the libfvde volume * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/pyfvde-python2/Makefile.in libfvde-20180108/pyfvde-python2/Makefile.in --- libfvde-20170930/pyfvde-python2/Makefile.in 2017-10-04 19:28:15.000000000 +0000 +++ libfvde-20180108/pyfvde-python2/Makefile.in 2018-01-08 20:19:38.000000000 +0000 @@ -518,6 +518,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/pyfvde-python3/Makefile.in libfvde-20180108/pyfvde-python3/Makefile.in --- libfvde-20170930/pyfvde-python3/Makefile.in 2017-10-04 19:28:16.000000000 +0000 +++ libfvde-20180108/pyfvde-python3/Makefile.in 2018-01-08 20:19:38.000000000 +0000 @@ -518,6 +518,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ diff -Nru libfvde-20170930/setup.py libfvde-20180108/setup.py --- libfvde-20170930/setup.py 2017-09-30 13:37:25.000000000 +0000 +++ libfvde-20180108/setup.py 2018-01-08 17:02:24.000000000 +0000 @@ -1,7 +1,7 @@ #!/usr/bin/env python # # Script to build and install Python-bindings. -# Version: 20160316 +# Version: 20171105 from __future__ import print_function import glob @@ -166,10 +166,10 @@ class ProjectInformation(object): - """Class to define the project information.""" + """Project information.""" def __init__(self): - """Initializes a project information object.""" + """Initializes project information.""" super(ProjectInformation, self).__init__() self.include_directories = [] self.library_name = None @@ -300,6 +300,12 @@ # shared libaries since pip does not integrate well with the system package # management. for library_name in project_information.library_names: + for source_file in glob.glob(os.path.join(library_name, "*.[ly]")): + generated_source_file = "{0:s}.c".format(source_file[:-2]) + if not os.path.exists(generated_source_file): + raise RuntimeError("Missing generated source file: {0:s}".format( + generated_source_file)) + source_files = glob.glob(os.path.join(library_name, "*.c")) SOURCES.extend(source_files) diff -Nru libfvde-20170930/tests/fvde_test_data_area_descriptor.c libfvde-20180108/tests/fvde_test_data_area_descriptor.c --- libfvde-20170930/tests/fvde_test_data_area_descriptor.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_data_area_descriptor.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Library data_area_descriptor type test program * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/fvde_test_encrypted_metadata.c libfvde-20180108/tests/fvde_test_encrypted_metadata.c --- libfvde-20170930/tests/fvde_test_encrypted_metadata.c 2017-09-30 13:38:20.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_encrypted_metadata.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Library encrypted_metadata type test program * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/fvde_test_encryption_context_plist.c libfvde-20180108/tests/fvde_test_encryption_context_plist.c --- libfvde-20170930/tests/fvde_test_encryption_context_plist.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_encryption_context_plist.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Library encryption_context_plist type test program * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/fvde_test_error.c libfvde-20180108/tests/fvde_test_error.c --- libfvde-20170930/tests/fvde_test_error.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_error.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Library error functions test program * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/fvde_test_functions.c libfvde-20180108/tests/fvde_test_functions.c --- libfvde-20170930/tests/fvde_test_functions.c 1970-01-01 00:00:00.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_functions.c 2018-01-08 17:42:47.000000000 +0000 @@ -0,0 +1,546 @@ +/* + * Functions for testing + * + * Copyright (C) 2011-2018, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This software is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +#if defined( HAVE_STDLIB_H ) || defined( WINAPI ) +#include +#endif + +#include "fvde_test_libcerror.h" +#include "fvde_test_libclocale.h" +#include "fvde_test_libuna.h" + +/* Retrieves source as a narrow string + * Returns 1 if successful or -1 on error + */ +int fvde_test_get_narrow_source( + const system_character_t *source, + char *narrow_string, + size_t narrow_string_size, + libcerror_error_t **error ) +{ + static char *function = "fvde_test_get_narrow_source"; + size_t narrow_source_size = 0; + size_t source_length = 0; + +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + int result = 0; +#endif + + if( source == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid source.", + function ); + + return( -1 ); + } + if( narrow_string == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid narrow string.", + function ); + + return( -1 ); + } + if( narrow_string_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid narrow string size value exceeds maximum.", + function ); + + return( -1 ); + } + source_length = system_string_length( + source ); + + if( source_length > (size_t) ( SSIZE_MAX - 1 ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid source length value out of bounds.", + function ); + + return( -1 ); + } +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + if( libclocale_codepage == 0 ) + { +#if SIZEOF_WCHAR_T == 4 + result = libuna_utf8_string_size_from_utf32( + (libuna_utf32_character_t *) source, + source_length + 1, + &narrow_source_size, + error ); +#elif SIZEOF_WCHAR_T == 2 + result = libuna_utf8_string_size_from_utf16( + (libuna_utf16_character_t *) source, + source_length + 1, + &narrow_source_size, + error ); +#endif + } + else + { +#if SIZEOF_WCHAR_T == 4 + result = libuna_byte_stream_size_from_utf32( + (libuna_utf32_character_t *) source, + source_length + 1, + libclocale_codepage, + &narrow_source_size, + error ); +#elif SIZEOF_WCHAR_T == 2 + result = libuna_byte_stream_size_from_utf16( + (libuna_utf16_character_t *) source, + source_length + 1, + libclocale_codepage, + &narrow_source_size, + error ); +#endif + } + if( result != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_CONVERSION, + LIBCERROR_CONVERSION_ERROR_GENERIC, + "%s: unable to determine narrow string size.", + function ); + + return( -1 ); + } +#else + narrow_source_size = source_length + 1; + +#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ + + if( narrow_string_size < narrow_source_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: narrow string too small.", + function ); + + return( -1 ); + } +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + if( libclocale_codepage == 0 ) + { +#if SIZEOF_WCHAR_T == 4 + result = libuna_utf8_string_copy_from_utf32( + (libuna_utf8_character_t *) narrow_string, + narrow_string_size, + (libuna_utf32_character_t *) source, + source_length + 1, + error ); +#elif SIZEOF_WCHAR_T == 2 + result = libuna_utf8_string_copy_from_utf16( + (libuna_utf8_character_t *) narrow_string, + narrow_string_size, + (libuna_utf16_character_t *) source, + source_length + 1, + error ); +#endif + } + else + { +#if SIZEOF_WCHAR_T == 4 + result = libuna_byte_stream_copy_from_utf32( + (uint8_t *) narrow_string, + narrow_string_size, + libclocale_codepage, + (libuna_utf32_character_t *) source, + source_length + 1, + error ); +#elif SIZEOF_WCHAR_T == 2 + result = libuna_byte_stream_copy_from_utf16( + (uint8_t *) narrow_string, + narrow_string_size, + libclocale_codepage, + (libuna_utf16_character_t *) source, + source_length + 1, + error ); +#endif + } + if( result != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_CONVERSION, + LIBCERROR_CONVERSION_ERROR_GENERIC, + "%s: unable to set narrow string.", + function ); + + return( -1 ); + } +#else + if( system_string_copy( + narrow_string, + source, + source_length ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to set narrow string.", + function ); + + return( -1 ); + } + narrow_string[ source_length ] = 0; + +#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ + + return( 1 ); +} + +#if defined( HAVE_WIDE_CHARACTER_TYPE ) + +/* Retrieves source as a wide string + * Returns 1 if successful or -1 on error + */ +int fvde_test_get_wide_source( + const system_character_t *source, + wchar_t *wide_string, + size_t wide_string_size, + libcerror_error_t **error ) +{ + static char *function = "fvde_test_get_wide_source"; + size_t wide_source_size = 0; + size_t source_length = 0; + +#if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) + int result = 0; +#endif + + if( source == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid source.", + function ); + + return( -1 ); + } + if( wide_string == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid wide string.", + function ); + + return( -1 ); + } + if( wide_string_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid wide string size value exceeds maximum.", + function ); + + return( -1 ); + } + source_length = system_string_length( + source ); + + if( source_length > (size_t) ( SSIZE_MAX - 1 ) ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, + "%s: invalid source length value out of bounds.", + function ); + + return( -1 ); + } +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + wide_source_size = source_length + 1; +#else + if( libclocale_codepage == 0 ) + { +#if SIZEOF_WCHAR_T == 4 + result = libuna_utf32_string_size_from_utf8( + (libuna_utf8_character_t *) source, + source_length + 1, + &wide_source_size, + error ); +#elif SIZEOF_WCHAR_T == 2 + result = libuna_utf16_string_size_from_utf8( + (libuna_utf8_character_t *) source, + source_length + 1, + &wide_source_size, + error ); +#endif + } + else + { +#if SIZEOF_WCHAR_T == 4 + result = libuna_utf32_string_size_from_byte_stream( + (uint8_t *) source, + source_length + 1, + libclocale_codepage, + &wide_source_size, + error ); +#elif SIZEOF_WCHAR_T == 2 + result = libuna_utf16_string_size_from_byte_stream( + (uint8_t *) source, + source_length + 1, + libclocale_codepage, + &wide_source_size, + error ); +#endif + } + if( result != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_CONVERSION, + LIBCERROR_CONVERSION_ERROR_GENERIC, + "%s: unable to determine wide string size.", + function ); + + return( -1 ); + } + +#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ + + if( wide_string_size < wide_source_size ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, + "%s: wide string too small.", + function ); + + return( -1 ); + } +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + if( system_string_copy( + wide_string, + source, + source_length ) == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_MEMORY, + LIBCERROR_MEMORY_ERROR_COPY_FAILED, + "%s: unable to set wide string.", + function ); + + return( -1 ); + } + wide_string[ source_length ] = 0; +#else + if( libclocale_codepage == 0 ) + { +#if SIZEOF_WCHAR_T == 4 + result = libuna_utf32_string_copy_from_utf8( + (libuna_utf32_character_t *) wide_string, + wide_string_size, + (uint8_t *) source, + source_length + 1, + error ); +#elif SIZEOF_WCHAR_T == 2 + result = libuna_utf16_string_copy_from_utf8( + (libuna_utf16_character_t *) wide_string, + wide_string_size, + (uint8_t *) source, + source_length + 1, + error ); +#endif + } + else + { +#if SIZEOF_WCHAR_T == 4 + result = libuna_utf32_string_copy_from_byte_stream( + (libuna_utf32_character_t *) wide_string, + wide_string_size, + (uint8_t *) source, + source_length + 1, + libclocale_codepage, + error ); +#elif SIZEOF_WCHAR_T == 2 + result = libuna_utf16_string_copy_from_byte_stream( + (libuna_utf16_character_t *) wide_string, + wide_string_size, + (uint8_t *) source, + source_length + 1, + libclocale_codepage, + error ); +#endif + } + if( result != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_CONVERSION, + LIBCERROR_CONVERSION_ERROR_GENERIC, + "%s: unable to set wide string.", + function ); + + return( -1 ); + } + +#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ + + return( 1 ); +} + +#endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ + +/* Copies a string of a decimal value to a 64-bit value + * Returns 1 if successful or -1 on error + */ +int fvde_test_system_string_copy_from_64_bit_in_decimal( + const system_character_t *string, + size_t string_size, + uint64_t *value_64bit, + libcerror_error_t **error ) +{ + static char *function = "fvde_test_system_string_copy_from_64_bit_in_decimal"; + size_t string_index = 0; + system_character_t character_value = 0; + uint8_t maximum_string_index = 20; + int8_t sign = 1; + + if( string == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid string.", + function ); + + return( -1 ); + } + if( string_size > (size_t) SSIZE_MAX ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, + "%s: invalid string size value exceeds maximum.", + function ); + + return( -1 ); + } + if( value_64bit == NULL ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, + "%s: invalid value 64-bit.", + function ); + + return( -1 ); + } + *value_64bit = 0; + + if( string[ string_index ] == (system_character_t) '-' ) + { + string_index++; + maximum_string_index++; + + sign = -1; + } + else if( string[ string_index ] == (system_character_t) '+' ) + { + string_index++; + maximum_string_index++; + } + while( string_index < string_size ) + { + if( string[ string_index ] == 0 ) + { + break; + } + if( string_index > (size_t) maximum_string_index ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_ARGUMENTS, + LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE, + "%s: string too large.", + function ); + + return( -1 ); + } + *value_64bit *= 10; + + if( ( string[ string_index ] >= (system_character_t) '0' ) + && ( string[ string_index ] <= (system_character_t) '9' ) ) + { + character_value = (system_character_t) ( string[ string_index ] - (system_character_t) '0' ); + } + else + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE, + "%s: unsupported character value: %" PRIc_SYSTEM " at index: %d.", + function, + string[ string_index ], + string_index ); + + return( -1 ); + } + *value_64bit += character_value; + + string_index++; + } + if( sign == -1 ) + { + *value_64bit *= (uint64_t) -1; + } + return( 1 ); +} + diff -Nru libfvde-20170930/tests/fvde_test_functions.h libfvde-20180108/tests/fvde_test_functions.h --- libfvde-20170930/tests/fvde_test_functions.h 1970-01-01 00:00:00.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_functions.h 2018-01-08 17:42:47.000000000 +0000 @@ -0,0 +1,61 @@ +/* + * Functions for testing + * + * Copyright (C) 2011-2018, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This software is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software. If not, see . + */ + +#if !defined( _FVDE_TEST_FUNCTIONS_H ) +#define _FVDE_TEST_FUNCTIONS_H + +#include +#include + +#include "fvde_test_libcerror.h" + +#if defined( __cplusplus ) +extern "C" { +#endif + +int fvde_test_get_narrow_source( + const system_character_t *source, + char *narrow_string, + size_t narrow_string_size, + libcerror_error_t **error ); + +#if defined( HAVE_WIDE_CHARACTER_TYPE ) + +int fvde_test_get_wide_source( + const system_character_t *source, + wchar_t *wide_string, + size_t wide_string_size, + libcerror_error_t **error ); + +#endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ + +int fvde_test_system_string_copy_from_64_bit_in_decimal( + const system_character_t *string, + size_t string_size, + uint64_t *value_64bit, + libcerror_error_t **error ); + +#if defined( __cplusplus ) +} +#endif + +#endif /* !defined( _FVDE_TEST_FUNCTIONS_H ) */ + diff -Nru libfvde-20170930/tests/fvde_test_getopt.c libfvde-20180108/tests/fvde_test_getopt.c --- libfvde-20170930/tests/fvde_test_getopt.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_getopt.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * GetOpt functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/fvde_test_getopt.h libfvde-20180108/tests/fvde_test_getopt.h --- libfvde-20170930/tests/fvde_test_getopt.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_getopt.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * GetOpt functions * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/fvde_test_io_handle.c libfvde-20180108/tests/fvde_test_io_handle.c --- libfvde-20170930/tests/fvde_test_io_handle.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_io_handle.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Library io_handle type test program * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/fvde_test_keyring.c libfvde-20180108/tests/fvde_test_keyring.c --- libfvde-20170930/tests/fvde_test_keyring.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_keyring.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Library keyring type test program * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/fvde_test_libbfio.h libfvde-20180108/tests/fvde_test_libbfio.h --- libfvde-20170930/tests/fvde_test_libbfio.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_libbfio.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The libbfio header wrapper * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/fvde_test_libcerror.h libfvde-20180108/tests/fvde_test_libcerror.h --- libfvde-20170930/tests/fvde_test_libcerror.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_libcerror.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libcerror header * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/fvde_test_libclocale.h libfvde-20180108/tests/fvde_test_libclocale.h --- libfvde-20170930/tests/fvde_test_libclocale.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_libclocale.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libclocale header * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/fvde_test_libcnotify.h libfvde-20180108/tests/fvde_test_libcnotify.h --- libfvde-20170930/tests/fvde_test_libcnotify.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_libcnotify.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libcnotify header * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/fvde_test_libfvde.h libfvde-20180108/tests/fvde_test_libfvde.h --- libfvde-20170930/tests/fvde_test_libfvde.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_libfvde.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The internal libfvde header * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/fvde_test_libuna.h libfvde-20180108/tests/fvde_test_libuna.h --- libfvde-20170930/tests/fvde_test_libuna.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_libuna.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The libuna header wrapper * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/fvde_test_macros.h libfvde-20180108/tests/fvde_test_macros.h --- libfvde-20170930/tests/fvde_test_macros.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_macros.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Macros for testing * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/fvde_test_memory.c libfvde-20180108/tests/fvde_test_memory.c --- libfvde-20170930/tests/fvde_test_memory.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_memory.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Memory allocation functions for testing * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/fvde_test_memory.h libfvde-20180108/tests/fvde_test_memory.h --- libfvde-20170930/tests/fvde_test_memory.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_memory.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Memory allocation functions for testing * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/fvde_test_metadata_block.c libfvde-20180108/tests/fvde_test_metadata_block.c --- libfvde-20170930/tests/fvde_test_metadata_block.c 2017-09-30 13:38:20.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_metadata_block.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Library metadata_block type test program * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/fvde_test_metadata.c libfvde-20180108/tests/fvde_test_metadata.c --- libfvde-20170930/tests/fvde_test_metadata.c 2017-09-30 13:38:20.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_metadata.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Library metadata type test program * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/fvde_test_notify.c libfvde-20180108/tests/fvde_test_notify.c --- libfvde-20170930/tests/fvde_test_notify.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_notify.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Library notification functions test program * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/fvde_test_sector_data.c libfvde-20180108/tests/fvde_test_sector_data.c --- libfvde-20170930/tests/fvde_test_sector_data.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_sector_data.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Library sector_data type test program * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/fvde_test_segment_descriptor.c libfvde-20180108/tests/fvde_test_segment_descriptor.c --- libfvde-20170930/tests/fvde_test_segment_descriptor.c 1970-01-01 00:00:00.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_segment_descriptor.c 2018-01-08 17:42:47.000000000 +0000 @@ -0,0 +1,315 @@ +/* + * Library segment_descriptor type test program + * + * Copyright (C) 2011-2018, Joachim Metz + * + * Refer to AUTHORS for acknowledgements. + * + * This software is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this software. If not, see . + */ + +#include +#include +#include + +#if defined( HAVE_STDLIB_H ) || defined( WINAPI ) +#include +#endif + +#include "fvde_test_libcerror.h" +#include "fvde_test_libfvde.h" +#include "fvde_test_macros.h" +#include "fvde_test_memory.h" +#include "fvde_test_unused.h" + +#include "../libfvde/libfvde_segment_descriptor.h" + +#if defined( __GNUC__ ) && !defined( LIBFVDE_DLL_IMPORT ) + +/* Tests the libfvde_segment_descriptor_initialize function + * Returns 1 if successful or 0 if not + */ +int fvde_test_segment_descriptor_initialize( + void ) +{ + libcerror_error_t *error = NULL; + libfvde_segment_descriptor_t *segment_descriptor = NULL; + int result = 0; + +#if defined( HAVE_FVDE_TEST_MEMORY ) + int number_of_malloc_fail_tests = 1; + int number_of_memset_fail_tests = 1; + int test_number = 0; +#endif + + /* Test regular cases + */ + result = libfvde_segment_descriptor_initialize( + &segment_descriptor, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + FVDE_TEST_ASSERT_IS_NOT_NULL( + "segment_descriptor", + segment_descriptor ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + result = libfvde_segment_descriptor_free( + &segment_descriptor, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + FVDE_TEST_ASSERT_IS_NULL( + "segment_descriptor", + segment_descriptor ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test error cases + */ + result = libfvde_segment_descriptor_initialize( + NULL, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + FVDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + segment_descriptor = (libfvde_segment_descriptor_t *) 0x12345678UL; + + result = libfvde_segment_descriptor_initialize( + &segment_descriptor, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + FVDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + segment_descriptor = NULL; + +#if defined( HAVE_FVDE_TEST_MEMORY ) + + for( test_number = 0; + test_number < number_of_malloc_fail_tests; + test_number++ ) + { + /* Test libfvde_segment_descriptor_initialize with malloc failing + */ + fvde_test_malloc_attempts_before_fail = test_number; + + result = libfvde_segment_descriptor_initialize( + &segment_descriptor, + &error ); + + if( fvde_test_malloc_attempts_before_fail != -1 ) + { + fvde_test_malloc_attempts_before_fail = -1; + + if( segment_descriptor != NULL ) + { + libfvde_segment_descriptor_free( + &segment_descriptor, + NULL ); + } + } + else + { + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + FVDE_TEST_ASSERT_IS_NULL( + "segment_descriptor", + segment_descriptor ); + + FVDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } + } + for( test_number = 0; + test_number < number_of_memset_fail_tests; + test_number++ ) + { + /* Test libfvde_segment_descriptor_initialize with memset failing + */ + fvde_test_memset_attempts_before_fail = test_number; + + result = libfvde_segment_descriptor_initialize( + &segment_descriptor, + &error ); + + if( fvde_test_memset_attempts_before_fail != -1 ) + { + fvde_test_memset_attempts_before_fail = -1; + + if( segment_descriptor != NULL ) + { + libfvde_segment_descriptor_free( + &segment_descriptor, + NULL ); + } + } + else + { + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + FVDE_TEST_ASSERT_IS_NULL( + "segment_descriptor", + segment_descriptor ); + + FVDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + } + } +#endif /* defined( HAVE_FVDE_TEST_MEMORY ) */ + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + if( segment_descriptor != NULL ) + { + libfvde_segment_descriptor_free( + &segment_descriptor, + NULL ); + } + return( 0 ); +} + +/* Tests the libfvde_segment_descriptor_free function + * Returns 1 if successful or 0 if not + */ +int fvde_test_segment_descriptor_free( + void ) +{ + libcerror_error_t *error = NULL; + int result = 0; + + /* Test error cases + */ + result = libfvde_segment_descriptor_free( + NULL, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + FVDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + return( 0 ); +} + +#endif /* defined( __GNUC__ ) && !defined( LIBFVDE_DLL_IMPORT ) */ + +/* The main program + */ +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) +int wmain( + int argc FVDE_TEST_ATTRIBUTE_UNUSED, + wchar_t * const argv[] FVDE_TEST_ATTRIBUTE_UNUSED ) +#else +int main( + int argc FVDE_TEST_ATTRIBUTE_UNUSED, + char * const argv[] FVDE_TEST_ATTRIBUTE_UNUSED ) +#endif +{ + FVDE_TEST_UNREFERENCED_PARAMETER( argc ) + FVDE_TEST_UNREFERENCED_PARAMETER( argv ) + +#if defined( HAVE_DEBUG_OUTPUT ) && defined( FVDE_TEST_SEGMENT_DESCRIPTOR_VERBOSE ) + libfvde_notify_set_verbose( + 1 ); + libfvde_notify_set_stream( + stderr, + NULL ); +#endif + +#if defined( __GNUC__ ) && !defined( LIBFVDE_DLL_IMPORT ) + + FVDE_TEST_RUN( + "libfvde_segment_descriptor_initialize", + fvde_test_segment_descriptor_initialize ); + + FVDE_TEST_RUN( + "libfvde_segment_descriptor_free", + fvde_test_segment_descriptor_free ); + +#endif /* defined( __GNUC__ ) && !defined( LIBFVDE_DLL_IMPORT ) */ + + return( EXIT_SUCCESS ); + +on_error: + return( EXIT_FAILURE ); +} + diff -Nru libfvde-20170930/tests/fvde_test_support.c libfvde-20180108/tests/fvde_test_support.c --- libfvde-20170930/tests/fvde_test_support.c 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_support.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Library support functions test program * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * @@ -30,419 +30,22 @@ #include #endif +#include "fvde_test_functions.h" #include "fvde_test_getopt.h" #include "fvde_test_libbfio.h" #include "fvde_test_libcerror.h" -#include "fvde_test_libclocale.h" #include "fvde_test_libfvde.h" -#include "fvde_test_libuna.h" #include "fvde_test_macros.h" #include "fvde_test_unused.h" +#if !defined( LIBFVDE_HAVE_BFIO ) + LIBFVDE_EXTERN \ int libfvde_check_volume_signature_file_io_handle( libbfio_handle_t *file_io_handle, libcerror_error_t **error ); -/* Retrieves source as a narrow string - * Returns 1 if successful or -1 on error - */ -int fvde_test_support_get_narrow_source( - const system_character_t *source, - char *narrow_string, - size_t narrow_string_size, - libcerror_error_t **error ) -{ - static char *function = "fvde_test_support_get_narrow_source"; - size_t narrow_source_size = 0; - size_t source_length = 0; - -#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) - int result = 0; -#endif - - if( source == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid source.", - function ); - - return( -1 ); - } - if( narrow_string == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid narrow string.", - function ); - - return( -1 ); - } - if( narrow_string_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid narrow string size value exceeds maximum.", - function ); - - return( -1 ); - } - source_length = system_string_length( - source ); - - if( source_length > (size_t) ( SSIZE_MAX - 1 ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid source length value out of bounds.", - function ); - - return( -1 ); - } -#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) - if( libclocale_codepage == 0 ) - { -#if SIZEOF_WCHAR_T == 4 - result = libuna_utf8_string_size_from_utf32( - (libuna_utf32_character_t *) source, - source_length + 1, - &narrow_source_size, - error ); -#elif SIZEOF_WCHAR_T == 2 - result = libuna_utf8_string_size_from_utf16( - (libuna_utf16_character_t *) source, - source_length + 1, - &narrow_source_size, - error ); -#endif - } - else - { -#if SIZEOF_WCHAR_T == 4 - result = libuna_byte_stream_size_from_utf32( - (libuna_utf32_character_t *) source, - source_length + 1, - libclocale_codepage, - &narrow_source_size, - error ); -#elif SIZEOF_WCHAR_T == 2 - result = libuna_byte_stream_size_from_utf16( - (libuna_utf16_character_t *) source, - source_length + 1, - libclocale_codepage, - &narrow_source_size, - error ); -#endif - } - if( result != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_CONVERSION, - LIBCERROR_CONVERSION_ERROR_GENERIC, - "%s: unable to determine narrow string size.", - function ); - - return( -1 ); - } -#else - narrow_source_size = source_length + 1; - -#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ - - if( narrow_string_size < narrow_source_size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: narrow string too small.", - function ); - - return( -1 ); - } -#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) - if( libclocale_codepage == 0 ) - { -#if SIZEOF_WCHAR_T == 4 - result = libuna_utf8_string_copy_from_utf32( - (libuna_utf8_character_t *) narrow_string, - narrow_string_size, - (libuna_utf32_character_t *) source, - source_length + 1, - error ); -#elif SIZEOF_WCHAR_T == 2 - result = libuna_utf8_string_copy_from_utf16( - (libuna_utf8_character_t *) narrow_string, - narrow_string_size, - (libuna_utf16_character_t *) source, - source_length + 1, - error ); -#endif - } - else - { -#if SIZEOF_WCHAR_T == 4 - result = libuna_byte_stream_copy_from_utf32( - (uint8_t *) narrow_string, - narrow_string_size, - libclocale_codepage, - (libuna_utf32_character_t *) source, - source_length + 1, - error ); -#elif SIZEOF_WCHAR_T == 2 - result = libuna_byte_stream_copy_from_utf16( - (uint8_t *) narrow_string, - narrow_string_size, - libclocale_codepage, - (libuna_utf16_character_t *) source, - source_length + 1, - error ); -#endif - } - if( result != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_CONVERSION, - LIBCERROR_CONVERSION_ERROR_GENERIC, - "%s: unable to set narrow string.", - function ); - - return( -1 ); - } -#else - if( system_string_copy( - narrow_string, - source, - source_length ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to set narrow string.", - function ); - - return( -1 ); - } - narrow_string[ source_length ] = 0; - -#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ - - return( 1 ); -} - -#if defined( HAVE_WIDE_CHARACTER_TYPE ) - -/* Retrieves source as a wide string - * Returns 1 if successful or -1 on error - */ -int fvde_test_support_get_wide_source( - const system_character_t *source, - wchar_t *wide_string, - size_t wide_string_size, - libcerror_error_t **error ) -{ - static char *function = "fvde_test_support_get_wide_source"; - size_t wide_source_size = 0; - size_t source_length = 0; - -#if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) - int result = 0; -#endif - - if( source == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid source.", - function ); - - return( -1 ); - } - if( wide_string == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid wide string.", - function ); - - return( -1 ); - } - if( wide_string_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid wide string size value exceeds maximum.", - function ); - - return( -1 ); - } - source_length = system_string_length( - source ); - - if( source_length > (size_t) ( SSIZE_MAX - 1 ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid source length value out of bounds.", - function ); - - return( -1 ); - } -#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) - wide_source_size = source_length + 1; -#else - if( libclocale_codepage == 0 ) - { -#if SIZEOF_WCHAR_T == 4 - result = libuna_utf32_string_size_from_utf8( - (libuna_utf8_character_t *) source, - source_length + 1, - &wide_source_size, - error ); -#elif SIZEOF_WCHAR_T == 2 - result = libuna_utf16_string_size_from_utf8( - (libuna_utf8_character_t *) source, - source_length + 1, - &wide_source_size, - error ); -#endif - } - else - { -#if SIZEOF_WCHAR_T == 4 - result = libuna_utf32_string_size_from_byte_stream( - (uint8_t *) source, - source_length + 1, - libclocale_codepage, - &wide_source_size, - error ); -#elif SIZEOF_WCHAR_T == 2 - result = libuna_utf16_string_size_from_byte_stream( - (uint8_t *) source, - source_length + 1, - libclocale_codepage, - &wide_source_size, - error ); -#endif - } - if( result != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_CONVERSION, - LIBCERROR_CONVERSION_ERROR_GENERIC, - "%s: unable to determine wide string size.", - function ); - - return( -1 ); - } - -#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ - - if( wide_string_size < wide_source_size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: wide string too small.", - function ); - - return( -1 ); - } -#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) - if( system_string_copy( - wide_string, - source, - source_length ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to set wide string.", - function ); - - return( -1 ); - } - wide_string[ source_length ] = 0; -#else - if( libclocale_codepage == 0 ) - { -#if SIZEOF_WCHAR_T == 4 - result = libuna_utf32_string_copy_from_utf8( - (libuna_utf32_character_t *) wide_string, - wide_string_size, - (uint8_t *) source, - source_length + 1, - error ); -#elif SIZEOF_WCHAR_T == 2 - result = libuna_utf16_string_copy_from_utf8( - (libuna_utf16_character_t *) wide_string, - wide_string_size, - (uint8_t *) source, - source_length + 1, - error ); -#endif - } - else - { -#if SIZEOF_WCHAR_T == 4 - result = libuna_utf32_string_copy_from_byte_stream( - (libuna_utf32_character_t *) wide_string, - wide_string_size, - (uint8_t *) source, - source_length + 1, - libclocale_codepage, - error ); -#elif SIZEOF_WCHAR_T == 2 - result = libuna_utf16_string_copy_from_byte_stream( - (libuna_utf16_character_t *) wide_string, - wide_string_size, - (uint8_t *) source, - source_length + 1, - libclocale_codepage, - error ); -#endif - } - if( result != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_CONVERSION, - LIBCERROR_CONVERSION_ERROR_GENERIC, - "%s: unable to set wide string.", - function ); - - return( -1 ); - } - -#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ - - return( 1 ); -} - -#endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ +#endif /* !defined( LIBFVDE_HAVE_BFIO ) */ /* Tests the libfvde_get_version function * Returns 1 if successful or 0 if not @@ -608,7 +211,7 @@ /* Initialize test */ - result = fvde_test_support_get_narrow_source( + result = fvde_test_get_narrow_source( source, narrow_source, 256, @@ -682,7 +285,7 @@ /* Initialize test */ - result = fvde_test_support_get_wide_source( + result = fvde_test_get_wide_source( source, wide_source, 256, @@ -749,7 +352,7 @@ int fvde_test_check_volume_signature_file_io_handle( const system_character_t *source ) { - uint8_t empty_block[ 512 ]; + uint8_t empty_block[ 4096 ]; libbfio_handle_t *file_io_handle = NULL; libcerror_error_t *error = NULL; @@ -885,7 +488,7 @@ memset_result = memory_set( empty_block, 0, - sizeof( uint8_t ) * 512 ); + sizeof( uint8_t ) * 4096 ); FVDE_TEST_ASSERT_IS_NOT_NULL( "memset_result", @@ -911,7 +514,7 @@ result = libbfio_memory_range_set( file_io_handle, empty_block, - sizeof( uint8_t ) * 512, + sizeof( uint8_t ) * 4096, &error ); FVDE_TEST_ASSERT_EQUAL_INT( @@ -1015,13 +618,18 @@ char * const argv[] ) #endif { - system_character_t *source = NULL; - system_integer_t option = 0; + libcerror_error_t *error = NULL; + system_character_t *option_offset = NULL; + system_character_t *source = NULL; + system_integer_t option = 0; + size_t string_length = 0; + off64_t volume_offset = 0; + int result = 0; while( ( option = fvde_test_getopt( argc, argv, - _SYSTEM_STRING( "" ) ) ) != (system_integer_t) -1 ) + _SYSTEM_STRING( "o:p:" ) ) ) != (system_integer_t) -1 ) { switch( option ) { @@ -1033,13 +641,40 @@ argv[ optind - 1 ] ); return( EXIT_FAILURE ); + + case (system_integer_t) 'o': + option_offset = optarg; + + break; + + case (system_integer_t) 'p': + break; } } if( optind < argc ) { source = argv[ optind ]; } + if( option_offset != NULL ) + { + string_length = system_string_length( + option_offset ); + result = fvde_test_system_string_copy_from_64_bit_in_decimal( + option_offset, + string_length + 1, + (uint64_t *) &volume_offset, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + } FVDE_TEST_RUN( "libfvde_get_version", fvde_test_get_version ); @@ -1057,7 +692,8 @@ fvde_test_set_codepage ); #if !defined( __BORLANDC__ ) || ( __BORLANDC__ >= 0x0560 ) - if( source != NULL ) + if( ( source != NULL ) + && ( volume_offset == 0 ) ) { FVDE_TEST_RUN_WITH_ARGS( "libfvde_check_volume_signature", @@ -1083,6 +719,11 @@ return( EXIT_SUCCESS ); on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } return( EXIT_FAILURE ); } diff -Nru libfvde-20170930/tests/fvde_test_unused.h libfvde-20180108/tests/fvde_test_unused.h --- libfvde-20170930/tests/fvde_test_unused.h 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_unused.h 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * The unused definition * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/fvde_test_volume.c libfvde-20180108/tests/fvde_test_volume.c --- libfvde-20170930/tests/fvde_test_volume.c 2017-09-30 13:38:20.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_volume.c 2018-01-08 19:53:23.000000000 +0000 @@ -1,7 +1,7 @@ /* * Library volume type test program * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * @@ -30,431 +30,52 @@ #include #endif +#include "fvde_test_functions.h" #include "fvde_test_getopt.h" +#include "fvde_test_libbfio.h" #include "fvde_test_libcerror.h" -#include "fvde_test_libclocale.h" #include "fvde_test_libfvde.h" -#include "fvde_test_libuna.h" #include "fvde_test_macros.h" #include "fvde_test_memory.h" +#include "fvde_test_unused.h" -#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) && SIZEOF_WCHAR_T != 2 && SIZEOF_WCHAR_T != 4 -#error Unsupported size of wchar_t -#endif - -/* Define to make fvde_test_volume generate verbose output -#define FVDE_TEST_VOLUME_VERBOSE - */ - -/* Retrieves source as a narrow string - * Returns 1 if successful or -1 on error - */ -int fvde_test_volume_get_narrow_source( - const system_character_t *source, - char *narrow_string, - size_t narrow_string_size, - libcerror_error_t **error ) -{ - static char *function = "fvde_test_volume_get_narrow_source"; - size_t narrow_source_size = 0; - size_t source_length = 0; - -#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) - int result = 0; -#endif - - if( source == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid source.", - function ); - - return( -1 ); - } - if( narrow_string == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid narrow string.", - function ); +#include "../libfvde/libfvde_volume.h" - return( -1 ); - } - if( narrow_string_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid narrow string size value exceeds maximum.", - function ); - - return( -1 ); - } - source_length = system_string_length( - source ); - - if( source_length > (size_t) ( SSIZE_MAX - 1 ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid source length value out of bounds.", - function ); - - return( -1 ); - } -#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) - if( libclocale_codepage == 0 ) - { -#if SIZEOF_WCHAR_T == 4 - result = libuna_utf8_string_size_from_utf32( - (libuna_utf32_character_t *) source, - source_length + 1, - &narrow_source_size, - error ); -#elif SIZEOF_WCHAR_T == 2 - result = libuna_utf8_string_size_from_utf16( - (libuna_utf16_character_t *) source, - source_length + 1, - &narrow_source_size, - error ); -#endif - } - else - { -#if SIZEOF_WCHAR_T == 4 - result = libuna_byte_stream_size_from_utf32( - (libuna_utf32_character_t *) source, - source_length + 1, - libclocale_codepage, - &narrow_source_size, - error ); -#elif SIZEOF_WCHAR_T == 2 - result = libuna_byte_stream_size_from_utf16( - (libuna_utf16_character_t *) source, - source_length + 1, - libclocale_codepage, - &narrow_source_size, - error ); -#endif - } - if( result != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_CONVERSION, - LIBCERROR_CONVERSION_ERROR_GENERIC, - "%s: unable to determine narrow string size.", - function ); +#if !defined( LIBFVDE_HAVE_BFIO ) - return( -1 ); - } -#else - narrow_source_size = source_length + 1; +LIBFVDE_EXTERN \ +int libfvde_check_volume_signature_file_io_handle( + libbfio_handle_t *file_io_handle, + libcerror_error_t **error ); -#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ +LIBFVDE_EXTERN \ +int libfvde_volume_open_file_io_handle( + libfvde_volume_t *volume, + libbfio_handle_t *file_io_handle, + int access_flags, + libfvde_error_t **error ); - if( narrow_string_size < narrow_source_size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: narrow string too small.", - function ); +#endif /* !defined( LIBFVDE_HAVE_BFIO ) */ - return( -1 ); - } -#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) - if( libclocale_codepage == 0 ) - { -#if SIZEOF_WCHAR_T == 4 - result = libuna_utf8_string_copy_from_utf32( - (libuna_utf8_character_t *) narrow_string, - narrow_string_size, - (libuna_utf32_character_t *) source, - source_length + 1, - error ); -#elif SIZEOF_WCHAR_T == 2 - result = libuna_utf8_string_copy_from_utf16( - (libuna_utf8_character_t *) narrow_string, - narrow_string_size, - (libuna_utf16_character_t *) source, - source_length + 1, - error ); -#endif - } - else - { -#if SIZEOF_WCHAR_T == 4 - result = libuna_byte_stream_copy_from_utf32( - (uint8_t *) narrow_string, - narrow_string_size, - libclocale_codepage, - (libuna_utf32_character_t *) source, - source_length + 1, - error ); -#elif SIZEOF_WCHAR_T == 2 - result = libuna_byte_stream_copy_from_utf16( - (uint8_t *) narrow_string, - narrow_string_size, - libclocale_codepage, - (libuna_utf16_character_t *) source, - source_length + 1, - error ); +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) && SIZEOF_WCHAR_T != 2 && SIZEOF_WCHAR_T != 4 +#error Unsupported size of wchar_t #endif - } - if( result != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_CONVERSION, - LIBCERROR_CONVERSION_ERROR_GENERIC, - "%s: unable to set narrow string.", - function ); - - return( -1 ); - } -#else - if( system_string_copy( - narrow_string, - source, - source_length ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to set narrow string.", - function ); - - return( -1 ); - } - narrow_string[ source_length ] = 0; - -#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ - - return( 1 ); -} - -#if defined( HAVE_WIDE_CHARACTER_TYPE ) -/* Retrieves source as a wide string - * Returns 1 if successful or -1 on error +/* Define to make fvde_test_volume generate verbose output +#define FVDE_TEST_VOLUME_VERBOSE */ -int fvde_test_volume_get_wide_source( - const system_character_t *source, - wchar_t *wide_string, - size_t wide_string_size, - libcerror_error_t **error ) -{ - static char *function = "fvde_test_volume_get_wide_source"; - size_t source_length = 0; - size_t wide_source_size = 0; - -#if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) - int result = 0; -#endif - - if( source == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid source.", - function ); - - return( -1 ); - } - if( wide_string == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid wide string.", - function ); - - return( -1 ); - } - if( wide_string_size > (size_t) SSIZE_MAX ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM, - "%s: invalid wide string size value exceeds maximum.", - function ); - - return( -1 ); - } - source_length = system_string_length( - source ); - - if( source_length > (size_t) ( SSIZE_MAX - 1 ) ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_RUNTIME, - LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS, - "%s: invalid source length value out of bounds.", - function ); - - return( -1 ); - } -#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) - wide_source_size = source_length + 1; -#else - if( libclocale_codepage == 0 ) - { -#if SIZEOF_WCHAR_T == 4 - result = libuna_utf32_string_size_from_utf8( - (libuna_utf8_character_t *) source, - source_length + 1, - &wide_source_size, - error ); -#elif SIZEOF_WCHAR_T == 2 - result = libuna_utf16_string_size_from_utf8( - (libuna_utf8_character_t *) source, - source_length + 1, - &wide_source_size, - error ); -#endif - } - else - { -#if SIZEOF_WCHAR_T == 4 - result = libuna_utf32_string_size_from_byte_stream( - (uint8_t *) source, - source_length + 1, - libclocale_codepage, - &wide_source_size, - error ); -#elif SIZEOF_WCHAR_T == 2 - result = libuna_utf16_string_size_from_byte_stream( - (uint8_t *) source, - source_length + 1, - libclocale_codepage, - &wide_source_size, - error ); -#endif - } - if( result != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_CONVERSION, - LIBCERROR_CONVERSION_ERROR_GENERIC, - "%s: unable to determine wide string size.", - function ); - - return( -1 ); - } - -#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ - - if( wide_string_size < wide_source_size ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_ARGUMENTS, - LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL, - "%s: wide string too small.", - function ); - - return( -1 ); - } -#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) - if( system_string_copy( - wide_string, - source, - source_length ) == NULL ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_MEMORY, - LIBCERROR_MEMORY_ERROR_COPY_FAILED, - "%s: unable to set wide string.", - function ); - - return( -1 ); - } - wide_string[ source_length ] = 0; -#else - if( libclocale_codepage == 0 ) - { -#if SIZEOF_WCHAR_T == 4 - result = libuna_utf32_string_copy_from_utf8( - (libuna_utf32_character_t *) wide_string, - wide_string_size, - (libuna_utf8_character_t *) source, - source_length + 1, - error ); -#elif SIZEOF_WCHAR_T == 2 - result = libuna_utf16_string_copy_from_utf8( - (libuna_utf16_character_t *) wide_string, - wide_string_size, - (libuna_utf8_character_t *) source, - source_length + 1, - error ); -#endif - } - else - { -#if SIZEOF_WCHAR_T == 4 - result = libuna_utf32_string_copy_from_byte_stream( - (libuna_utf32_character_t *) wide_string, - wide_string_size, - (uint8_t *) source, - source_length + 1, - libclocale_codepage, - error ); -#elif SIZEOF_WCHAR_T == 2 - result = libuna_utf16_string_copy_from_byte_stream( - (libuna_utf16_character_t *) wide_string, - wide_string_size, - (uint8_t *) source, - source_length + 1, - libclocale_codepage, - error ); -#endif - } - if( result != 1 ) - { - libcerror_error_set( - error, - LIBCERROR_ERROR_DOMAIN_CONVERSION, - LIBCERROR_CONVERSION_ERROR_GENERIC, - "%s: unable to set wide string.", - function ); - - return( -1 ); - } - -#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ - - return( 1 ); -} - -#endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ /* Creates and opens a source volume * Returns 1 if successful or -1 on error */ int fvde_test_volume_open_source( libfvde_volume_t **volume, - const system_character_t *source, + libbfio_handle_t *file_io_handle, + const system_character_t *password, libcerror_error_t **error ) { static char *function = "fvde_test_volume_open_source"; + size_t string_length = 0; int result = 0; if( volume == NULL ) @@ -468,13 +89,13 @@ return( -1 ); } - if( source == NULL ) + if( file_io_handle == NULL ) { libcerror_error_set( error, LIBCERROR_ERROR_DOMAIN_ARGUMENTS, LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE, - "%s: invalid source.", + "%s: invalid file IO handle.", function ); return( -1 ); @@ -492,19 +113,42 @@ goto on_error; } + if( password != NULL ) + { + string_length = system_string_length( + password ); + #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) - result = libfvde_volume_open_wide( - *volume, - source, - LIBFVDE_OPEN_READ, - error ); + result = libfvde_volume_set_utf16_password( + *volume, + (uint16_t *) password, + string_length, + error ); #else - result = libfvde_volume_open( + result = libfvde_volume_set_utf8_password( + *volume, + (uint8_t *) password, + string_length, + error ); +#endif + if( result != 1 ) + { + libcerror_error_set( + error, + LIBCERROR_ERROR_DOMAIN_RUNTIME, + LIBCERROR_RUNTIME_ERROR_SET_FAILED, + "%s: unable to set password.", + function ); + + goto on_error; + } + } + result = libfvde_volume_open_file_io_handle( *volume, - source, + file_io_handle, LIBFVDE_OPEN_READ, error ); -#endif + if( result != 1 ) { libcerror_error_set( @@ -815,17 +459,19 @@ * Returns 1 if successful or 0 if not */ int fvde_test_volume_open( - const system_character_t *source ) + const system_character_t *source, + const system_character_t *password ) { char narrow_source[ 256 ]; libcerror_error_t *error = NULL; libfvde_volume_t *volume = NULL; + size_t string_length = 0; int result = 0; /* Initialize test */ - result = fvde_test_volume_get_narrow_source( + result = fvde_test_get_narrow_source( source, narrow_source, 256, @@ -857,26 +503,109 @@ "error", error ); - /* Test open - */ - result = libfvde_volume_open( - volume, - narrow_source, - LIBFVDE_OPEN_READ, - &error ); - - FVDE_TEST_ASSERT_EQUAL_INT( - "result", - result, - 1 ); + if( password != NULL ) + { + string_length = system_string_length( + password ); - FVDE_TEST_ASSERT_IS_NULL( - "error", - error ); +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + result = libfvde_volume_set_utf16_password( + volume, + (uint16_t *) password, + string_length, + &error ); +#else + result = libfvde_volume_set_utf8_password( + volume, + (uint8_t *) password, + string_length, + &error ); +#endif + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + } + /* Test open + */ + result = libfvde_volume_open( + volume, + narrow_source, + LIBFVDE_OPEN_READ, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); /* Test error cases */ result = libfvde_volume_open( + NULL, + narrow_source, + LIBFVDE_OPEN_READ, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + FVDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libfvde_volume_open( + volume, + NULL, + LIBFVDE_OPEN_READ, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + FVDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libfvde_volume_open( + volume, + narrow_source, + -1, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + FVDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + /* Test open when already opened + */ + result = libfvde_volume_open( volume, narrow_source, LIBFVDE_OPEN_READ, @@ -936,20 +665,315 @@ * Returns 1 if successful or 0 if not */ int fvde_test_volume_open_wide( - const system_character_t *source ) + const system_character_t *source, + const system_character_t *password ) { wchar_t wide_source[ 256 ]; - libcerror_error_t *error = NULL; - libfvde_volume_t *volume = NULL; - int result = 0; + libcerror_error_t *error = NULL; + libfvde_volume_t *volume = NULL; + size_t string_length = 0; + int result = 0; + + /* Initialize test + */ + result = fvde_test_get_wide_source( + source, + wide_source, + 256, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + result = libfvde_volume_initialize( + &volume, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + FVDE_TEST_ASSERT_IS_NOT_NULL( + "volume", + volume ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + if( password != NULL ) + { + string_length = system_string_length( + password ); + +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + result = libfvde_volume_set_utf16_password( + volume, + (uint16_t *) password, + string_length, + &error ); +#else + result = libfvde_volume_set_utf8_password( + volume, + (uint8_t *) password, + string_length, + &error ); +#endif + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + } + /* Test open + */ + result = libfvde_volume_open_wide( + volume, + wide_source, + LIBFVDE_OPEN_READ, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test error cases + */ + result = libfvde_volume_open_wide( + NULL, + wide_source, + LIBFVDE_OPEN_READ, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + FVDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libfvde_volume_open_wide( + volume, + NULL, + LIBFVDE_OPEN_READ, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + FVDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + result = libfvde_volume_open_wide( + volume, + wide_source, + -1, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + FVDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + /* Test open when already opened + */ + result = libfvde_volume_open_wide( + volume, + wide_source, + LIBFVDE_OPEN_READ, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + FVDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + /* Clean up + */ + result = libfvde_volume_free( + &volume, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + FVDE_TEST_ASSERT_IS_NULL( + "volume", + volume ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + if( volume != NULL ) + { + libfvde_volume_free( + &volume, + NULL ); + } + return( 0 ); +} + +#endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ + +/* Tests the libfvde_volume_open_file_io_handle function + * Returns 1 if successful or 0 if not + */ +int fvde_test_volume_open_file_io_handle( + const system_character_t *source, + const system_character_t *password ) +{ + libbfio_handle_t *file_io_handle = NULL; + libcerror_error_t *error = NULL; + libfvde_volume_t *volume = NULL; + size_t string_length = 0; + int result = 0; + + /* Initialize test + */ + result = libbfio_file_initialize( + &file_io_handle, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + FVDE_TEST_ASSERT_IS_NOT_NULL( + "file_io_handle", + file_io_handle ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + string_length = system_string_length( + source ); + +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + result = libbfio_file_set_name_wide( + file_io_handle, + source, + string_length, + &error ); +#else + result = libbfio_file_set_name( + file_io_handle, + source, + string_length, + &error ); +#endif + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + result = libfvde_volume_initialize( + &volume, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + FVDE_TEST_ASSERT_IS_NOT_NULL( + "volume", + volume ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + if( password != NULL ) + { + string_length = system_string_length( + password ); + +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + result = libfvde_volume_set_utf16_password( + volume, + (uint16_t *) password, + string_length, + &error ); +#else + result = libfvde_volume_set_utf8_password( + volume, + (uint8_t *) password, + string_length, + &error ); +#endif + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); - /* Initialize test + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + } + /* Test open */ - result = fvde_test_volume_get_wide_source( - source, - wide_source, - 256, + result = libfvde_volume_open_file_io_handle( + volume, + file_io_handle, + LIBFVDE_OPEN_READ, &error ); FVDE_TEST_ASSERT_EQUAL_INT( @@ -961,45 +985,67 @@ "error", error ); - result = libfvde_volume_initialize( - &volume, + /* Test error cases + */ + result = libfvde_volume_open_file_io_handle( + NULL, + file_io_handle, + LIBFVDE_OPEN_READ, &error ); FVDE_TEST_ASSERT_EQUAL_INT( "result", result, - 1 ); + -1 ); FVDE_TEST_ASSERT_IS_NOT_NULL( - "volume", - volume ); - - FVDE_TEST_ASSERT_IS_NULL( "error", error ); - /* Test open - */ - result = libfvde_volume_open_wide( + libcerror_error_free( + &error ); + + result = libfvde_volume_open_file_io_handle( volume, - wide_source, + NULL, LIBFVDE_OPEN_READ, &error ); FVDE_TEST_ASSERT_EQUAL_INT( "result", result, - 1 ); + -1 ); - FVDE_TEST_ASSERT_IS_NULL( + FVDE_TEST_ASSERT_IS_NOT_NULL( "error", error ); - /* Test error cases + libcerror_error_free( + &error ); + + result = libfvde_volume_open_file_io_handle( + volume, + file_io_handle, + -1, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + FVDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + /* Test open when already opened */ - result = libfvde_volume_open_wide( + result = libfvde_volume_open_file_io_handle( volume, - wide_source, + file_io_handle, LIBFVDE_OPEN_READ, &error ); @@ -1034,6 +1080,23 @@ "error", error ); + result = libbfio_handle_free( + &file_io_handle, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + FVDE_TEST_ASSERT_IS_NULL( + "file_io_handle", + file_io_handle ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + return( 1 ); on_error: @@ -1048,11 +1111,15 @@ &volume, NULL ); } + if( file_io_handle != NULL ) + { + libbfio_handle_free( + &file_io_handle, + NULL ); + } return( 0 ); } -#endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ - /* Tests the libfvde_volume_close function * Returns 1 if successful or 0 if not */ @@ -1095,10 +1162,12 @@ * Returns 1 if successful or 0 if not */ int fvde_test_volume_open_close( - const system_character_t *source ) + const system_character_t *source, + const system_character_t *password ) { libcerror_error_t *error = NULL; libfvde_volume_t *volume = NULL; + size_t string_length = 0; int result = 0; /* Initialize test @@ -1120,6 +1189,33 @@ "error", error ); + if( password != NULL ) + { + string_length = system_string_length( + password ); + +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + result = libfvde_volume_set_utf16_password( + volume, + (uint16_t *) password, + string_length, + &error ); +#else + result = libfvde_volume_set_utf8_password( + volume, + (uint8_t *) password, + string_length, + &error ); +#endif + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + } /* Test open and close */ #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) @@ -1241,31 +1337,232 @@ libcerror_error_t *error = NULL; int result = 0; - /* Test regular cases + /* Test regular cases + */ + result = libfvde_volume_signal_abort( + volume, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test error cases + */ + result = libfvde_volume_signal_abort( + NULL, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + -1 ); + + FVDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + return( 1 ); + +on_error: + if( error != NULL ) + { + libcerror_error_free( + &error ); + } + return( 0 ); +} + +/* Tests the libfvde_volume_read_buffer function + * Returns 1 if successful or 0 if not + */ +int fvde_test_volume_read_buffer( + libfvde_volume_t *volume ) +{ + uint8_t buffer[ 16 ]; + + libcerror_error_t *error = NULL; + size64_t size = 0; + ssize_t read_count = 0; + off64_t offset = 0; + int result = 0; + + /* Determine size + */ + result = libfvde_volume_get_logical_volume_size( + volume, + &size, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Reset offset to 0 + */ + offset = libfvde_volume_seek_offset( + volume, + 0, + SEEK_SET, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT64( + "offset", + offset, + (int64_t) 0 ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Test regular cases + */ + if( size > 16 ) + { + read_count = libfvde_volume_read_buffer( + volume, + buffer, + 16, + &error ); + + FVDE_TEST_ASSERT_EQUAL_SSIZE( + "read_count", + read_count, + (ssize_t) 16 ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Set offset to size - 8 + */ + offset = libfvde_volume_seek_offset( + volume, + -8, + SEEK_END, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT64( + "offset", + offset, + (int64_t) size - 8 ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Read buffer on size boundary + */ + read_count = libfvde_volume_read_buffer( + volume, + buffer, + 16, + &error ); + + FVDE_TEST_ASSERT_EQUAL_SSIZE( + "read_count", + read_count, + (ssize_t) 8 ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Read buffer beyond size boundary + */ + read_count = libfvde_volume_read_buffer( + volume, + buffer, + 16, + &error ); + + FVDE_TEST_ASSERT_EQUAL_SSIZE( + "read_count", + read_count, + (ssize_t) 0 ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Reset offset to 0 + */ + offset = libfvde_volume_seek_offset( + volume, + 0, + SEEK_SET, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT64( + "offset", + offset, + (int64_t) 0 ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + } + /* Test error cases */ - result = libfvde_volume_signal_abort( - volume, - &error ); + read_count = libfvde_volume_read_buffer( + NULL, + buffer, + 16, + &error ); - FVDE_TEST_ASSERT_EQUAL_INT( - "result", - result, - 1 ); + FVDE_TEST_ASSERT_EQUAL_SSIZE( + "read_count", + read_count, + (ssize_t) -1 ); - FVDE_TEST_ASSERT_IS_NULL( + FVDE_TEST_ASSERT_IS_NOT_NULL( "error", error ); - /* Test error cases - */ - result = libfvde_volume_signal_abort( - NULL, - &error ); + libcerror_error_free( + &error ); - FVDE_TEST_ASSERT_EQUAL_INT( - "result", - result, - -1 ); + read_count = libfvde_volume_read_buffer( + volume, + NULL, + 16, + &error ); + + FVDE_TEST_ASSERT_EQUAL_SSIZE( + "read_count", + read_count, + (ssize_t) -1 ); + + FVDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + read_count = libfvde_volume_read_buffer( + volume, + buffer, + (size_t) SSIZE_MAX + 1, + &error ); + + FVDE_TEST_ASSERT_EQUAL_SSIZE( + "read_count", + read_count, + (ssize_t) -1 ); FVDE_TEST_ASSERT_IS_NOT_NULL( "error", @@ -1285,10 +1582,10 @@ return( 0 ); } -/* Tests the libfvde_volume_read_buffer function +/* Tests the libfvde_volume_read_buffer_at_offset function * Returns 1 if successful or 0 if not */ -int fvde_test_volume_read_buffer( +int fvde_test_volume_read_buffer_at_offset( libfvde_volume_t *volume ) { uint8_t buffer[ 16 ]; @@ -1296,39 +1593,19 @@ libcerror_error_t *error = NULL; size64_t size = 0; ssize_t read_count = 0; - off64_t offset = 0; + int result = 0; /* Determine size */ - offset = libfvde_volume_seek_offset( - volume, - 0, - SEEK_END, - &error ); - - FVDE_TEST_ASSERT_NOT_EQUAL_INT64( - "offset", - offset, - (int64_t) -1 ); - - FVDE_TEST_ASSERT_IS_NULL( - "error", - error ); - - size = (size64_t) offset; - - /* Reset offset to 0 - */ - offset = libfvde_volume_seek_offset( + result = libfvde_volume_get_logical_volume_size( volume, - 0, - SEEK_SET, + &size, &error ); - FVDE_TEST_ASSERT_EQUAL_INT64( - "offset", - offset, - (int64_t) 0 ); + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); FVDE_TEST_ASSERT_IS_NULL( "error", @@ -1338,10 +1615,11 @@ */ if( size > 16 ) { - read_count = libfvde_volume_read_buffer( + read_count = libfvde_volume_read_buffer_at_offset( volume, buffer, 16, + 0, &error ); FVDE_TEST_ASSERT_EQUAL_SSIZE( @@ -1352,33 +1630,50 @@ FVDE_TEST_ASSERT_IS_NULL( "error", error ); - } -/* TODO read on size boundary */ -/* TODO read beyond size boundary */ - /* Reset offset to 0 - */ - offset = libfvde_volume_seek_offset( - volume, - 0, - SEEK_SET, - &error ); + /* Read buffer on size boundary + */ + read_count = libfvde_volume_read_buffer_at_offset( + volume, + buffer, + 16, + size - 8, + &error ); - FVDE_TEST_ASSERT_EQUAL_INT64( - "offset", - offset, - (int64_t) 0 ); + FVDE_TEST_ASSERT_EQUAL_SSIZE( + "read_count", + read_count, + (ssize_t) 8 ); - FVDE_TEST_ASSERT_IS_NULL( - "error", - error ); + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + /* Read buffer beyond size boundary + */ + read_count = libfvde_volume_read_buffer_at_offset( + volume, + buffer, + 16, + size + 8, + &error ); + + FVDE_TEST_ASSERT_EQUAL_SSIZE( + "read_count", + read_count, + (ssize_t) 0 ); + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + } /* Test error cases */ - read_count = libfvde_volume_read_buffer( + read_count = libfvde_volume_read_buffer_at_offset( NULL, buffer, 16, + 0, &error ); FVDE_TEST_ASSERT_EQUAL_SSIZE( @@ -1393,10 +1688,11 @@ libcerror_error_free( &error ); - read_count = libfvde_volume_read_buffer( + read_count = libfvde_volume_read_buffer_at_offset( volume, NULL, 16, + 0, &error ); FVDE_TEST_ASSERT_EQUAL_SSIZE( @@ -1411,10 +1707,30 @@ libcerror_error_free( &error ); - read_count = libfvde_volume_read_buffer( + read_count = libfvde_volume_read_buffer_at_offset( volume, buffer, (size_t) SSIZE_MAX + 1, + 0, + &error ); + + FVDE_TEST_ASSERT_EQUAL_SSIZE( + "read_count", + read_count, + (ssize_t) -1 ); + + FVDE_TEST_ASSERT_IS_NOT_NULL( + "error", + error ); + + libcerror_error_free( + &error ); + + read_count = libfvde_volume_read_buffer_at_offset( + volume, + buffer, + 16, + -1, &error ); FVDE_TEST_ASSERT_EQUAL_SSIZE( @@ -2015,16 +2331,21 @@ char * const argv[] ) #endif { - libcerror_error_t *error = NULL; - libfvde_volume_t *volume = NULL; - system_character_t *source = NULL; - system_integer_t option = 0; - int result = 0; + libbfio_handle_t *file_io_handle = NULL; + libcerror_error_t *error = NULL; + libfvde_volume_t *volume = NULL; + system_character_t *option_offset = NULL; + system_character_t *option_password = NULL; + system_character_t *source = NULL; + system_integer_t option = 0; + size_t string_length = 0; + off64_t volume_offset = 0; + int result = 0; while( ( option = fvde_test_getopt( argc, argv, - _SYSTEM_STRING( "" ) ) ) != (system_integer_t) -1 ) + _SYSTEM_STRING( "o:p:" ) ) ) != (system_integer_t) -1 ) { switch( option ) { @@ -2036,12 +2357,42 @@ argv[ optind - 1 ] ); return( EXIT_FAILURE ); + + case (system_integer_t) 'o': + option_offset = optarg; + + break; + + case (system_integer_t) 'p': + option_password = optarg; + + break; } } if( optind < argc ) { source = argv[ optind ]; } + if( option_offset != NULL ) + { + string_length = system_string_length( + option_offset ); + + result = fvde_test_system_string_copy_from_64_bit_in_decimal( + option_offset, + string_length + 1, + (uint64_t *) &volume_offset, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + } #if defined( HAVE_DEBUG_OUTPUT ) && defined( FVDE_TEST_VOLUME_VERBOSE ) libfvde_notify_set_verbose( 1 ); @@ -2061,46 +2412,100 @@ #if !defined( __BORLANDC__ ) || ( __BORLANDC__ >= 0x0560 ) if( source != NULL ) { + result = libbfio_file_range_initialize( + &file_io_handle, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + FVDE_TEST_ASSERT_IS_NOT_NULL( + "file_io_handle", + file_io_handle ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + string_length = system_string_length( + source ); + #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) - result = libfvde_check_volume_signature_wide( + result = libbfio_file_range_set_name_wide( + file_io_handle, source, + string_length, &error ); #else - result = libfvde_check_volume_signature( + result = libbfio_file_range_set_name( + file_io_handle, source, + string_length, &error ); #endif + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); - FVDE_TEST_ASSERT_NOT_EQUAL_INT( + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + + result = libbfio_file_range_set( + file_io_handle, + volume_offset, + 0, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( "result", result, - -1 ); + 1 ); FVDE_TEST_ASSERT_IS_NULL( "error", error ); + + result = libfvde_check_volume_signature_file_io_handle( + file_io_handle, + &error ); + + FVDE_TEST_ASSERT_NOT_EQUAL_INT( + "result", + result, + -1 ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); } - if( result != 0 ) + if( ( result != 0 ) + && ( volume_offset == 0 ) ) { FVDE_TEST_RUN_WITH_ARGS( "libfvde_volume_open", fvde_test_volume_open, - source ); + source, + option_password ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) FVDE_TEST_RUN_WITH_ARGS( "libfvde_volume_open_wide", fvde_test_volume_open_wide, - source ); + source, + option_password ); #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ -#if defined( LIBFVDE_HAVE_BFIO ) - - /* TODO add test for libfvde_volume_open_file_io_handle */ - -#endif /* defined( LIBFVDE_HAVE_BFIO ) */ + FVDE_TEST_RUN_WITH_ARGS( + "libfvde_volume_open_file_io_handle", + fvde_test_volume_open_file_io_handle, + source, + option_password ); FVDE_TEST_RUN( "libfvde_volume_close", @@ -2109,13 +2514,17 @@ FVDE_TEST_RUN_WITH_ARGS( "libfvde_volume_open_close", fvde_test_volume_open_close, - source ); - - /* Initialize test + source, + option_password ); + } + if( result != 0 ) + { + /* Initialize volume for tests */ result = fvde_test_volume_open_source( &volume, - source, + file_io_handle, + option_password, &error ); FVDE_TEST_ASSERT_EQUAL_INT( @@ -2123,13 +2532,13 @@ result, 1 ); - FVDE_TEST_ASSERT_IS_NOT_NULL( - "volume", - volume ); + FVDE_TEST_ASSERT_IS_NOT_NULL( + "volume", + volume ); - FVDE_TEST_ASSERT_IS_NULL( - "error", - error ); + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); FVDE_TEST_RUN_WITH_ARGS( "libfvde_volume_signal_abort", @@ -2151,7 +2560,10 @@ fvde_test_volume_read_buffer, volume ); - /* TODO: add tests for libfvde_volume_read_buffer_at_offset */ + FVDE_TEST_RUN_WITH_ARGS( + "libfvde_volume_read_buffer_at_offset", + fvde_test_volume_read_buffer_at_offset, + volume ); /* TODO: add tests for libfvde_volume_write_buffer */ @@ -2221,8 +2633,27 @@ 0 ); FVDE_TEST_ASSERT_IS_NULL( - "volume", - volume ); + "volume", + volume ); + + FVDE_TEST_ASSERT_IS_NULL( + "error", + error ); + } + if( file_io_handle != NULL ) + { + result = libbfio_handle_free( + &file_io_handle, + &error ); + + FVDE_TEST_ASSERT_EQUAL_INT( + "result", + result, + 1 ); + + FVDE_TEST_ASSERT_IS_NULL( + "file_io_handle", + file_io_handle ); FVDE_TEST_ASSERT_IS_NULL( "error", @@ -2240,10 +2671,16 @@ } if( volume != NULL ) { - fvde_test_volume_close_source( + libfvde_volume_free( &volume, NULL ); } + if( file_io_handle != NULL ) + { + libbfio_handle_free( + &file_io_handle, + NULL ); + } return( EXIT_FAILURE ); } diff -Nru libfvde-20170930/tests/fvde_test_volume_group.c libfvde-20180108/tests/fvde_test_volume_group.c --- libfvde-20170930/tests/fvde_test_volume_group.c 2017-09-30 13:38:21.000000000 +0000 +++ libfvde-20180108/tests/fvde_test_volume_group.c 2018-01-08 17:42:47.000000000 +0000 @@ -1,7 +1,7 @@ /* * Library volume_group type test program * - * Copyright (C) 2011-2017, Joachim Metz + * Copyright (C) 2011-2018, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff -Nru libfvde-20170930/tests/Makefile.am libfvde-20180108/tests/Makefile.am --- libfvde-20170930/tests/Makefile.am 2017-09-30 13:38:20.000000000 +0000 +++ libfvde-20180108/tests/Makefile.am 2018-01-08 17:03:06.000000000 +0000 @@ -34,6 +34,7 @@ check_SCRIPTS = \ pyfvde_test_support.py \ + pyfvde_test_volume.py \ test_fvdeinfo.sh \ test_library.sh \ test_python_module.sh \ @@ -53,6 +54,7 @@ fvde_test_metadata_block \ fvde_test_notify \ fvde_test_sector_data \ + fvde_test_segment_descriptor \ fvde_test_support \ fvde_test_volume \ fvde_test_volume_group @@ -171,7 +173,20 @@ ../libfvde/libfvde.la \ @LIBCERROR_LIBADD@ +fvde_test_segment_descriptor_SOURCES = \ + fvde_test_libcerror.h \ + fvde_test_libfvde.h \ + fvde_test_macros.h \ + fvde_test_memory.c fvde_test_memory.h \ + fvde_test_segment_descriptor.c \ + fvde_test_unused.h + +fvde_test_segment_descriptor_LDADD = \ + ../libfvde/libfvde.la \ + @LIBCERROR_LIBADD@ + fvde_test_support_SOURCES = \ + fvde_test_functions.c fvde_test_functions.h \ fvde_test_getopt.c fvde_test_getopt.h \ fvde_test_libbfio.h \ fvde_test_libcerror.h \ @@ -180,7 +195,8 @@ fvde_test_libfvde.h \ fvde_test_libuna.h \ fvde_test_macros.h \ - fvde_test_support.c + fvde_test_support.c \ + fvde_test_unused.h fvde_test_support_LDADD = \ @LIBBFIO_LIBADD@ \ @@ -195,7 +211,9 @@ @LIBCERROR_LIBADD@ fvde_test_volume_SOURCES = \ + fvde_test_functions.c fvde_test_functions.h \ fvde_test_getopt.c fvde_test_getopt.h \ + fvde_test_libbfio.h \ fvde_test_libcerror.h \ fvde_test_libclocale.h \ fvde_test_libcnotify.h \ @@ -203,10 +221,15 @@ fvde_test_libuna.h \ fvde_test_macros.h \ fvde_test_memory.c fvde_test_memory.h \ + fvde_test_unused.h \ fvde_test_volume.c fvde_test_volume_LDADD = \ + @LIBBFIO_LIBADD@ \ + @LIBCPATH_LIBADD@ \ + @LIBCFILE_LIBADD@ \ @LIBUNA_LIBADD@ \ + @LIBCSPLIT_LIBADD@ \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCDATA_LIBADD@ \ diff -Nru libfvde-20170930/tests/Makefile.in libfvde-20180108/tests/Makefile.in --- libfvde-20170930/tests/Makefile.in 2017-10-04 19:28:16.000000000 +0000 +++ libfvde-20180108/tests/Makefile.in 2018-01-08 20:19:38.000000000 +0000 @@ -93,8 +93,10 @@ fvde_test_error$(EXEEXT) fvde_test_io_handle$(EXEEXT) \ fvde_test_keyring$(EXEEXT) fvde_test_metadata$(EXEEXT) \ fvde_test_metadata_block$(EXEEXT) fvde_test_notify$(EXEEXT) \ - fvde_test_sector_data$(EXEEXT) fvde_test_support$(EXEEXT) \ - fvde_test_volume$(EXEEXT) fvde_test_volume_group$(EXEEXT) + fvde_test_sector_data$(EXEEXT) \ + fvde_test_segment_descriptor$(EXEEXT) \ + fvde_test_support$(EXEEXT) fvde_test_volume$(EXEEXT) \ + fvde_test_volume_group$(EXEEXT) subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/common.m4 \ @@ -176,12 +178,18 @@ fvde_test_sector_data.$(OBJEXT) fvde_test_sector_data_OBJECTS = $(am_fvde_test_sector_data_OBJECTS) fvde_test_sector_data_DEPENDENCIES = ../libfvde/libfvde.la -am_fvde_test_support_OBJECTS = fvde_test_getopt.$(OBJEXT) \ - fvde_test_support.$(OBJEXT) +am_fvde_test_segment_descriptor_OBJECTS = fvde_test_memory.$(OBJEXT) \ + fvde_test_segment_descriptor.$(OBJEXT) +fvde_test_segment_descriptor_OBJECTS = \ + $(am_fvde_test_segment_descriptor_OBJECTS) +fvde_test_segment_descriptor_DEPENDENCIES = ../libfvde/libfvde.la +am_fvde_test_support_OBJECTS = fvde_test_functions.$(OBJEXT) \ + fvde_test_getopt.$(OBJEXT) fvde_test_support.$(OBJEXT) fvde_test_support_OBJECTS = $(am_fvde_test_support_OBJECTS) fvde_test_support_DEPENDENCIES = ../libfvde/libfvde.la -am_fvde_test_volume_OBJECTS = fvde_test_getopt.$(OBJEXT) \ - fvde_test_memory.$(OBJEXT) fvde_test_volume.$(OBJEXT) +am_fvde_test_volume_OBJECTS = fvde_test_functions.$(OBJEXT) \ + fvde_test_getopt.$(OBJEXT) fvde_test_memory.$(OBJEXT) \ + fvde_test_volume.$(OBJEXT) fvde_test_volume_OBJECTS = $(am_fvde_test_volume_OBJECTS) fvde_test_volume_DEPENDENCIES = ../libfvde/libfvde.la am_fvde_test_volume_group_OBJECTS = fvde_test_memory.$(OBJEXT) \ @@ -229,6 +237,7 @@ $(fvde_test_keyring_SOURCES) $(fvde_test_metadata_SOURCES) \ $(fvde_test_metadata_block_SOURCES) \ $(fvde_test_notify_SOURCES) $(fvde_test_sector_data_SOURCES) \ + $(fvde_test_segment_descriptor_SOURCES) \ $(fvde_test_support_SOURCES) $(fvde_test_volume_SOURCES) \ $(fvde_test_volume_group_SOURCES) DIST_SOURCES = $(fvde_test_data_area_descriptor_SOURCES) \ @@ -238,6 +247,7 @@ $(fvde_test_keyring_SOURCES) $(fvde_test_metadata_SOURCES) \ $(fvde_test_metadata_block_SOURCES) \ $(fvde_test_notify_SOURCES) $(fvde_test_sector_data_SOURCES) \ + $(fvde_test_segment_descriptor_SOURCES) \ $(fvde_test_support_SOURCES) $(fvde_test_volume_SOURCES) \ $(fvde_test_volume_group_SOURCES) am__can_run_installinfo = \ @@ -763,6 +773,7 @@ ax_zlib_spec_build_requires = @ax_zlib_spec_build_requires@ ax_zlib_spec_requires = @ax_zlib_spec_requires@ ax_zlib_static_spec_build_requires = @ax_zlib_static_spec_build_requires@ +ax_zlib_static_spec_requires = @ax_zlib_static_spec_requires@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -886,6 +897,7 @@ check_SCRIPTS = \ pyfvde_test_support.py \ + pyfvde_test_volume.py \ test_fvdeinfo.sh \ test_library.sh \ test_python_module.sh \ @@ -1008,7 +1020,20 @@ ../libfvde/libfvde.la \ @LIBCERROR_LIBADD@ +fvde_test_segment_descriptor_SOURCES = \ + fvde_test_libcerror.h \ + fvde_test_libfvde.h \ + fvde_test_macros.h \ + fvde_test_memory.c fvde_test_memory.h \ + fvde_test_segment_descriptor.c \ + fvde_test_unused.h + +fvde_test_segment_descriptor_LDADD = \ + ../libfvde/libfvde.la \ + @LIBCERROR_LIBADD@ + fvde_test_support_SOURCES = \ + fvde_test_functions.c fvde_test_functions.h \ fvde_test_getopt.c fvde_test_getopt.h \ fvde_test_libbfio.h \ fvde_test_libcerror.h \ @@ -1017,7 +1042,8 @@ fvde_test_libfvde.h \ fvde_test_libuna.h \ fvde_test_macros.h \ - fvde_test_support.c + fvde_test_support.c \ + fvde_test_unused.h fvde_test_support_LDADD = \ @LIBBFIO_LIBADD@ \ @@ -1032,7 +1058,9 @@ @LIBCERROR_LIBADD@ fvde_test_volume_SOURCES = \ + fvde_test_functions.c fvde_test_functions.h \ fvde_test_getopt.c fvde_test_getopt.h \ + fvde_test_libbfio.h \ fvde_test_libcerror.h \ fvde_test_libclocale.h \ fvde_test_libcnotify.h \ @@ -1040,10 +1068,15 @@ fvde_test_libuna.h \ fvde_test_macros.h \ fvde_test_memory.c fvde_test_memory.h \ + fvde_test_unused.h \ fvde_test_volume.c fvde_test_volume_LDADD = \ + @LIBBFIO_LIBADD@ \ + @LIBCPATH_LIBADD@ \ + @LIBCFILE_LIBADD@ \ @LIBUNA_LIBADD@ \ + @LIBCSPLIT_LIBADD@ \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCDATA_LIBADD@ \ @@ -1150,6 +1183,10 @@ @rm -f fvde_test_sector_data$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fvde_test_sector_data_OBJECTS) $(fvde_test_sector_data_LDADD) $(LIBS) +fvde_test_segment_descriptor$(EXEEXT): $(fvde_test_segment_descriptor_OBJECTS) $(fvde_test_segment_descriptor_DEPENDENCIES) $(EXTRA_fvde_test_segment_descriptor_DEPENDENCIES) + @rm -f fvde_test_segment_descriptor$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fvde_test_segment_descriptor_OBJECTS) $(fvde_test_segment_descriptor_LDADD) $(LIBS) + fvde_test_support$(EXEEXT): $(fvde_test_support_OBJECTS) $(fvde_test_support_DEPENDENCIES) $(EXTRA_fvde_test_support_DEPENDENCIES) @rm -f fvde_test_support$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fvde_test_support_OBJECTS) $(fvde_test_support_LDADD) $(LIBS) @@ -1172,6 +1209,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fvde_test_encrypted_metadata.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fvde_test_encryption_context_plist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fvde_test_error.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fvde_test_functions.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fvde_test_getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fvde_test_io_handle.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fvde_test_keyring.Po@am__quote@ @@ -1180,6 +1218,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fvde_test_metadata_block.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fvde_test_notify.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fvde_test_sector_data.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fvde_test_segment_descriptor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fvde_test_support.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fvde_test_volume.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fvde_test_volume_group.Po@am__quote@ diff -Nru libfvde-20170930/tests/pyfvde_test_support.py libfvde-20180108/tests/pyfvde_test_support.py --- libfvde-20170930/tests/pyfvde_test_support.py 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/pyfvde_test_support.py 2018-01-08 17:42:47.000000000 +0000 @@ -2,7 +2,7 @@ # # Python-bindings support functions test script # -# Copyright (C) 2011-2017, Joachim Metz +# Copyright (C) 2011-2018, Joachim Metz # # Refer to AUTHORS for acknowledgements. # diff -Nru libfvde-20170930/tests/pyfvde_test_volume.py libfvde-20180108/tests/pyfvde_test_volume.py --- libfvde-20170930/tests/pyfvde_test_volume.py 1970-01-01 00:00:00.000000000 +0000 +++ libfvde-20180108/tests/pyfvde_test_volume.py 2018-01-08 19:23:07.000000000 +0000 @@ -0,0 +1,454 @@ +#!/usr/bin/env python +# +# Python-bindings volume type test script +# +# Copyright (C) 2011-2018, Joachim Metz +# +# Refer to AUTHORS for acknowledgements. +# +# This software is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This software is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this software. If not, see . + +import argparse +import os +import sys +import unittest + +import pyfvde + + +class DataRangeFileObject(object): + """File-like object that maps an in-file data range.""" + + def __init__(self, file_object, range_offset, range_size): + """Initializes a file-like object. + + Args: + file_object (file): parent file-like object. + range_offset (int): offset where the data range starts. + range_size (int): size of the data range starts, or None to indicate + the range should continue to the end of the parent file-like object. + """ + super(DataRangeFileObject, self).__init__() + self._current_offset = 0 + self._file_object = file_object + self._range_offset = range_offset + self._range_size = range_size + + def close(self): + """Closes the file-like object.""" + if self._file_object: + self._file_object.close() + self._file_object = None + + def get_offset(self): + """Retrieves the current offset into the file-like object. + + Returns: + int: current offset in the data range. + """ + return self._current_offset + + def get_size(self): + """Retrieves the size of the file-like object. + + Returns: + int: size of the data range. + """ + return self._range_size + + def read(self, size=None): + """Reads a byte string from the file-like object at the current offset. + + The function will read a byte string of the specified size or + all of the remaining data if no size was specified. + + Args: + size (Optional[int]): number of bytes to read, where None is all + remaining data. + + Returns: + bytes: data read. + + Raises: + IOError: if the read failed. + """ + if (self._range_offset < 0 or + (self._range_size is not None and self._range_size < 0)): + raise IOError('Invalid data range.') + + if self._current_offset < 0: + raise IOError( + 'Invalid current offset: {0:d} value less than zero.'.format( + self._current_offset)) + + if (self._range_size is not None and + self._current_offset >= self._range_size): + return b'' + + if size is None: + size = self._range_size + if self._range_size is not None and self._current_offset + size > self._range_size: + size = self._range_size - self._current_offset + + self._file_object.seek( + self._range_offset + self._current_offset, os.SEEK_SET) + + data = self._file_object.read(size) + + self._current_offset += len(data) + + return data + + def seek(self, offset, whence=os.SEEK_SET): + """Seeks to an offset within the file-like object. + + Args: + offset (int): offset to seek to. + whence (Optional(int)): value that indicates whether offset is an absolute + or relative position within the file. + + Raises: + IOError: if the seek failed. + """ + if self._current_offset < 0: + raise IOError( + 'Invalid current offset: {0:d} value less than zero.'.format( + self._current_offset)) + + if whence == os.SEEK_CUR: + offset += self._current_offset + elif whence == os.SEEK_END: + offset += self._range_size + elif whence != os.SEEK_SET: + raise IOError('Unsupported whence.') + if offset < 0: + raise IOError('Invalid offset value less than zero.') + + self._current_offset = offset + + +class VolumeTypeTests(unittest.TestCase): + """Tests the volume type.""" + + def test_signal_abort(self): + """Tests the signal_abort function.""" + fvde_volume = pyfvde.volume() + + fvde_volume.signal_abort() + + def test_open(self): + """Tests the open function.""" + if not unittest.source or unittest.offset: + return + + fvde_volume = pyfvde.volume() + + if unittest.password: + fvde_volume.set_password(unittest.password) + if unittest.recovery_password: + fvde_volume.set_recovery_password(unittest.recovery_password) + + fvde_volume.open(unittest.source) + + with self.assertRaises(IOError): + fvde_volume.open(unittest.source) + + fvde_volume.close() + + with self.assertRaises(TypeError): + fvde_volume.open(None) + + with self.assertRaises(ValueError): + fvde_volume.open(unittest.source, mode="w") + + def test_open_file_object(self): + """Tests the open_file_object function.""" + if not unittest.source: + return + + file_object = open(unittest.source, "rb") + if unittest.offset: + file_object = DataRangeFileObject(file_object, unittest.offset, None) + + fvde_volume = pyfvde.volume() + + if unittest.password: + fvde_volume.set_password(unittest.password) + if unittest.recovery_password: + fvde_volume.set_recovery_password(unittest.recovery_password) + + fvde_volume.open_file_object(file_object) + + with self.assertRaises(IOError): + fvde_volume.open_file_object(file_object) + + fvde_volume.close() + + # TODO: change IOError into TypeError + with self.assertRaises(IOError): + fvde_volume.open_file_object(None) + + with self.assertRaises(ValueError): + fvde_volume.open_file_object(file_object, mode="w") + + def test_close(self): + """Tests the close function.""" + fvde_volume = pyfvde.volume() + + with self.assertRaises(IOError): + fvde_volume.close() + + def test_open_close(self): + """Tests the open and close functions.""" + if not unittest.source or unittest.offset: + return + + fvde_volume = pyfvde.volume() + + if unittest.password: + fvde_volume.set_password(unittest.password) + if unittest.recovery_password: + fvde_volume.set_recovery_password(unittest.recovery_password) + + # Test open and close. + fvde_volume.open(unittest.source) + fvde_volume.close() + + # Test open and close a second time to validate clean up on close. + fvde_volume.open(unittest.source) + fvde_volume.close() + + file_object = open(unittest.source, "rb") + + # Test open_file_object and close. + fvde_volume.open_file_object(file_object) + fvde_volume.close() + + # Test open_file_object and close a second time to validate clean up on close. + fvde_volume.open_file_object(file_object) + fvde_volume.close() + + # Test open_file_object and close and dereferencing file_object. + fvde_volume.open_file_object(file_object) + del file_object + fvde_volume.close() + + def test_read_buffer(self): + """Tests the read_buffer function.""" + if not unittest.source or unittest.offset: + return + + fvde_volume = pyfvde.volume() + + if unittest.password: + fvde_volume.set_password(unittest.password) + if unittest.recovery_password: + fvde_volume.set_recovery_password(unittest.recovery_password) + + fvde_volume.open(unittest.source) + + file_size = fvde_volume.get_size() + + # Test normal read. + data = fvde_volume.read_buffer(size=4096) + + self.assertIsNotNone(data) + self.assertEqual(len(data), min(file_size, 4096)) + + if file_size < 4096: + data = fvde_volume.read_buffer() + + self.assertIsNotNone(data) + self.assertEqual(len(data), file_size) + + # Test read beyond file size. + if file_size > 16: + fvde_volume.seek_offset(-16, os.SEEK_END) + + data = fvde_volume.read_buffer(size=4096) + + self.assertIsNotNone(data) + self.assertEqual(len(data), 16) + + with self.assertRaises(ValueError): + fvde_volume.read_buffer(size=-1) + + fvde_volume.close() + + # Test the read without open. + with self.assertRaises(IOError): + fvde_volume.read_buffer(size=4096) + + def test_read_buffer_file_object(self): + """Tests the read_buffer function on a file-like object.""" + if not unittest.source: + return + + file_object = open(unittest.source, "rb") + if unittest.offset: + file_object = DataRangeFileObject(file_object, unittest.offset, None) + + fvde_volume = pyfvde.volume() + + if unittest.password: + fvde_volume.set_password(unittest.password) + if unittest.recovery_password: + fvde_volume.set_recovery_password(unittest.recovery_password) + + fvde_volume.open_file_object(file_object) + + file_size = fvde_volume.get_size() + + # Test normal read. + data = fvde_volume.read_buffer(size=4096) + + self.assertIsNotNone(data) + self.assertEqual(len(data), min(file_size, 4096)) + + fvde_volume.close() + + def test_read_buffer_at_offset(self): + """Tests the read_buffer_at_offset function.""" + if not unittest.source or unittest.offset: + return + + fvde_volume = pyfvde.volume() + + if unittest.password: + fvde_volume.set_password(unittest.password) + if unittest.recovery_password: + fvde_volume.set_recovery_password(unittest.recovery_password) + + fvde_volume.open(unittest.source) + + file_size = fvde_volume.get_size() + + # Test normal read. + data = fvde_volume.read_buffer_at_offset(4096, 0) + + self.assertIsNotNone(data) + self.assertEqual(len(data), min(file_size, 4096)) + + # Test read beyond file size. + if file_size > 16: + data = fvde_volume.read_buffer_at_offset(4096, file_size - 16) + + self.assertIsNotNone(data) + self.assertEqual(len(data), 16) + + with self.assertRaises(ValueError): + fvde_volume.read_buffer_at_offset(-1, 0) + + with self.assertRaises(ValueError): + fvde_volume.read_buffer_at_offset(4096, -1) + + fvde_volume.close() + + # Test the read without open. + with self.assertRaises(IOError): + fvde_volume.read_buffer_at_offset(4096, 0) + + def test_seek_offset(self): + """Tests the seek_offset function.""" + if not unittest.source or unittest.offset: + return + + fvde_volume = pyfvde.volume() + + if unittest.password: + fvde_volume.set_password(unittest.password) + if unittest.recovery_password: + fvde_volume.set_recovery_password(unittest.recovery_password) + + fvde_volume.open(unittest.source) + + file_size = fvde_volume.get_size() + + fvde_volume.seek_offset(16, os.SEEK_SET) + + offset = fvde_volume.get_offset() + self.assertEqual(offset, 16) + + fvde_volume.seek_offset(16, os.SEEK_CUR) + + offset = fvde_volume.get_offset() + self.assertEqual(offset, 32) + + fvde_volume.seek_offset(-16, os.SEEK_CUR) + + offset = fvde_volume.get_offset() + self.assertEqual(offset, 16) + + fvde_volume.seek_offset(-16, os.SEEK_END) + + offset = fvde_volume.get_offset() + self.assertEqual(offset, file_size - 16) + + fvde_volume.seek_offset(16, os.SEEK_END) + + offset = fvde_volume.get_offset() + self.assertEqual(offset, file_size + 16) + + # TODO: change IOError into ValueError + with self.assertRaises(IOError): + fvde_volume.seek_offset(-1, os.SEEK_SET) + + # TODO: change IOError into ValueError + with self.assertRaises(IOError): + fvde_volume.seek_offset(-32 - file_size, os.SEEK_CUR) + + # TODO: change IOError into ValueError + with self.assertRaises(IOError): + fvde_volume.seek_offset(-32 - file_size, os.SEEK_END) + + # TODO: change IOError into ValueError + with self.assertRaises(IOError): + fvde_volume.seek_offset(0, -1) + + fvde_volume.close() + + # Test the seek without open. + with self.assertRaises(IOError): + fvde_volume.seek_offset(16, os.SEEK_SET) + + +if __name__ == "__main__": + argument_parser = argparse.ArgumentParser() + + argument_parser.add_argument( + "-o", "--offset", dest="offset", action="store", default=None, + type=int, help="offset into the source file.") + + argument_parser.add_argument( + "-p", "--password", dest="password", action="store", default=None, + type=str, help="password to unlock the source file.") + + argument_parser.add_argument( + "-r", "--recovery-password", "--recovery_password", + dest="recovery_password", action="store", default=None, type=str, + help="recovery password to unlock the source file.") + + argument_parser.add_argument( + "source", nargs="?", action="store", metavar="PATH", + default=None, help="path of the source file.") + + options, unknown_options = argument_parser.parse_known_args() + unknown_options.insert(0, sys.argv[0]) + + setattr(unittest, "offset", options.offset) + setattr(unittest, "password", options.password) + setattr(unittest, "recovery_password", options.recovery_password) + setattr(unittest, "source", options.source) + + unittest.main(argv=unknown_options, verbosity=2) diff -Nru libfvde-20170930/tests/test_fvdeinfo.sh libfvde-20180108/tests/test_fvdeinfo.sh --- libfvde-20170930/tests/test_fvdeinfo.sh 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/test_fvdeinfo.sh 2018-01-08 17:02:21.000000000 +0000 @@ -7,7 +7,7 @@ EXIT_FAILURE=1; EXIT_IGNORE=77; -OPTION_SETS=""; +OPTION_SETS="password"; OPTIONS=""; INPUT_GLOB="*"; diff -Nru libfvde-20170930/tests/test_library.sh libfvde-20180108/tests/test_library.sh --- libfvde-20170930/tests/test_library.sh 2017-09-30 13:40:50.000000000 +0000 +++ libfvde-20180108/tests/test_library.sh 2018-01-08 17:03:06.000000000 +0000 @@ -7,9 +7,9 @@ EXIT_FAILURE=1; EXIT_IGNORE=77; -LIBRARY_TESTS="data_area_descriptor encrypted_metadata encryption_context_plist error io_handle keyring metadata metadata_block notify sector_data volume volume_group"; +LIBRARY_TESTS="data_area_descriptor encrypted_metadata encryption_context_plist error io_handle keyring metadata metadata_block notify sector_data segment_descriptor volume volume_group"; LIBRARY_TESTS_WITH_INPUT="support volume"; -OPTION_SETS=""; +OPTION_SETS="password"; INPUT_GLOB="*"; diff -Nru libfvde-20170930/tests/test_python_module.sh libfvde-20180108/tests/test_python_module.sh --- libfvde-20170930/tests/test_python_module.sh 2017-09-30 13:37:24.000000000 +0000 +++ libfvde-20180108/tests/test_python_module.sh 2018-01-08 17:02:21.000000000 +0000 @@ -9,7 +9,7 @@ TEST_FUNCTIONS="support"; TEST_FUNCTIONS_WITH_INPUT="volume"; -OPTION_SETS=""; +OPTION_SETS="password"; TEST_TOOL_DIRECTORY="."; INPUT_GLOB="*";