Mercurial > pidgin.yaz
comparison libpurple/protocols/jabber/jutil.c @ 30032:e3eda7aa0653
jabber: Use a 129 byte buffer to fit the hex output of SHA-512 (including \0)
(I believe purple_cipher_digest_to_str should check the input length).
Maybe we should add way for ciphers to report the digest length...
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Mon, 22 Mar 2010 22:23:35 +0000 |
parents | 9f59abd49def |
children | 738741a7a692 |
comparison
equal
deleted
inserted
replaced
30031:9f59abd49def | 30032:e3eda7aa0653 |
---|---|
731 char * | 731 char * |
732 jabber_calculate_data_hash(gconstpointer data, size_t len, | 732 jabber_calculate_data_hash(gconstpointer data, size_t len, |
733 const gchar *hash_algo) | 733 const gchar *hash_algo) |
734 { | 734 { |
735 PurpleCipherContext *context; | 735 PurpleCipherContext *context; |
736 static gchar digest[41]; | 736 static gchar digest[129]; /* 512 bits hex + \0 */ |
737 | 737 |
738 context = purple_cipher_context_new_by_name(hash_algo, NULL); | 738 context = purple_cipher_context_new_by_name(hash_algo, NULL); |
739 if (context == NULL) | 739 if (context == NULL) |
740 { | 740 { |
741 purple_debug_error("jabber", "Could not find %s cipher\n", hash_algo); | 741 purple_debug_error("jabber", "Could not find %s cipher\n", hash_algo); |