From 1738a6973deb03f33a71c9527594727cb8bb64b4 Mon Sep 17 00:00:00 2001
From: marha <marha@users.sourceforge.net>
Date: Wed, 7 Nov 2012 07:53:41 +0100
Subject: xserver mesa xkbcomp git update 7 nov 2012

xserver: 011f8458805e443ac9130865d2840a929a00cabf
xkbcomp: bd1103ef3cfef9cfed645566f944a69e7ca568b4
mesa: f42518962a08ce927e4ddd233d19d2661e135834
---
 xorg-server/os/xsha1.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

(limited to 'xorg-server/os')

diff --git a/xorg-server/os/xsha1.c b/xorg-server/os/xsha1.c
index fa66c7a06..24c0aa284 100644
--- a/xorg-server/os/xsha1.c
+++ b/xorg-server/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>
-- 
cgit v1.2.3