From 77bfd077778c30c70f791752ce3a13d537aedd3b Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Fri, 23 Nov 2007 23:07:44 +0000 Subject: Replaced GPL-incompatible SHA1 hashing code (and renamed the files in case I ever need SHA256 ;-)). --- protocols/jabber/iq.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'protocols/jabber') 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] ); -- cgit v1.2.3