aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/os/xsha1.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-11-07 07:53:41 +0100
committermarha <marha@users.sourceforge.net>2012-11-07 07:53:41 +0100
commit1738a6973deb03f33a71c9527594727cb8bb64b4 (patch)
tree813603d381b5536ef7a1e2ffd3a137c4bc0623f7 /xorg-server/os/xsha1.c
parent1cc98f5a48924d750fbef7ea6b05a1ba49c28589 (diff)
downloadvcxsrv-1738a6973deb03f33a71c9527594727cb8bb64b4.tar.gz
vcxsrv-1738a6973deb03f33a71c9527594727cb8bb64b4.tar.bz2
vcxsrv-1738a6973deb03f33a71c9527594727cb8bb64b4.zip
xserver mesa xkbcomp git update 7 nov 2012
xserver: 011f8458805e443ac9130865d2840a929a00cabf xkbcomp: bd1103ef3cfef9cfed645566f944a69e7ca568b4 mesa: f42518962a08ce927e4ddd233d19d2661e135834
Diffstat (limited to 'xorg-server/os/xsha1.c')
-rw-r--r--xorg-server/os/xsha1.c30
1 files changed, 30 insertions, 0 deletions
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>