summaryrefslogtreecommitdiff
path: root/main/utils.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2012-06-02 21:13:36 +0000
committerJoshua Colp <jcolp@digium.com>2012-06-02 21:13:36 +0000
commit380c7c5c39b9a0879d90df99196c06d01a70dd92 (patch)
tree13c88e100b85d908c21861746dafe5c48cdc5994 /main/utils.c
parent91a20ee2f95e2eb8f080bb90568459659960d726 (diff)
Add res_http_websocket module which implements the WebSocket protocol according to RFC 6455.
Review: https://reviewboard.asterisk.org/r/1952/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368359 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/utils.c')
-rw-r--r--main/utils.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/main/utils.c b/main/utils.c
index 379a17995..9bdf74f19 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -270,6 +270,18 @@ void ast_sha1_hash(char *output, const char *input)
ptr += sprintf(ptr, "%2.2x", Message_Digest[x]);
}
+/*! \brief Produce a 20 byte SHA1 hash of value. */
+void ast_sha1_hash_uint(uint8_t *digest, const char *input)
+{
+ struct SHA1Context sha;
+
+ SHA1Reset(&sha);
+
+ SHA1Input(&sha, (const unsigned char *) input, strlen(input));
+
+ SHA1Result(&sha, digest);
+}
+
/*! \brief decode BASE64 encoded text */
int ast_base64decode(unsigned char *dst, const char *src, int max)
{