[PATCH] os: Add libnettle as a choice of SHA1 implementation

2012-10-30 Thread Yaakov (Cygwin/X)
From: Yaakov Selkowitz yselkow...@users.sourceforge.net

libnettle is smaller than libgcrypt, currently being released more
frequently, and has replaced the latter in gnutls-3.x (which is used
by TigerVNC, so they can avoid pulling in two crypto libraries
simultaneously).

Signed-off-by: Yaakov Selkowitz yselkow...@users.sourceforge.net
---
 configure.ac|   14 +-
 include/dix-config.h.in |3 +++
 os/xsha1.c  |   30 ++
 3 files changed, 46 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index e686614..758c4b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1360,7 +1360,7 @@ CORE_INCS='-I$(top_srcdir)/include 
-I$(top_builddir)/include'
 
 # SHA1 hashing
 AC_ARG_WITH([sha1],
-
[AS_HELP_STRING([--with-sha1=libc|libmd|libgcrypt|libcrypto|libsha1|CommonCrypto|CryptoAPI],
+
[AS_HELP_STRING([--with-sha1=libc|libmd|libnettle|libgcrypt|libcrypto|libsha1|CommonCrypto|CryptoAPI],
 [choose SHA1 implementation])])
 AC_CHECK_FUNC([SHA1Init], [HAVE_SHA1_IN_LIBC=yes])
 if test x$with_sha1 = x  test x$HAVE_SHA1_IN_LIBC = xyes; then
@@ -1423,6 +1423,18 @@ if test x$with_sha1 = xlibsha1; then
  [Use libsha1 for SHA1])
SHA1_LIBS=-lsha1
 fi
+AC_CHECK_LIB([nettle], [nettle_sha1_init], [HAVE_LIBNETTLE=yes])
+if test x$with_sha1 = x  test x$HAVE_LIBNETTLE = xyes; then
+   with_sha1=libnettle
+fi
+if test x$with_sha1 = xlibnettle  test x$HAVE_LIBNETTLE != xyes; then
+   AC_MSG_ERROR([libnettle requested but not found])
+fi
+if test x$with_sha1 = xlibnettle; then
+   AC_DEFINE([HAVE_SHA1_IN_LIBNETTLE], [1],
+ [Use libnettle SHA1 functions])
+   SHA1_LIBS=-lnettle
+fi
 AC_CHECK_LIB([gcrypt], [gcry_md_open], [HAVE_LIBGCRYPT=yes])
 if test x$with_sha1 = x  test x$HAVE_LIBGCRYPT = xyes; then
with_sha1=libgcrypt
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 578f249..b270a32 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -157,6 +157,9 @@
 /* Define to use libgcrypt SHA1 functions */
 #undef HAVE_SHA1_IN_LIBGCRYPT
 
+/* Define to use libnettle SHA1 functions */
+#undef HAVE_SHA1_IN_LIBNETTLE
+
 /* Define to use libsha1 for SHA1 */
 #undef HAVE_SHA1_IN_LIBSHA1
 
diff --git a/os/xsha1.c b/os/xsha1.c
index fa66c7a..24c0aa2 100644
--- a/os/xsha1.c
+++ b/os/xsha1.c
@@ -116,6 +116,36 @@ x_sha1_final(void *ctx, unsigned char result[20])
 return 1;
 }
 
+#elif defined(HAVE_SHA1_IN_LIBNETTLE)   /* Use libnettle for SHA1 */
+
+#include nettle/sha.h
+
+void *
+x_sha1_init(void)
+{
+struct sha1_ctx *ctx = malloc(sizeof(*ctx));
+
+if (!ctx)
+return NULL;
+sha1_init(ctx);
+return ctx;
+}
+
+int
+x_sha1_update(void *ctx, void *data, int size)
+{
+sha1_update(ctx, size, data);
+return 1;
+}
+
+int
+x_sha1_final(void *ctx, unsigned char result[20])
+{
+sha1_digest(ctx, 20, result);
+free(ctx);
+return 1;
+}
+
 #elif defined(HAVE_SHA1_IN_LIBGCRYPT)   /* Use libgcrypt for SHA1 */
 
 #include gcrypt.h
