summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Green <andy@warmcat.com>2011-03-07 20:47:41 +0000
committerAndy Green <andy@warmcat.com>2011-03-07 20:47:41 +0000
commit2836c641cf6b46f9ef1ab119e0b8c8f653a2cde8 (patch)
treed37d7abb21d08c758945664f6cfca8ce8d418585
parent8acc194dc2db00f93b41a49f1b398f0ad59e0848 (diff)
expose SHA1 api
Signed-off-by: Andy Green <andy@warmcat.com>
-rw-r--r--lib/libwebsockets.c6
-rw-r--r--lib/libwebsockets.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c
index 2ce43fb..0775fad 100644
--- a/lib/libwebsockets.c
+++ b/lib/libwebsockets.c
@@ -427,6 +427,12 @@ int libwebsockets_get_random(struct libwebsocket_context *context,
return n;
}
+unsigned char *
+libwebsockets_SHA1(const unsigned char *d, size_t n, unsigned char *md)
+{
+ return SHA1(d, n, md);
+}
+
void libwebsockets_00_spaceout(char *key, int spaces, int seed)
{
char *p;
diff --git a/lib/libwebsockets.h b/lib/libwebsockets.h
index b9eca98..ec55ec8 100644
--- a/lib/libwebsockets.h
+++ b/lib/libwebsockets.h
@@ -640,6 +640,9 @@ extern int
libwebsockets_get_random(struct libwebsocket_context *context,
void *buf, int len);
+extern unsigned char *
+libwebsockets_SHA1(const unsigned char *d, size_t n, unsigned char *md);
+
extern struct libwebsocket_extension libwebsocket_internal_extensions[];
#ifdef WIN32