aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/iq.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2007-11-23 23:07:44 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2007-11-23 23:07:44 +0000
commit77bfd077778c30c70f791752ce3a13d537aedd3b (patch)
treeb75b50003195e89c58ca3698a396c458d9ebea89 /protocols/jabber/iq.c
parentdf6d1da013f42caa5f11dbcbb0d54710682811f7 (diff)
Replaced GPL-incompatible SHA1 hashing code (and renamed the files in case
I ever need SHA256 ;-)).
Diffstat (limited to 'protocols/jabber/iq.c')
-rw-r--r--protocols/jabber/iq.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/protocols/jabber/iq.c b/protocols/jabber/iq.c
index 4738817a..40897639 100644
--- a/protocols/jabber/iq.c
+++ b/protocols/jabber/iq.c
@@ -22,6 +22,7 @@
\***************************************************************************/
#include "jabber.h"
+#include "sha1.h"
static xt_status jabber_parse_roster( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );
static xt_status jabber_iq_display_vcard( struct im_connection *ic, struct xt_node *node, struct xt_node *orig );
@@ -232,15 +233,15 @@ static xt_status jabber_do_iq_auth( struct im_connection *ic, struct xt_node *no
{
/* We can do digest authentication, it seems, and of
course we prefer that. */
- SHA_CTX sha;
+ sha1_state_t sha;
char hash_hex[41];
unsigned char hash[20];
int i;
- shaInit( &sha );
- shaUpdate( &sha, (unsigned char*) s, strlen( s ) );
- shaUpdate( &sha, (unsigned char*) ic->acc->pass, strlen( ic->acc->pass ) );
- shaFinal( &sha, hash );
+ sha1_init( &sha );
+ sha1_append( &sha, (unsigned char*) s, strlen( s ) );
+ sha1_append( &sha, (unsigned char*) ic->acc->pass, strlen( ic->acc->pass ) );
+ sha1_finish( &sha, hash );
for( i = 0; i < 20; i ++ )
sprintf( hash_hex + i * 2, "%02x", hash[i] );