-- 
1.7.9

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


[PULL] input fixes 30.10.2012

2012-10-30 Thread Peter Hutterer
Thomas pointed out that the fix for 55738 may cause another bug, but I
suspect it merely uncovers that other bug. So the patch is included here
nonetheless.

The following changes since commit 53830281b4da096f9c13107d73ec9c76ff1d14cc:

  Merge remote-tracking branch 'sandmann/for-keithp' (2012-10-26 18:04:34 -0700)

are available in the git repository at:


  git://people.freedesktop.org/~whot/xserver for-keith

for you to fetch changes up to d511a3016a79c50cb38e7504d4831a9ae128e422:

  Add missing labels for multitouch valuators (2012-10-30 15:11:10 +1000)


Benjamin Tissoires (1):
  Add missing labels for multitouch valuators

Carlos Garnacho (1):
  Sync TouchListener memory allocation with population in 
TouchSetupListeners()

Peter Hutterer (5):
  xkb: ProcesssPointerEvent must work on the VCP if it gets the VCP
  Xi: set xChangeDeviceControlReply.status to Success by default
  Xi: don't deliver TouchEnd to a client waiting for TouchBegin (#55738)
  dix: fix zaphod screen scrossing (#54654)
  xfree86: remove unused variable sigstate

 Xi/chgdctl.c   | 3 ++-
 Xi/exevents.c  | 5 +
 Xi/xiproperty.c| 3 +++
 dix/getevents.c| 5 +++--
 dix/touch.c| 4 ++--
 hw/xfree86/common/xf86Events.c | 2 +-
 include/xserver-properties.h   | 3 +++
 xkb/xkbAccessX.c   | 2 +-
 8 files changed, 20 insertions(+), 7 deletions(-)


pgpO2OEAmmzrA.pgp
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH proto/x11proto] Adjust windows.h wrapping to work with MinGW-w64 headers as well

2012-10-30 Thread Colin Harrison
Hi,

http://lists.x.org/archives/xorg-devel/2012-October/034096.html

works for me (MinGW 32-bit) for both Xwinsock.h and Xwindows.h

Reviewed-by:  Colin Harrison colin.harrison at virgin.net

Thanks,
Colin Harrison



___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH app/xdpyinfo] Include Xwindows.h on WIN32 to avoid type clashes

2012-10-30 Thread Jon TURNEY
On 29/10/2012 13:57, walter harms wrote:
 
 
 Am 29.10.2012 14:38, schrieb Jon TURNEY:
 Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk
 ---
  xdpyinfo.c |4 
  1 files changed, 4 insertions(+), 0 deletions(-)

 diff --git a/xdpyinfo.c b/xdpyinfo.c
 index dcca0ad..2482156 100644
 --- a/xdpyinfo.c
 +++ b/xdpyinfo.c
 @@ -78,6 +78,10 @@ in this Software without prior written authorization from 
 The Open Group.
  
  #endif
  
 +#ifdef WIN32
 +#include X11/Xwindows.h
 +#endif
 +
 
 would it hurt to include that with other architecture also ?
 
 re,
  wh

I'm not sure I understand the question.

X11/Xwindows.h is a wrapper for windows.h, the Windows-specific header file
which declares the Windows API, which avoids conflicts between that header and
X headers.

It doesn't make much sense to try to include it on other platforms.

In this specific case, including XWindows.h first avoids conflicting type
definitions between windows.h (which is otherwise included unwrapped by xcb.h)
and Xproto.h

   CC xdpyinfo.o
 In file included from /jhbuild/install-mingw/include/X11/Xproto.h:72:0,
  from /jhbuild/checkout/xorg/app/xdpyinfo/xdpyinfo.c:89:
 /jhbuild/install-mingw/include/X11/Xmd.h:122:14: error: conflicting types for 
 ‘INT32’
 /usr/i686-pc-mingw32/sys-root/mingw/include/basetsd.h:54:13: note: previous 
 declaration of ‘INT32’ was here
 /jhbuild/install-mingw/include/X11/Xmd.h:145:15: error: conflicting types for 
 ‘BOOL’
 /usr/i686-pc-mingw32/sys-root/mingw/include/windef.h:234:17: note: previous 
 declaration of ‘BOOL’ was here

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH libxkbcommon 2/2] build: Require xorg macros 1.16

