From 0e9b185152b56ff33fe8a2a89a4f84923a308300 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= <debian@jff.email>
Date: Mon, 14 Sep 2020 12:27:22 +0200
Subject: New upstream version 3.1.7

---
 lib/lanplus/Makefile.in          | 275 ++++++++++++++++++++++++++++-----------
 lib/lanplus/lanplus.c            |  72 +++++-----
 lib/lanplus/lanplus_crypt.c      |  14 +-
 lib/lanplus/lanplus_crypt_impl.c |  20 ++-
 4 files changed, 267 insertions(+), 114 deletions(-)

(limited to 'lib/lanplus')

diff --git a/lib/lanplus/Makefile.in b/lib/lanplus/Makefile.in
index e09f0ab..cdd8498 100644
--- a/lib/lanplus/Makefile.in
+++ b/lib/lanplus/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -19,6 +18,51 @@
 
 
 VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -38,7 +82,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = lib/lanplus
-DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp README
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -49,6 +94,10 @@ CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 LIBRARIES = $(noinst_LIBRARIES)
 ARFLAGS = cru
+AM_V_AR = $(am__v_AR_@AM_V@)
+am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
+am__v_AR_0 = @echo "  AR      " $@;
+am__v_AR_1 = 
 libipmi_lanplus_a_AR = $(AR) $(ARFLAGS)
 libipmi_lanplus_a_LIBADD =
 am_libipmi_lanplus_a_OBJECTS = lanplus.$(OBJEXT) \
@@ -77,28 +126,82 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(libdir)"
 LTLIBRARIES = $(lib_LTLIBRARIES)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
 CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
 SOURCES = $(libipmi_lanplus_a_SOURCES)
 DIST_SOURCES = $(libipmi_lanplus_a_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
@@ -114,6 +217,7 @@ CROSS_LFLAGS = @CROSS_LFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
 DSYMUTIL = @DSYMUTIL@
 DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
@@ -151,6 +255,7 @@ LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
 MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
 MKDIR_P = @MKDIR_P@
 NM = @NM@
 NMEDIT = @NMEDIT@
@@ -166,6 +271,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_DIR = @PKG_DIR@
@@ -183,6 +289,7 @@ abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
@@ -215,7 +322,6 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -283,13 +389,14 @@ $(am__aclocal_m4_deps):
 
 clean-noinstLIBRARIES:
 	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-libipmi_lanplus.a: $(libipmi_lanplus_a_OBJECTS) $(libipmi_lanplus_a_DEPENDENCIES) 
-	-rm -f libipmi_lanplus.a
-	$(libipmi_lanplus_a_AR) libipmi_lanplus.a $(libipmi_lanplus_a_OBJECTS) $(libipmi_lanplus_a_LIBADD)
-	$(RANLIB) libipmi_lanplus.a
+
+libipmi_lanplus.a: $(libipmi_lanplus_a_OBJECTS) $(libipmi_lanplus_a_DEPENDENCIES) $(EXTRA_libipmi_lanplus_a_DEPENDENCIES) 
+	$(AM_V_at)-rm -f libipmi_lanplus.a
+	$(AM_V_AR)$(libipmi_lanplus_a_AR) libipmi_lanplus.a $(libipmi_lanplus_a_OBJECTS) $(libipmi_lanplus_a_LIBADD)
+	$(AM_V_at)$(RANLIB) libipmi_lanplus.a
+
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
-	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
 	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
 	list2=; for p in $$list; do \
 	  if test -f $$p; then \
@@ -297,6 +404,8 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	  else :; fi; \
 	done; \
 	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
 	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
 	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
 	}
@@ -312,12 +421,14 @@ uninstall-libLTLIBRARIES:
 
 clean-libLTLIBRARIES:
 	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
+	@list='$(lib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -334,25 +445,25 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lanplus_strings.Po@am__quote@
 
 .c.o:
-@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(COMPILE) -c $<
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c $<
 
 .c.obj:
-@am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
-@am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
 
 mostlyclean-libtool:
 	-rm -f *.lo
@@ -360,26 +471,15 @@ mostlyclean-libtool:
 clean-libtool:
 	-rm -rf .libs _libs
 
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
 	set x; \
 	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	$(am__define_uniq_tagged_files); \
 	shift; \
 	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
@@ -391,15 +491,11 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	      $$unique; \
 	  fi; \
 	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
 	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 	     $$unique
@@ -408,6 +504,21 @@ GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -459,10 +570,15 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
 mostlyclean-generic:
 
 distclean-generic:
@@ -544,19 +660,20 @@ uninstall-am: uninstall-libLTLIBRARIES
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libLTLIBRARIES clean-libtool clean-noinstLIBRARIES ctags \
-	distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-libLTLIBRARIES install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-libLTLIBRARIES
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+	clean-libLTLIBRARIES clean-libtool clean-noinstLIBRARIES \
+	cscopelist-am ctags ctags-am distclean distclean-compile \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-libLTLIBRARIES \
+	install-man install-pdf install-pdf-am install-ps \
+	install-ps-am install-strip installcheck installcheck-am \
+	installdirs maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+	uninstall-am uninstall-libLTLIBRARIES
 
 # lib_LTLIBRARIES       = libipmi_lanplus.la 
 
diff --git a/lib/lanplus/lanplus.c b/lib/lanplus/lanplus.c
index c910b85..664eea6 100644
--- a/lib/lanplus/lanplus.c
+++ b/lib/lanplus/lanplus.c
@@ -32,18 +32,19 @@
 /* ARCress, TODO: improve error handling and remove all assert() calls here. */
 
 #ifdef WIN32
-#ifdef HAVE_IPV6
-#include <winsock2.h>
-//#include <ws2tcpip.h>
-#else
-#include <winsock.h>
-#endif
 #include <windows.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <inttypes-win.h>
 #include <io.h>
 #include <signal.h>
+//#define HAVE_IPV6  1
+#ifdef HAVE_IPV6
+#include <winsock2.h>
+//#include <ws2tcpip.h>
+#else
+#include <winsock.h>
+#endif
 #include <time.h>
 #else
 #include <stdlib.h>
@@ -102,11 +103,7 @@ static int my_ai_flags = AI_NUMERICSERV; /*0x0400 Dont use name resolution NEW*/
 #undef HAVE_IPV6
 #endif
 #ifdef HAVE_IPV6
-#ifdef WIN32
-#define SOCKADDR_T  SOCKADDR_STORAGE
-#else
 #define SOCKADDR_T  struct sockaddr_storage
-#endif
 #else
 #define SOCKADDR_T  struct sockaddr_in
 #endif
@@ -1096,6 +1093,16 @@ read_open_session_response(struct ipmi_rs * rsp, int offset)
 }
 
 
+/* os_assert - wrapper to prevent calling assert in Windows */
+void os_assert(char *msg)
+{
+    printf("ASSERT ERROR: %s\n",msg);
+#ifdef WIN32
+    exit(1);
+#else
+    assert(0);
+#endif
+}
 
 /*
  * read_rakp2_message
@@ -1183,7 +1190,7 @@ read_rakp2_message(
 
 	 default:
 		 lprintf(LOG_ERR, "read_rakp2_message: no support for authentication algorithm 0x%x", auth_alg);
-		 assert(0); /*void routine*/
+		 os_assert("read_rakp2_message"); /*void routine*/
 		 break;
 	 }
 }
@@ -1263,7 +1270,7 @@ read_rakp4_message(
 	 default:
 		 lprintf(LOG_ERR, "read_rakp4_message: no support "
 			 "for authentication algorithm 0x%x", auth_alg);
-		 assert(0); /*void routine*/
+		 os_assert("read_rakp4_message"); /*void routine*/
 		 break;	 
 	 }
 }
@@ -2919,7 +2926,8 @@ ipmi_lanplus_send_ipmi_cmd(
 	// v2_payload.payload_length = 7 + req->msg.data_len; /*initial ++++*/
 	v2_payload.payload.ipmi_request.request = req;
 		
-	// if (verbose > 2) lprintf(LOG_INFO,"ipmi cmd payload");  /*++++*/
+	// if (verbose > 2) 
+	lprintf(LOG_NOTICE,"ipmi cmd before payload, len=%d\n",v2_payload.payload_length);  /*++++*/
 	return ipmi_lanplus_send_payload(intf, &v2_payload);
 }
 
@@ -3234,6 +3242,7 @@ ipmi_lanplus_open_session(struct ipmi_intf * intf)
 		}
 
 	}
+	lprintf(LOG_NOTICE,"ipmi_lanplus_open_session complete rc=%d\n", rc);  //++++
 
 	return rc;
 }
@@ -3657,6 +3666,7 @@ ipmi_lanplus_open(struct ipmi_intf * intf)
 	session = intf->session;
 
 
+        lprintf(LOG_NOTICE, "ipmi_lanplus_open started\n");  //++++
 	if (!session->port)
 		session->port = IPMI_LANPLUS_PORT;
 	if (!session->privlvl)
@@ -3706,7 +3716,7 @@ ipmi_lanplus_open(struct ipmi_intf * intf)
 #endif
 
 #ifdef HAVE_IPV6
-	session->addrlen = 0; 
+        session->addrlen = 0; 
 	memset(&session->addr, 0, sizeof(session->addr));
 	memset(&addr, 0, sizeof(addr));
 	sprintf(service, "%d", session->port);
@@ -3717,10 +3727,10 @@ ipmi_lanplus_open(struct ipmi_intf * intf)
 	hints.ai_flags    = my_ai_flags;
 	hints.ai_protocol = IPPROTO_UDP; /*  */
 
-	rc = getaddrinfo((char *)session->hostname, service, &hints, &result);
+        rc = getaddrinfo((char *)session->hostname, service, &hints, &result);
 	if (rc != 0) {
-	        lprintf(LOG_ERR, "Address lookup for %s failed with %d, %s",
-	                session->hostname,rc,gai_strerror(rc));
+	        lprintf(LOG_ERR, "Address lookup for %s failed with %d",
+	                session->hostname,rc);
 	        return -1;
 	}
 
@@ -3728,24 +3738,24 @@ ipmi_lanplus_open(struct ipmi_intf * intf)
 	 * Try each address until we successfully connect(2).
 	 */
 	for (rp = result; rp != NULL; rp = rp->ai_next) {
-		intf->fd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
-		if (intf->fd == -1) continue;
+	        intf->fd = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
+	        if (intf->fd == -1) continue;
 		/* valid protocols are IPPROTO_UDP, IPPROTO_IPV6 */
 		if (rp->ai_protocol == IPPROTO_TCP) continue;  /*IPMI != TCP*/
 		lprintf(LOG_DEBUG, "lanplus socket(%d,%d,%d), connect(%d)",
 			rp->ai_family, rp->ai_socktype, rp->ai_protocol,
 			intf->fd );
-		if (connect(intf->fd, rp->ai_addr, rp->ai_addrlen) != -1) {
+	        if (connect(intf->fd, rp->ai_addr, rp->ai_addrlen) != -1) {
 			lprintf(LOG_DEBUG, "lanplus connect ok, addrlen=%d size=%d",
 				rp->ai_addrlen,sizeof(addr)); 
-				addrlen = rp->ai_addrlen;
-			memcpy(&addr, rp->ai_addr, addrlen);
-			// memcpy(&session->addr, rp->ai_addr, rp->ai_addrlen);
-			session->addrlen = rp->ai_addrlen;
-			break;  /* Success */
-		}
-		close(intf->fd);
-		intf->fd = -1;
+			addrlen = rp->ai_addrlen;
+	                memcpy(&addr, rp->ai_addr, addrlen);
+	                // memcpy(&session->addr, rp->ai_addr, rp->ai_addrlen);
+	                session->addrlen = rp->ai_addrlen;
+	                break;  /* Success */
+	        }
+	        close(intf->fd);
+	        intf->fd = -1;
 	}
 	freeaddrinfo(result);  /* Done with addrinfo */
 	if (intf->fd < 0) {
@@ -3914,7 +3924,7 @@ void test_crypt1(void)
 								&bytes_encrypted))
 	{
 		lprintf(LOG_ERR, "Encrypt test failed");
-		assert(0);  /*assert for testing*/
+		os_assert("test_crypt1");  /*assert for testing*/
 	}
 	printbuf(encrypt_buffer, bytes_encrypted, "encrypted payload");
 	
@@ -3927,7 +3937,7 @@ void test_crypt1(void)
 								&bytes_decrypted))
 	{
 		lprintf(LOG_ERR, "Decrypt test failed\n");
-		assert(0);  /*assert for testing*/
+		os_assert("test_crypt1");  /*assert for testing*/
 	}	
 	printbuf(decrypt_buffer, bytes_decrypted, "decrypted payload");
 	
@@ -4020,6 +4030,7 @@ ipmi_lanplus_keepalive(struct ipmi_intf * intf)
 static int ipmi_lanplus_setup(struct ipmi_intf * intf)
 {
 
+	lprintf(LOG_NOTICE, "ipmi_lanplus_setup started"); //++++
 	if (lanplus_seed_prng(16)) {
 		lprintf(LOG_ERR, "lanplus_seed_prng failure");
 		return -1;
@@ -4031,6 +4042,7 @@ static int ipmi_lanplus_setup(struct ipmi_intf * intf)
 		return -1;
 	}
 	memset(intf->session, 0, sizeof(struct ipmi_session));
+	lprintf(LOG_NOTICE, "ipmi_lanplus_setup complete"); //++++
 	return 0;
 }
 
diff --git a/lib/lanplus/lanplus_crypt.c b/lib/lanplus/lanplus_crypt.c
index 5554898..8becfea 100644
--- a/lib/lanplus/lanplus_crypt.c
+++ b/lib/lanplus/lanplus_crypt.c
@@ -155,6 +155,14 @@ int lanplus_rakp2_hmac_matches(const struct ipmi_session * session,
 	/* ROLEm */
 	buffer[56] = session->v2_data.requested_role;
 
+ 	if (ipmi_oem_active(intf, "i82571spt")) {
+		/* The HMAC calculation code in the Intel 82571 GbE
+		 * skips this bit!  Looks like a GbE bug, but we need
+		 * to work around it here anyway... */
+		buffer[56] &= ~0x10;
+		if (verbose > 2) printf("bitmask for i82571spt\n");
+	}
+
 	/* ULENGTHm */
 	buffer[57] = (uint8_t)strlen((const char *)session->username);
 
@@ -164,7 +172,9 @@ int lanplus_rakp2_hmac_matches(const struct ipmi_session * session,
 
 	if (verbose > 2)
 	{
-		lprintf(LOG_DEBUG,"rakp2 mac input buffer (%d bytes)", bufferLength);
+		// lprintf(LOG_DEBUG,"rakp2 mac input buffer (%d bytes)", bufferLength);
+		printbuf((const uint8_t *)buffer, bufferLength, ">> rakp2 mac input buffer");
+		printbuf((const uint8_t *)session->authcode, IPMI_AUTHCODE_BUFFER_SIZE, ">> rakp2 mac key");
 	}
 
 	/*
@@ -179,7 +189,7 @@ int lanplus_rakp2_hmac_matches(const struct ipmi_session * session,
 				 &macLength);
 
 	free(buffer);
-
+	buffer = NULL;
 
 	if (verbose > 2)
 	{
diff --git a/lib/lanplus/lanplus_crypt_impl.c b/lib/lanplus/lanplus_crypt_impl.c
index 389a436..821ae0a 100644
--- a/lib/lanplus/lanplus_crypt_impl.c
+++ b/lib/lanplus/lanplus_crypt_impl.c
@@ -168,6 +168,9 @@ lanplus_HMAC(uint8_t        mac,
 	uint8_t *pnew;
 
 	*md_len = 0;  /*if return NULL, also return zero length*/
+	if (verbose > 2) {
+		printf("lanplus_HMAC start mac=%x\n",mac);
+	}
 	if ((mac == IPMI_AUTH_RAKP_HMAC_SHA1) ||
 		(mac == IPMI_INTEGRITY_HMAC_SHA1_96))
 		evp_md = EVP_sha1();
@@ -179,15 +182,20 @@ lanplus_HMAC(uint8_t        mac,
 #ifdef HAVE_SHA256
 		evp_md = EVP_sha256();
 #else
+		printf("lanplus_HMAC: Invalid EVP_sha256 in lanplus_HMAC\n");
 		lprintf(LOG_ERR, "Invalid EVP_sha256 in lanplus_HMAC");
 		return NULL; // assert(0);
 #endif
 	} else {
+		printf("lanplus_HMAC: Invalid mac type 0x%x in lanplus_HMAC\n",mac);
 		lprintf(LOG_ERR,"Invalid mac type 0x%x in lanplus_HMAC",mac);
 		return NULL; // assert(0);
 	}
-	mlen = 20; /* *md_len is usually not initialized */
+	mlen = 20; /* md_len is usually not initialized, default IPMI_AUTHCODE_BUFFER_SIZE=20 */
 	pnew = HMAC(evp_md, key, key_len, d, n, md, &mlen);
+	if (verbose > 2) {
+		printf("lanplus_HMAC mac=%x, pnew=%p, mlen=%d",mac,pnew,mlen);
+	}
 	*md_len = (uint32_t)mlen;
 	return(pnew);
 }
@@ -244,7 +252,10 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
 	 * data is perfectly aligned. We would like to keep that from happening.
 	 * We have made a point to have our input perfectly padded.
 	 */
-	assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);
+	// assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);
+	if ((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) != 0) {
+		 os_assert("lanplus_encrypt_aes_cbc_128"); /**/
+	}
 	inlen = input_length;
 
 	if(!EVP_EncryptUpdate(pctx, output, &nwritten, input, inlen))
@@ -324,7 +335,10 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
 	 * data is perfectly aligned. We would like to keep that from happening.
 	 * We have made a point to have our input perfectly padded.
 	 */
-	assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);
+	// assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);
+	if ((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) != 0) {
+		 os_assert("lanplus_decrypt_aes_cbc_128"); /**/
+	}
 	inlen = input_length;
 
 	if (!EVP_DecryptUpdate(pctx, output, &nwritten, input, inlen))
-- 
cgit v1.2.3