summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2009-10-28 10:54:13 -0700
committerKeith Packard <keithp@keithp.com>2009-10-28 10:54:13 -0700
commitdeb72fc61464250af8185dab2da8ee09f13c55d8 (patch)
tree476702f62c8b69bd5a52f4ba0f3df1897bbd65db /include
parent55f4c80a4c891b355a99e6a05978ca945397c5cc (diff)
parenta60e676f1fd243c78859440b87652f523d3f2ec1 (diff)
Merge remote branch 'jcristau/sha1'
Diffstat (limited to 'include')
-rw-r--r--include/Makefile.am3
-rw-r--r--include/dix-config.h.in5
-rw-r--r--include/xsha1.h19
3 files changed, 25 insertions, 2 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index aa5db7d5f..d684f9c2b 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -66,4 +66,5 @@ AM_CFLAGS = $(DIX_CFLAGS)
EXTRA_DIST = \
dix-config-apple-verbatim.h \
eventconvert.h eventstr.h \
- protocol-versions.h
+ protocol-versions.h \
+ xsha1.h
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 798d9e73c..7f1fb1836 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -160,9 +160,12 @@
/* Define to 1 if you have the <rpcsvc/dbm.h> header file. */
#undef HAVE_RPCSVC_DBM_H
-/* Define to use libmd SHA1 functions instead of OpenSSL libcrypto */
+/* Define to use libmd SHA1 functions */
#undef HAVE_SHA1_IN_LIBMD
+/* Define to use libgcrypt SHA1 functions */
+#undef HAVE_SHA1_IN_LIBGCRYPT
+
/* Define to 1 if you have the `shmctl64' function. */
#undef HAVE_SHMCTL64
diff --git a/include/xsha1.h b/include/xsha1.h
new file mode 100644
index 000000000..aab71067a
--- /dev/null
+++ b/include/xsha1.h
@@ -0,0 +1,19 @@
+#ifndef XSHA1_H
+#define XSHA1_H
+
+/* Initialize SHA1 computation. Returns NULL on error. */
+void *x_sha1_init(void);
+
+/*
+ * Add some data to be hashed. ctx is the value returned by x_sha1_init()
+ * Returns 0 on error, 1 on success.
+ */
+int x_sha1_update(void *ctx, void *data, int size);
+
+/*
+ * Place the hash in result, and free ctx.
+ * Returns 0 on error, 1 on success.
+ */
+int x_sha1_final(void *ctx, unsigned char result[20]);
+
+#endif