]> git.pld-linux.org Git - packages/xorg-xserver-server.git/blobdiff - xorg-xserver-server-builtin-SHA1.patch
- rel 3; use pixman glyph
[packages/xorg-xserver-server.git] / xorg-xserver-server-builtin-SHA1.patch
index 9e2a37893fd3f48df447cbb7b8eae34cebe8a357..1baf8aaec0259f5b37afd62be1ecb08ea32fc455 100644 (file)
@@ -52,7 +52,7 @@ diff --git a/include/dix-config.h.in b/include/dix-config.h.in
 index 058c8fd..d6e99a5 100644
 --- a/include/dix-config.h.in
 +++ b/include/dix-config.h.in
-@@ -160,21 +160,6 @@
+@@ -142,24 +142,6 @@
  /* Define to 1 if you have the <rpcsvc/dbm.h> header file. */
  #undef HAVE_RPCSVC_DBM_H
  
@@ -62,6 +62,9 @@ index 058c8fd..d6e99a5 100644
 -/* Define to use CommonCrypto SHA1 functions */
 -#undef HAVE_SHA1_IN_COMMONCRYPTO
 -
+-/* Define to use CryptoAPI SHA1 functions */
+-#undef HAVE_SHA1_IN_CRYPTOAPI
+-
 -/* Define to use libmd SHA1 functions */
 -#undef HAVE_SHA1_IN_LIBMD
 -
@@ -88,7 +91,7 @@ index 66a4a0f..b8c1636 100644
        $(XORG_SRCS)
 --- a/os/xsha1.c       2012-03-30 04:57:28.000000000 +0200
 +++ /dev/null  2011-06-01 08:46:43.490033582 +0200
-@@ -1,195 +0,0 @@
+@@ -1,237 +0,0 @@
 -#ifdef HAVE_DIX_CONFIG_H
 -#include <dix-config.h>
 -#endif
@@ -165,6 +168,48 @@ index 66a4a0f..b8c1636 100644
 -    return 1;
 -}
 -
+-#elif defined(HAVE_SHA1_IN_CRYPTOAPI)        /* Use CryptoAPI for SHA1 */
+-
+-#define WIN32_LEAN_AND_MEAN
+-#include <X11/Xwindows.h>
+-#include <wincrypt.h>
+-
+-static HCRYPTPROV hProv;
+-
+-void *
+-x_sha1_init(void)
+-{
+-    HCRYPTHASH *ctx = malloc(sizeof(*ctx));
+-
+-    if (!ctx)
+-        return NULL;
+-    CryptAcquireContext(&hProv, NULL, MS_DEF_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
+-    CryptCreateHash(hProv, CALG_SHA1, 0, 0, ctx);
+-    return ctx;
+-}
+-
+-int
+-x_sha1_update(void *ctx, void *data, int size)
+-{
+-    HCRYPTHASH *hHash = ctx;
+-
+-    CryptHashData(*hHash, data, size, 0);
+-    return 1;
+-}
+-
+-int
+-x_sha1_final(void *ctx, unsigned char result[20])
+-{
+-    HCRYPTHASH *hHash = ctx;
+-    DWORD len = 20;
+-
+-    CryptGetHashParam(*hHash, HP_HASHVAL, result, &len, 0);
+-    CryptDestroyHash(*hHash);
+-    CryptReleaseContext(hProv, 0);
+-    free(ctx);
+-    return 1;
+-}
+-
 -#elif defined(HAVE_SHA1_IN_LIBGCRYPT)   /* Use libgcrypt for SHA1 */
 -
 -#include <gcrypt.h>
@@ -603,13 +648,13 @@ index 0000000..ace7d97
  else
    DIX_LIB='$(top_builddir)/dix/libdix.la'
    OS_LIB='$(top_builddir)/os/libos.la'
-@@ -1358,99 +1358,6 @@
- MIEXT_SHADOW_LIB='$(top_builddir)/miext/shadow/libshadow.la'
+@@ -1358,112 +1358,6 @@
+ MIEXT_SYNC_LIB='$(top_builddir)/miext/sync/libsync.la'
  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],
+-            [AS_HELP_STRING([--with-sha1=libc|libmd|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
@@ -635,6 +680,19 @@ index 0000000..ace7d97
 -              [Use CommonCrypto SHA1 functions])
 -      SHA1_LIBS=""
 -fi
+-dnl stdcall functions cannot be tested with AC_CHECK_LIB
+-AC_CHECK_HEADER([wincrypt.h], [HAVE_SHA1_IN_CRYPTOAPI=yes], [], [#include <windows.h>])
+-if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_CRYPTOAPI" = xyes; then
+-      with_sha1=CryptoAPI
+-fi
+-if test "x$with_sha1" = xCryptoAPI && test "x$HAVE_SHA1_IN_CRYPTOAPI" != xyes; then
+-      AC_MSG_ERROR([CryptoAPI requested but not found])
+-fi
+-if test "x$with_sha1" = xCryptoAPI; then
+-      AC_DEFINE([HAVE_SHA1_IN_CRYPTOAPI], [1],
+-              [Use CryptoAPI SHA1 functions])
+-      SHA1_LIBS=""
+-fi
 -AC_CHECK_LIB([md], [SHA1Init], [HAVE_LIBMD=yes])
 -if test "x$with_sha1" = x && test "x$HAVE_LIBMD" = xyes; then
 -      with_sha1=libmd
@@ -702,3 +760,5 @@ index 0000000..ace7d97
 -
  PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS])
  PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])
+
This page took 0.061801 seconds and 4 git commands to generate.