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
This commit is contained in:
Joshua Colp
2012-06-02 21:13:36 +00:00
parent 91a20ee2f9
commit 380c7c5c39
5 changed files with 973 additions and 0 deletions

View File

@@ -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)
{