Mercurial > pidgin
comparison libpurple/protocols/oscar/family_auth.c @ 15822:32c366eeeb99
sed -ie 's/gaim/purple/g'
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Mon, 19 Mar 2007 07:01:17 +0000 |
parents | 5fe8042783c1 |
children | 1927f4ead3ca c72295a65f7a |
comparison
equal
deleted
inserted
replaced
15821:84b0f9b23ede | 15822:32c366eeeb99 |
---|---|
1 /* | 1 /* |
2 * Gaim's oscar protocol plugin | 2 * Purple's oscar protocol plugin |
3 * This file is the legal property of its developers. | 3 * This file is the legal property of its developers. |
4 * Please see the AUTHORS file distributed alongside this file. | 4 * Please see the AUTHORS file distributed alongside this file. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Lesser General Public | 7 * modify it under the terms of the GNU Lesser General Public |
79 | 79 |
80 #ifdef USE_OLD_MD5 | 80 #ifdef USE_OLD_MD5 |
81 static int | 81 static int |
82 aim_encode_password_md5(const char *password, const char *key, guint8 *digest) | 82 aim_encode_password_md5(const char *password, const char *key, guint8 *digest) |
83 { | 83 { |
84 GaimCipher *cipher; | 84 PurpleCipher *cipher; |
85 GaimCipherContext *context; | 85 PurpleCipherContext *context; |
86 | 86 |
87 cipher = gaim_ciphers_find_cipher("md5"); | 87 cipher = purple_ciphers_find_cipher("md5"); |
88 | 88 |
89 context = gaim_cipher_context_new(cipher, NULL); | 89 context = purple_cipher_context_new(cipher, NULL); |
90 gaim_cipher_context_append(context, (const guchar *)key, strlen(key)); | 90 purple_cipher_context_append(context, (const guchar *)key, strlen(key)); |
91 gaim_cipher_context_append(context, (const guchar *)password, strlen(password)); | 91 purple_cipher_context_append(context, (const guchar *)password, strlen(password)); |
92 gaim_cipher_context_append(context, (const guchar *)AIM_MD5_STRING, strlen(AIM_MD5_STRING)); | 92 purple_cipher_context_append(context, (const guchar *)AIM_MD5_STRING, strlen(AIM_MD5_STRING)); |
93 gaim_cipher_context_digest(context, 16, digest, NULL); | 93 purple_cipher_context_digest(context, 16, digest, NULL); |
94 gaim_cipher_context_destroy(context); | 94 purple_cipher_context_destroy(context); |
95 | 95 |
96 return 0; | 96 return 0; |
97 } | 97 } |
98 #else | 98 #else |
99 static int | 99 static int |
100 aim_encode_password_md5(const char *password, const char *key, guint8 *digest) | 100 aim_encode_password_md5(const char *password, const char *key, guint8 *digest) |
101 { | 101 { |
102 GaimCipher *cipher; | 102 PurpleCipher *cipher; |
103 GaimCipherContext *context; | 103 PurpleCipherContext *context; |
104 guchar passdigest[16]; | 104 guchar passdigest[16]; |
105 | 105 |
106 cipher = gaim_ciphers_find_cipher("md5"); | 106 cipher = purple_ciphers_find_cipher("md5"); |
107 | 107 |
108 context = gaim_cipher_context_new(cipher, NULL); | 108 context = purple_cipher_context_new(cipher, NULL); |
109 gaim_cipher_context_append(context, (const guchar *)password, strlen(password)); | 109 purple_cipher_context_append(context, (const guchar *)password, strlen(password)); |
110 gaim_cipher_context_digest(context, 16, passdigest, NULL); | 110 purple_cipher_context_digest(context, 16, passdigest, NULL); |
111 gaim_cipher_context_destroy(context); | 111 purple_cipher_context_destroy(context); |
112 | 112 |
113 context = gaim_cipher_context_new(cipher, NULL); | 113 context = purple_cipher_context_new(cipher, NULL); |
114 gaim_cipher_context_append(context, (const guchar *)key, strlen(key)); | 114 purple_cipher_context_append(context, (const guchar *)key, strlen(key)); |
115 gaim_cipher_context_append(context, passdigest, 16); | 115 purple_cipher_context_append(context, passdigest, 16); |
116 gaim_cipher_context_append(context, (const guchar *)AIM_MD5_STRING, strlen(AIM_MD5_STRING)); | 116 purple_cipher_context_append(context, (const guchar *)AIM_MD5_STRING, strlen(AIM_MD5_STRING)); |
117 gaim_cipher_context_digest(context, 16, digest, NULL); | 117 purple_cipher_context_digest(context, 16, digest, NULL); |
118 gaim_cipher_context_destroy(context); | 118 purple_cipher_context_destroy(context); |
119 | 119 |
120 return 0; | 120 return 0; |
121 } | 121 } |
122 #endif | 122 #endif |
123 | 123 |