2012-10-30 Thread Ran Benita
On Fri, Oct 26, 2012 at 12:51:56AM +0100, Damien Lespiau wrote:
 From: Damien Lespiau damien.lesp...@intel.com
 
 For XORG_TESTSET_CFLAG and XORG_MEMORY_CHECK_FLAGS.

Thanks, I will take both patches through my tree so they won't get lost.

Ran

 Signed-off-by: Damien Lespiau damien.lesp...@intel.com
 Cc: Daniel Stone dan...@fooishbar.org
 ---
  configure.ac |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/configure.ac b/configure.ac
 index eda593c..ebefbd9 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -41,7 +41,7 @@ LT_INIT
  # Require xorg-macros minimum of 1.8 for AM_SILENT_RULES
  m4_ifndef([XORG_MACROS_VERSION],
 [m4_fatal([must install xorg-macros 1.8 or later before running 
 autoconf/autogen])])
 -XORG_MACROS_VERSION(1.8)
 +XORG_MACROS_VERSION(1.16)
  XORG_DEFAULT_OPTIONS
  XORG_MEMORY_CHECK_FLAGS
  XORG_ENABLE_DOCS
 -- 
 1.7.7.5
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PULL 1.13] A few small fixes

2012-10-30 Thread Matt Dew

Jon,

  Ack'd.


Matt


On 10/16/2012 08:27 AM, Jon TURNEY wrote:

On 11/10/2012 17:37, Keith Packard wrote:

Jon TURNEY writes:


Jon TURNEY (4):
   Correct description of -displayfd option in man page.
   hw/xwin: Only add GLX extension once.
   Fix compilation of Xorg DDX without XF86VIDMODE
   Fix 'make distcheck' for hw/xwin


Merged.
4b7f003..a69429a  master - master

Make sure you let Matt know which of these you'd like to see in a 1.13
stable update.



The following changes since commit f0bad69edd57facd6cffde8cb0863d1a735e2492:

   Version bumped to 1.13 (2012-09-05 14:45:08 -0700)

are available in the git repository at:

   git://people.freedesktop.org/~jturney/xserver server-1.13-branch

for you to fetch changes up to 0456d56092e7617131c77b50a7e7f501e6d9d275:

   Fix 'make distcheck' for hw/xwin (2012-10-16 15:14:55 +0100)


Jon TURNEY (4):
   Correct description of -displayfd option in man page.
   hw/xwin: Only add GLX extension once.
   Fix compilation of Xorg DDX without XF86VIDMODE
   Fix 'make distcheck' for hw/xwin

  hw/xfree86/common/Makefile.am |3 ++-
  hw/xwin/InitOutput.c  |5 +++--
  hw/xwin/Makefile.am   |3 +++
  hw/xwin/glx/Makefile.am   |3 ++-
  man/Xserver.man   |2 +-
  5 files changed, 11 insertions(+), 5 deletions(-)



___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: MinGW build fixes for various applications

2012-10-30 Thread Yaakov (Cygwin/X)
On Mon, 2012-10-29 at 13:38 +, Jon TURNEY wrote:
 MinGW build fixes for some applications which are relatively simple to fix.
 
 xauth:
 
 Jon TURNEY (1):
   Include Xwinsock.h rather than sys/socket.h on WIN32
 
 xdpyinfo:
 
 Jon TURNEY (1):
   Include Xwindows.h on WIN32 to avoid type clashes
 
 xkbcomp:
 
 Ryan Pavlik (1):
   Include Xwindows.h rather than windows.h
 
 xmodmap:
 
 Jon TURNEY (1):
   Include X11/Xwindows.h on WIN32
 
 xrdb:
 
 Jon TURNEY (1):
   Fix build with WIN32 defined, but PATHETICCPP not defined
 
 xset:
 
 Jon TURNEY (1):
   Remove unneeded include of windows.h on WIN32

For the series:

Reviewed-by: Yaakov Selkowitz yselkow...@users.sourceforge.net


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel