[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#982705: openssh: FTBFS: sha2.h:57:16: error: redefinition of ‘struct _SHA2_CTX’



Hi,

On Sun, Feb 14, 2021 at 09:18:25AM +0100, Andreas Henriksson wrote:
> On Sun, Feb 14, 2021 at 08:32:58AM +0100, Andreas Henriksson wrote:
> > Hello,
> > 
> > On Sat, Feb 13, 2021 at 06:04:32PM +0100, Lucas Nussbaum wrote:
> > > Source: openssh
> > > Version: 1:8.4p1-3
> > > Severity: serious
> > > Justification: FTBFS on amd64
[...]

I'm attaching a patch (which can be droppen in debian/patches and
appended to series) that adds libmd checking to configure.ac and sets
the required defines to make the build pass.
It likely needs additional work, see FIXMEs. Consider this a PoC. Only
compile-tested (so might not actually work at runtime).
Someone who knows what the intended purpose of the existing code was and
has motivation to untangle the mess called autotools should work out a
real patch.

Also, the SHA*Update etc. implemented by openbsd-compat/sha2.* doesn't
seem to even be called anywhere, so maybe it can just be removed
instead?
If we want a debian-only patch it might be easier to just do:
AC_DEFINE([_SSHSHA2_H_], [1], [Disable openbsd-compat/sha2.h])

Someone should really discuss with whoever does the openbsd-compat stuff
how they see the situation and what they think is the best way to handle
this.

Regards,
Andreas Henriksson
Index: openssh-8.4p1/configure.ac
===================================================================
--- openssh-8.4p1.orig/configure.ac
+++ openssh-8.4p1/configure.ac
@@ -1973,6 +1973,20 @@ AC_CHECK_FUNCS([ \
 	warn \
 ])
 
+# FIXME: Possible redefinition of HAVE_SHA* if they where already found
+# in AC_CHECK_FUNCS above?
+# FIXME: This should add -lmd to LDFLAGS instead of relying on something
+# else to pull it in (or even better use pkg-config --{cflags,libs} libmd).
+AC_CHECK_LIB([md], [SHA256Update], [
+	      AC_DEFINE([HAVE_SHA256UPDATE], [1], [libmd has SHA256Update])
+	      ], [])
+AC_CHECK_LIB([md], [SHA384Update], [
+	      AC_DEFINE([HAVE_SHA384UPDATE], [1], [libmd has SHA384Update])
+	      ], [])
+AC_CHECK_LIB([md], [SHA512Update], [
+	      AC_DEFINE([HAVE_SHA512UPDATE], [1], [libmd has SHA512Update])
+	      ], [])
+
 AC_CHECK_DECLS([bzero, memmem])
 
 dnl Wide character support.

Reply to: