commit libmd for openSUSE:Factory
Hello community, here is the log from the commit of package libmd for openSUSE:Factory checked in at 2018-12-27 00:24:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libmd (Old) and /work/SRC/openSUSE:Factory/.libmd.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "libmd" Thu Dec 27 00:24:38 2018 rev:4 rq:658069 version:1.0.1 Changes: -------- --- /work/SRC/openSUSE:Factory/libmd/libmd.changes 2018-02-03 15:40:22.867316234 +0100 +++ /work/SRC/openSUSE:Factory/.libmd.new.28833/libmd.changes 2018-12-27 00:24:39.827894944 +0100 @@ -1,0 +2,10 @@ +Fri Dec 14 14:53:10 UTC 2018 - Martin Pluskal <mpluskal@suse.com> + +- Update to version 1.0.1: + * Add missing compatibility macros for SHA384 + * Fix compatibility macros for SHA512 + * test: Refactor and extend message digest testing + * Add compatibility with Aladdin Enterprises MD5 implementation + * build: Invoke sed with portable regex + +------------------------------------------------------------------- Old: ---- libmd-1.0.0.tar.xz libmd-1.0.0.tar.xz.asc New: ---- libmd-1.0.1.tar.xz libmd-1.0.1.tar.xz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libmd.spec ++++++ --- /var/tmp/diff_new_pack.74iF1C/_old 2018-12-27 00:24:40.359894511 +0100 +++ /var/tmp/diff_new_pack.74iF1C/_new 2018-12-27 00:24:40.359894511 +0100 @@ -12,13 +12,13 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define sover 0 Name: libmd -Version: 1.0.0 +Version: 1.0.1 Release: 0 Summary: Message digest functions from BSD systems License: BSD-2-Clause OR BSD-3-Clause OR ISC OR SUSE-Public-Domain @@ -77,11 +77,12 @@ %postun -n %{name}%{sover} -p /sbin/ldconfig %files -n %{name}%{sover} -%doc COPYING +%license COPYING %{_libdir}/%{name}.so.%{sover}* %files devel -%doc ChangeLog COPYING README +%license COPYING +%doc ChangeLog README %{_includedir}/* %{_libdir}/%{name}.so %{_libdir}/pkgconfig/libmd.pc ++++++ libmd-1.0.0.tar.xz -> libmd-1.0.1.tar.xz ++++++ ++++ 4476 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmd-1.0.0/.dist-version new/libmd-1.0.1/.dist-version --- old/libmd-1.0.0/.dist-version 2018-01-13 23:03:14.000000000 +0100 +++ new/libmd-1.0.1/.dist-version 2018-10-22 12:49:23.000000000 +0200 @@ -1 +1 @@ -1.0.0 +1.0.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmd-1.0.0/ChangeLog new/libmd-1.0.1/ChangeLog --- old/libmd-1.0.0/ChangeLog 2018-01-13 23:03:14.000000000 +0100 +++ new/libmd-1.0.1/ChangeLog 2018-10-22 12:49:23.000000000 +0200 @@ -1,3 +1,84 @@ +commit 9c330aa8e5085c57249550c0596154ac0e3ab0f4 +Author: Guillem Jover <guillem@hadrons.org> +Date: Mon Oct 22 12:43:15 2018 +0200 + + Release libmd 1.0.1 + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit f23a2145a019776f827c11c03474761ba0b44e48 +Author: Guillem Jover <guillem@hadrons.org> +Date: Sat Oct 6 03:46:51 2018 +0200 + + Add compatibility with Aladdin Enterprises MD5 implementation + + This will be guarded by a LIBMD_MD5_ALADDIN macro check, to avoid + polluting the namespace by unsuspecting code. The macro can always + be defined unconditionally, and the guard could even potentially + be removed in the future if required. + + Prompted-by: Yangfl <mmyangfl@gmail.com> + Ref: https://bugs.debian.org/909116 + + include/md5.h | 20 ++++++++++++++++++++ + test/md5.c | 30 +++++++++++++++++++++++++++--- + 2 files changed, 47 insertions(+), 3 deletions(-) + +commit cf9ac1507f62899d92718fdc216689c2fc98e1fe +Author: Guillem Jover <guillem@hadrons.org> +Date: Sat Oct 6 04:33:02 2018 +0200 + + test: Refactor and extend message digest testing + + Generate the base test function with a maro, because all of them follow + the same pattern. And extend it by covering more of the API. + + test/Makefile.am | 4 ++++ + test/md2.c | 16 +++++--------- + test/md4.c | 16 +++++--------- + test/md5.c | 14 +++++------- + test/rmd160.c | 16 +++++--------- + test/sha1.c | 16 +++++--------- + test/sha2.c | 46 ++++++++++++---------------------------- + test/{rmd160.c => test.h} | 54 +++++++++++++++++++++++++++++++++++------------ + 8 files changed, 83 insertions(+), 99 deletions(-) + +commit b6b3402e4a4b53cedff228a75339f08d23e6411d +Author: Guillem Jover <guillem@hadrons.org> +Date: Sat Oct 6 04:30:59 2018 +0200 + + Fix compatibility macros for SHA512 + + These have swapped names in their macro values. + + include/sha512.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +commit ff52516cedbdd94dcba2ab2c3e5bddbd6a6d65e2 +Author: Guillem Jover <guillem@hadrons.org> +Date: Sat Oct 6 04:30:11 2018 +0200 + + Add missing compatibility macros for SHA384 + + include/sha512.h | 4 ++++ + 1 file changed, 4 insertions(+) + +commit bf04c4110f8028bbb4d6682b5eb93a3dc1a2f895 +Author: Rainer Müller <raimue@codingfarm.de> +Date: Fri Sep 29 17:02:33 2017 +0200 + + build: Invoke sed with portable regex + + The previous sed expression only worked with GNU sed, as the '\+' + literal is an extension to basic regex. Use portable syntax instead that + also works with other implementations of sed(1), for example on macOS. + + Signed-off-by: Guillem Jover <guillem@hadrons.org> + + src/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + commit c657abc165177183f453437e578832d146103d61 Author: Guillem Jover <guillem@hadrons.org> Date: Sat Jan 13 16:29:02 2018 +0100 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmd-1.0.0/build-aux/ar-lib new/libmd-1.0.1/build-aux/ar-lib --- old/libmd-1.0.0/build-aux/ar-lib 2018-01-13 19:52:49.000000000 +0100 +++ new/libmd-1.0.1/build-aux/ar-lib 2018-10-22 12:49:18.000000000 +0200 @@ -4,7 +4,7 @@ me=ar-lib scriptversion=2012-03-01.08; # UTC -# Copyright (C) 2010-2017 Free Software Foundation, Inc. +# Copyright (C) 2010-2018 Free Software Foundation, Inc. # Written by Peter Rosin <peda@lysator.liu.se>. # # This program is free software; you can redistribute it and/or modify @@ -18,7 +18,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmd-1.0.0/build-aux/compile new/libmd-1.0.1/build-aux/compile --- old/libmd-1.0.0/build-aux/compile 2018-01-13 19:52:49.000000000 +0100 +++ new/libmd-1.0.1/build-aux/compile 2018-10-22 12:49:18.000000000 +0200 @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-10-14.11; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # Written by Tom Tromey <tromey@cygnus.com>. # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -255,7 +255,8 @@ echo "compile $scriptversion" exit $? ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac @@ -339,9 +340,9 @@ # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmd-1.0.0/build-aux/missing new/libmd-1.0.1/build-aux/missing --- old/libmd-1.0.0/build-aux/missing 2018-01-13 19:52:49.000000000 +0100 +++ new/libmd-1.0.1/build-aux/missing 2018-10-22 12:49:18.000000000 +0200 @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2013-10-28.13; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -101,9 +101,9 @@ exit $st fi -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software program_details () { @@ -207,9 +207,9 @@ exit $st # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmd-1.0.0/build-aux/test-driver new/libmd-1.0.1/build-aux/test-driver --- old/libmd-1.0.0/build-aux/test-driver 2018-01-13 19:52:49.000000000 +0100 +++ new/libmd-1.0.1/build-aux/test-driver 2018-10-22 12:49:18.000000000 +0200 @@ -1,9 +1,9 @@ #! /bin/sh # test-driver - basic testsuite driver script. -scriptversion=2013-07-13.22; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2011-2014 Free Software Foundation, Inc. +# Copyright (C) 2011-2018 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# along with this program. If not, see <https://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -140,9 +140,9 @@ # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmd-1.0.0/configure.ac new/libmd-1.0.1/configure.ac --- old/libmd-1.0.0/configure.ac 2018-01-13 19:42:59.000000000 +0100 +++ new/libmd-1.0.1/configure.ac 2018-10-22 12:47:02.000000000 +0200 @@ -13,7 +13,7 @@ LIBMD_ABI_MAJOR=0 LIBMD_ABI_MINOR=0 -LIBMD_ABI_PATCH=1 +LIBMD_ABI_PATCH=2 LIBMD_ABI="$LIBMD_ABI_MAJOR:$LIBMD_ABI_MINOR:$LIBMD_ABI_PATCH" AC_SUBST([LIBMD_ABI]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmd-1.0.0/include/md5.h new/libmd-1.0.1/include/md5.h --- old/libmd-1.0.0/include/md5.h 2017-06-05 04:51:37.000000000 +0200 +++ new/libmd-1.0.1/include/md5.h 2018-10-22 12:47:02.000000000 +0200 @@ -47,4 +47,24 @@ } #endif +/* Avoid polluting the namespace. Even though this makes this usage + * implementation-specific, defining it unconditionally should not be + * a problem, and better than possibly breaking unexpecting code. */ +#ifdef LIBMD_MD5_ALADDIN + +/* + * Interface compatibility with Aladdin Enterprises independent + * implementation from RFC 1321. + */ + +typedef uint8_t md5_byte_t; +typedef uint32_t md5_word_t; +typedef MD5_CTX md5_state_t; + +#define md5_init(pms) MD5Init(pms) +#define md5_append(pms, data, nbytes) MD5Update(pms, data, nbytes) +#define md5_finish(pms, digest) MD5Final(digest, pms) + +#endif /* LIBMD_MD5_ALADDIN */ + #endif /* _MD5_H_ */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmd-1.0.0/include/sha512.h new/libmd-1.0.1/include/sha512.h --- old/libmd-1.0.0/include/sha512.h 2016-02-10 01:04:20.000000000 +0100 +++ new/libmd-1.0.1/include/sha512.h 2018-10-22 12:46:31.000000000 +0200 @@ -37,13 +37,17 @@ #define SHA384_Init SHA384Init #define SHA384_Update SHA384Update #define SHA384_Final SHA384Final +#define SHA384_End SHA384End +#define SHA384_Data SHA384Data +#define SHA384_File SHA384File +#define SHA384_FileChunk SHA384FileChunk #define SHA512_Init SHA512Init #define SHA512_Update SHA512Update #define SHA512_Final SHA512Final #define SHA512_End SHA512End -#define SHA512_Data SHA512File -#define SHA512_File SHA512FileChunk -#define SHA512_FileChunk SHA512Data +#define SHA512_Data SHA512Data +#define SHA512_File SHA512File +#define SHA512_FileChunk SHA512FileChunk #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmd-1.0.0/m4/libtool.m4 new/libmd-1.0.1/m4/libtool.m4 --- old/libmd-1.0.0/m4/libtool.m4 2018-01-13 19:52:44.000000000 +0100 +++ new/libmd-1.0.1/m4/libtool.m4 2018-10-22 12:49:13.000000000 +0200 @@ -4063,7 +4063,8 @@ if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD + if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -6438,7 +6439,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else GXX=no @@ -6813,7 +6814,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -6878,7 +6879,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -7217,7 +7218,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else # FIXME: insert proper C++ library support @@ -7301,7 +7302,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. @@ -7312,7 +7313,7 @@ # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmd-1.0.0/src/Makefile.am new/libmd-1.0.1/src/Makefile.am --- old/libmd-1.0.0/src/Makefile.am 2017-06-05 05:01:25.000000000 +0200 +++ new/libmd-1.0.1/src/Makefile.am 2018-04-21 23:29:38.000000000 +0200 @@ -69,7 +69,7 @@ # Generate a simple libtool symbol export list to be used as a fallback if # there is no version script support. libmd.sym: libmd.map - $(AM_V_GEN) sed -ne 's/^[[:space:]]\+\([A-Za-z0-9]\+\);/\1/p' $< > $@ + $(AM_V_GEN) sed -ne 's/^[[:space:]]\{1,\}\([A-Za-z0-9]\{1,\}\);/\1/p' $< > $@ md2hl.c: helper.c $(AM_V_GEN) sed -e 's/hashinc/md2.h/g' -e 's/HASH/MD2/g' $< > $@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmd-1.0.0/test/Makefile.am new/libmd-1.0.1/test/Makefile.am --- old/libmd-1.0.0/test/Makefile.am 2017-06-05 04:56:03.000000000 +0200 +++ new/libmd-1.0.1/test/Makefile.am 2018-10-22 12:47:01.000000000 +0200 @@ -7,6 +7,10 @@ LDADD = $(top_builddir)/src/libmd.la +check_HEADERS = \ + test.h \ + $(nil) + check_PROGRAMS = \ md2 \ md4 \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmd-1.0.0/test/md2.c new/libmd-1.0.1/test/md2.c --- old/libmd-1.0.0/test/md2.c 2017-06-05 04:56:03.000000000 +0200 +++ new/libmd-1.0.1/test/md2.c 2018-10-22 12:47:01.000000000 +0200 @@ -26,24 +26,18 @@ #include <config.h> -#include <assert.h> #include <md2.h> -#include <string.h> -void -test_md2(const char *digest, const char *string) -{ - char result[MD2_DIGEST_STRING_LENGTH]; +#include "test.h" - assert(strcmp(digest, MD2Data(string, strlen(string), result)) == 0); -} +DEF_TEST_DIGEST(MD2, MD2) int main() { - test_md2("8350e5a3e24c153df2275c9f80692773", ""); - test_md2("da853b0d3f88d99b30283a69e6ded6bb", "abc"); - test_md2("2fe3cb9e21922819e79a2781af74e36d", "12345"); + test_MD2("8350e5a3e24c153df2275c9f80692773", ""); + test_MD2("da853b0d3f88d99b30283a69e6ded6bb", "abc"); + test_MD2("2fe3cb9e21922819e79a2781af74e36d", "12345"); return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmd-1.0.0/test/md4.c new/libmd-1.0.1/test/md4.c --- old/libmd-1.0.0/test/md4.c 2017-06-05 04:56:03.000000000 +0200 +++ new/libmd-1.0.1/test/md4.c 2018-10-22 12:47:01.000000000 +0200 @@ -26,24 +26,18 @@ #include <config.h> -#include <assert.h> #include <md4.h> -#include <string.h> -void -test_md4(const char *digest, const char *string) -{ - char result[MD4_DIGEST_STRING_LENGTH]; +#include "test.h" - assert(strcmp(digest, MD4Data(string, strlen(string), result)) == 0); -} +DEF_TEST_DIGEST(MD4, MD4) int main() { - test_md4("31d6cfe0d16ae931b73c59d7e0c089c0", ""); - test_md4("a448017aaf21d8525fc10ae87aa6729d", "abc"); - test_md4("23580e2a459f7ea40f9efa148b63cafb", "12345"); + test_MD4("31d6cfe0d16ae931b73c59d7e0c089c0", ""); + test_MD4("a448017aaf21d8525fc10ae87aa6729d", "abc"); + test_MD4("23580e2a459f7ea40f9efa148b63cafb", "12345"); return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmd-1.0.0/test/md5.c new/libmd-1.0.1/test/md5.c --- old/libmd-1.0.0/test/md5.c 2017-06-05 04:56:03.000000000 +0200 +++ new/libmd-1.0.1/test/md5.c 2018-10-22 12:47:02.000000000 +0200 @@ -24,26 +24,46 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#define LIBMD_MD5_ALADDIN 1 + #include <config.h> #include <assert.h> #include <md5.h> #include <string.h> +#include "test.h" + +DEF_TEST_DIGEST(MD5, MD5) + void -test_md5(const char *digest, const char *string) +test_MD5_aladdin(const char *hash_str_ref, const char *data) { - char result[MD5_DIGEST_STRING_LENGTH]; + uint8_t hash_bin_ref[MD5_DIGEST_LENGTH]; + uint8_t hash_bin_got[MD5_DIGEST_LENGTH]; + md5_state_t pms; + + hex2bin(hash_bin_ref, hash_str_ref, MD5_DIGEST_LENGTH); + + md5_init(&pms); + md5_append(&pms, data, strlen(data)); + md5_finish(&pms, hash_bin_got); + assert(memcmp(hash_bin_ref, hash_bin_got, MD5_DIGEST_LENGTH) == 0); +} - assert(strcmp(digest, MD5Data(string, strlen(string), result)) == 0); +void +test_MD5_all(const char *hash_str_ref, const char *data) +{ + test_MD5(hash_str_ref, data); + test_MD5_aladdin(hash_str_ref, data); } int main() { - test_md5("d41d8cd98f00b204e9800998ecf8427e", ""); - test_md5("900150983cd24fb0d6963f7d28e17f72", "abc"); - test_md5("827ccb0eea8a706c4c34a16891f84e7b", "12345"); + test_MD5_all("d41d8cd98f00b204e9800998ecf8427e", ""); + test_MD5_all("900150983cd24fb0d6963f7d28e17f72", "abc"); + test_MD5_all("827ccb0eea8a706c4c34a16891f84e7b", "12345"); return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmd-1.0.0/test/rmd160.c new/libmd-1.0.1/test/rmd160.c --- old/libmd-1.0.0/test/rmd160.c 2017-06-05 04:56:03.000000000 +0200 +++ new/libmd-1.0.1/test/rmd160.c 2018-10-22 12:47:01.000000000 +0200 @@ -26,24 +26,18 @@ #include <config.h> -#include <assert.h> #include <rmd160.h> -#include <string.h> -void -test_rmd160(const char *digest, const char *string) -{ - char result[RMD160_DIGEST_STRING_LENGTH]; +#include "test.h" - assert(strcmp(digest, RMD160Data(string, strlen(string), result)) == 0); -} +DEF_TEST_DIGEST(RMD160, RMD160) int main() { - test_rmd160("9c1185a5c5e9fc54612808977ee8f548b2258d31", ""); - test_rmd160("8eb208f7e05d987a9b044a8e98c6b087f15a0bfc", "abc"); - test_rmd160("e9cbd2ea8015a084ce9cf83a3c65b51f8fa10a39", "12345"); + test_RMD160("9c1185a5c5e9fc54612808977ee8f548b2258d31", ""); + test_RMD160("8eb208f7e05d987a9b044a8e98c6b087f15a0bfc", "abc"); + test_RMD160("e9cbd2ea8015a084ce9cf83a3c65b51f8fa10a39", "12345"); return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmd-1.0.0/test/sha1.c new/libmd-1.0.1/test/sha1.c --- old/libmd-1.0.0/test/sha1.c 2017-06-05 04:56:03.000000000 +0200 +++ new/libmd-1.0.1/test/sha1.c 2018-10-22 12:47:01.000000000 +0200 @@ -26,24 +26,18 @@ #include <config.h> -#include <assert.h> #include <sha1.h> -#include <string.h> -void -test_sha1(const char *digest, const char *string) -{ - char result[SHA1_DIGEST_STRING_LENGTH]; +#include "test.h" - assert(strcmp(digest, SHA1Data(string, strlen(string), result)) == 0); -} +DEF_TEST_DIGEST(SHA1, SHA1) int main() { - test_sha1("da39a3ee5e6b4b0d3255bfef95601890afd80709", ""); - test_sha1("a9993e364706816aba3e25717850c26c9cd0d89d", "abc"); - test_sha1("8cb2237d0679ca88db6464eac60da96345513964", "12345"); + test_SHA1("da39a3ee5e6b4b0d3255bfef95601890afd80709", ""); + test_SHA1("a9993e364706816aba3e25717850c26c9cd0d89d", "abc"); + test_SHA1("8cb2237d0679ca88db6464eac60da96345513964", "12345"); return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmd-1.0.0/test/sha2.c new/libmd-1.0.1/test/sha2.c --- old/libmd-1.0.0/test/sha2.c 2017-06-05 04:56:03.000000000 +0200 +++ new/libmd-1.0.1/test/sha2.c 2018-10-22 12:47:01.000000000 +0200 @@ -26,56 +26,36 @@ #include <config.h> -#include <assert.h> #include <sha2.h> -#include <string.h> -void -test_sha256(const char *digest, const char *string) -{ - char result[SHA256_DIGEST_STRING_LENGTH]; - - assert(strcmp(digest, SHA256Data(string, strlen(string), result)) == 0); -} - -void -test_sha384(const char *digest, const char *string) -{ - char result[SHA384_DIGEST_STRING_LENGTH]; - - assert(strcmp(digest, SHA384Data(string, strlen(string), result)) == 0); -} - -void -test_sha512(const char *digest, const char *string) -{ - char result[SHA512_DIGEST_STRING_LENGTH]; +#include "test.h" - assert(strcmp(digest, SHA512Data(string, strlen(string), result)) == 0); -} +DEF_TEST_DIGEST(SHA256, SHA2) +DEF_TEST_DIGEST(SHA384, SHA2) +DEF_TEST_DIGEST(SHA512, SHA2) int main() { - test_sha256("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + test_SHA256("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", ""); - test_sha256("ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad", + test_SHA256("ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad", "abc"); - test_sha256("5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5", + test_SHA256("5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5", "12345"); - test_sha384("38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b", + test_SHA384("38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b", ""); - test_sha384("cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7", + test_SHA384("cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7", "abc"); - test_sha384("0fa76955abfa9dafd83facca8343a92aa09497f98101086611b0bfa95dbc0dcc661d62e9568a5a032ba81960f3e55d4a", + test_SHA384("0fa76955abfa9dafd83facca8343a92aa09497f98101086611b0bfa95dbc0dcc661d62e9568a5a032ba81960f3e55d4a", "12345"); - test_sha512("cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e", + test_SHA512("cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e", ""); - test_sha512("ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f", + test_SHA512("ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f", "abc"); - test_sha512("3627909a29c31381a071ec27f7c9ca97726182aed29a7ddd2e54353322cfb30abb9e3a6df2ac2c20fe23436311d678564d0c8d305930575f60e2d3d048184d79", + test_SHA512("3627909a29c31381a071ec27f7c9ca97726182aed29a7ddd2e54353322cfb30abb9e3a6df2ac2c20fe23436311d678564d0c8d305930575f60e2d3d048184d79", "12345"); return 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libmd-1.0.0/test/test.h new/libmd-1.0.1/test/test.h --- old/libmd-1.0.0/test/test.h 1970-01-01 01:00:00.000000000 +0100 +++ new/libmd-1.0.1/test/test.h 2018-10-22 12:47:01.000000000 +0200 @@ -0,0 +1,77 @@ +/* + * Copyright © 2018 Guillem Jover <guillem@hadrons.org> + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <config.h> + +#include <assert.h> +#include <string.h> + +static int +hexchar2bin(int c) +{ + if (c >= '0' && c <= '9') + return c - '0'; + else if (c >= 'a' && c <= 'f') + return c - 'a' + 10; + else if (c >= 'A' && c <= 'F') + return c - 'A' + 10; + assert(!"invalid hexadecimal input"); +} + +static void +hex2bin(uint8_t *bin, const char *str, size_t bin_len) +{ + int i; + + for (i = 0; i < bin_len; i++) + bin[i] = hexchar2bin(str[i * 2]) << 4 | + hexchar2bin(str[i * 2 + 1]); +} + +#define DEF_TEST_DIGEST(name, type) \ +void \ +test_##name(const char *hash_str_ref, const char *data) \ +{ \ + uint8_t hash_bin_ref[name##_DIGEST_LENGTH]; \ + uint8_t hash_bin_got[name##_DIGEST_LENGTH]; \ + char hash_str_got[name##_DIGEST_STRING_LENGTH]; \ + type##_CTX ctx; \ +\ + hex2bin(hash_bin_ref, hash_str_ref, name##_DIGEST_LENGTH); \ +\ + name##Data(data, strlen(data), hash_str_got); \ + assert(strcmp(hash_str_ref, hash_str_got) == 0); \ +\ + name##Init(&ctx); \ + name##Update(&ctx, data, strlen(data)); \ + name##End(&ctx, hash_str_got); \ + assert(strcmp(hash_str_ref, hash_str_got) == 0); \ +\ + name##Init(&ctx); \ + name##Update(&ctx, data, strlen(data)); \ + name##Final(hash_bin_got, &ctx); \ + assert(memcmp(hash_bin_ref, hash_bin_got, sizeof(hash_bin_ref)) == 0); \ +}
participants (1)
-
root