sha1: added prefix crypto_ to SHA1 API

sha1.c contains symbols that overlap with libcrypto. This patch
fixes linking with libstrophe as static library.

Prefix crypto_ will help to group other crypto API in the future.
This commit is contained in:
Dmitry Podgorny
2015-10-09 11:29:52 +03:00
parent 3b55c20879
commit f326c2f42f
5 changed files with 56 additions and 51 deletions

View File

@@ -1165,10 +1165,11 @@ int _handle_component_auth(xmpp_conn_t * const conn)
/* Feed the session id and passphrase to the algorithm.
* We need to compute SHA1(session_id + passphrase)
*/
SHA1_Init(&mdctx);
SHA1_Update(&mdctx, (uint8_t*)conn->stream_id, strlen(conn->stream_id));
SHA1_Update(&mdctx, (uint8_t*)conn->pass, strlen(conn->pass));
SHA1_Final(&mdctx, md_value);
crypto_SHA1_Init(&mdctx);
crypto_SHA1_Update(&mdctx, (uint8_t*)conn->stream_id,
strlen(conn->stream_id));
crypto_SHA1_Update(&mdctx, (uint8_t*)conn->pass, strlen(conn->pass));
crypto_SHA1_Final(&mdctx, md_value);
digest = xmpp_alloc(conn->ctx, 2*sizeof(md_value)+1);
if (digest) {