aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/os
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-11-07 10:08:29 +0100
committermarha <marha@users.sourceforge.net>2012-11-07 10:08:29 +0100
commit74380c2fc1384a529df4f4995bddcf587fbac389 (patch)
tree0089fa6c54409e2a9515e0f530bf33e5f9561e29 /xorg-server/os
parent2c345c9da4dedfafe791557ca3fcf891ce26249d (diff)
parent1738a6973deb03f33a71c9527594727cb8bb64b4 (diff)
downloadvcxsrv-74380c2fc1384a529df4f4995bddcf587fbac389.tar.gz
vcxsrv-74380c2fc1384a529df4f4995bddcf587fbac389.tar.bz2
vcxsrv-74380c2fc1384a529df4f4995bddcf587fbac389.zip
Merge remote-tracking branch 'origin/released'
* origin/released: xserver mesa xkbcomp git update 7 nov 2012 Conflicts: mesalib/src/mapi/glapi/gen/glX_API.xml mesalib/src/mesa/main/.gitignore xkbcomp/listing.c xorg-server/hw/xwin/winshaddd.c xorg-server/hw/xwin/winshadddnl.c
Diffstat (limited to 'xorg-server/os')
-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>