libpurple/protocols/qq/qq_crypt.c

changeset 28502
43d342af25d4
parent 28345
57a838c454b0
child 31294
73607ab89c6f
equal deleted inserted replaced
28499:57dd0993c647 28502:43d342af25d4
169 plain32[0] = crypted32[0] ^ c32_prev[0]; plain32[1] = crypted32[1] ^ c32_prev[1]; 169 plain32[0] = crypted32[0] ^ c32_prev[0]; plain32[1] = crypted32[1] ^ c32_prev[1];
170 } 170 }
171 } 171 }
172 } 172 }
173 173
174 /* length of crypted buffer must be plain_len + 16*/ 174 /* length of crypted buffer must be plain_len + 17*/
175 /*
176 * The above comment used to say "plain_len + 16", but based on the
177 * behavior of the function that is wrong. If you give this function
178 * a plain string with len%8 = 7 then the returned length is len+17
179 */
175 gint qq_encrypt(guint8* crypted, const guint8* const plain, const gint plain_len, const guint8* const key) 180 gint qq_encrypt(guint8* crypted, const guint8* const plain, const gint plain_len, const guint8* const key)
176 { 181 {
177 guint8 *crypted_ptr = crypted; /* current position of dest */ 182 guint8 *crypted_ptr = crypted; /* current position of dest */
178 gint pos, padding; 183 gint pos, padding;
179 184

mercurial