Wed, 07 May 2014 11:07:45 +0200
Merge release-2.x.y
| 11118 | 1 | #include "module.h" |
| 2 | ||
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
3 | MODULE = Purple::Cipher PACKAGE = Purple::Cipher PREFIX = purple_cipher_ |
| 11118 | 4 | PROTOTYPES: ENABLE |
| 5 | ||
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
6 | BOOT: |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
7 | { |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
8 | HV *stash = gv_stashpv("Purple::Cipher::BatchMode", 1); |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
9 | |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
10 | static const constiv *civ, const_iv[] = { |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
11 | #define const_iv(name) {#name, (IV)PURPLE_CIPHER_BATCH_MODE_##name} |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
12 | const_iv(ECB), |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
13 | const_iv(CBC), |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
14 | #undef const_iv |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
15 | }; |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
16 | |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
17 | for (civ = const_iv + sizeof(const_iv) / sizeof(const_iv[0]); civ-- > const_iv; ) |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
18 | newCONSTSUB(stash, (char *)civ->name, newSViv(civ->iv)); |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
19 | } |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
20 | |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
21 | gchar_own* |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
22 | purple_http_digest_calculate_response(algorithm, method, digest_uri, qop, entity, nonce, nonce_count, client_nonce, session_key) |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
23 | const gchar* algorithm |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
24 | const gchar* method |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
25 | const gchar* digest_uri |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
26 | const gchar* qop |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
27 | const gchar* entity |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
28 | const gchar* nonce |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
29 | const gchar* nonce_count |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
30 | const gchar* client_nonce |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
31 | const gchar* session_key |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
32 | |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
33 | gchar_own* |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
34 | purple_http_digest_calculate_session_key(algorithm, username, realm, password, nonce, client_nonce) |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
35 | const gchar* algorithm |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
36 | const gchar* username |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
37 | const gchar* realm |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
38 | const gchar* password |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
39 | const gchar* nonce |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
40 | const gchar* client_nonce |
| 11118 | 41 | |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
42 | void |
|
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
43 | purple_cipher_reset(cipher) |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
44 | Purple::Cipher cipher |
| 11118 | 45 | |
| 46 | void | |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
47 | purple_cipher_set_iv(Purple::Cipher cipher, guchar *iv, size_t length(iv)) |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
48 | PROTOTYPE: $$ |
| 11118 | 49 | |
| 12777 | 50 | void |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
51 | purple_cipher_append(Purple::Cipher cipher, guchar *data, size_t length(data)) |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
52 | PROTOTYPE: $$ |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
53 | |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
54 | gboolean |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
55 | purple_cipher_digest(cipher, digest) |
|
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
56 | Purple::Cipher cipher |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
57 | SV *digest |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
58 | PREINIT: |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
59 | guchar *buff = NULL; |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
60 | size_t digest_size; |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
61 | CODE: |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
62 | digest_size = purple_cipher_get_digest_size(cipher); |
|
34455
cdc53b913dd4
Clang warnings: gg prpl and perl's SvUPGRADE
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33912
diff
changeset
|
63 | SvUPGRADE_common(digest, SVt_PV); |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
64 | buff = (guchar *)SvGROW(digest, digest_size); |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
65 | if (purple_cipher_digest(cipher, buff, digest_size)) { |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
66 | SvCUR_set(digest, digest_size); |
| 36002 | 67 | /* coverity[extra_comma] */ |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
68 | SvPOK_only(digest); |
|
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
69 | RETVAL = 1; |
|
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
70 | } else { |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
71 | SvSetSV_nosteal(digest, &PL_sv_undef); |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
72 | RETVAL = 0; |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
73 | } |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
74 | OUTPUT: |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
75 | RETVAL |
| 11118 | 76 | |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
77 | gboolean |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
78 | purple_cipher_digest_to_str(cipher, digest_s) |
|
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
79 | Purple::Cipher cipher |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
80 | SV *digest_s |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
81 | PREINIT: |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
82 | gchar *buff = NULL; |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
83 | size_t digest_size, str_len; |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
84 | CODE: |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
85 | digest_size = purple_cipher_get_digest_size(cipher); |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
86 | str_len = 2 * digest_size; |
|
34455
cdc53b913dd4
Clang warnings: gg prpl and perl's SvUPGRADE
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33912
diff
changeset
|
87 | SvUPGRADE_common(digest_s, SVt_PV); |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
88 | buff = SvGROW(digest_s, str_len + 1); |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
89 | if (purple_cipher_digest_to_str(cipher, buff, str_len + 1)) { |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
90 | SvCUR_set(digest_s, str_len); |
| 36002 | 91 | /* coverity[extra_comma] */ |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
92 | SvPOK_only(digest_s); |
|
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
93 | RETVAL = 1; |
|
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
94 | } else { |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
95 | SvSetSV_nosteal(digest_s, &PL_sv_undef); |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
96 | RETVAL = 0; |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
97 | } |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
98 | OUTPUT: |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
99 | RETVAL |
| 11118 | 100 | |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
101 | gboolean |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
102 | purple_cipher_encrypt(cipher, input, output) |
|
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
103 | Purple::Cipher cipher |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
104 | SV *input |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
105 | SV *output |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
106 | PREINIT: |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
107 | size_t input_len, output_len; |
|
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
108 | ssize_t ret; |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
109 | guchar *buff = NULL; |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
110 | guchar *data = NULL; |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
111 | CODE: |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
112 | data = (guchar *)SvPV(input, input_len); |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
113 | output_len = input_len + purple_cipher_get_block_size(cipher); |
|
34455
cdc53b913dd4
Clang warnings: gg prpl and perl's SvUPGRADE
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33912
diff
changeset
|
114 | SvUPGRADE_common(output, SVt_PV); |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
115 | buff = (guchar *)SvGROW(output, output_len); |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
116 | ret = purple_cipher_encrypt(cipher, data, input_len, buff, output_len); |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
117 | if (ret >= 0) { |
|
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
118 | RETVAL = 1; |
|
36001
10ae4e6808e5
Silence perl coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
27158
diff
changeset
|
119 | /* coverity[extra_comma] */ |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
120 | SvPOK_only(output); |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
121 | SvCUR_set(output, ret); |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
122 | } else { |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
123 | RETVAL = 0; |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
124 | SvSetSV_nosteal(output, &PL_sv_undef); |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
125 | } |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
126 | OUTPUT: |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
127 | RETVAL |
| 11118 | 128 | |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
129 | gboolean |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
130 | purple_cipher_decrypt(cipher, input, output) |
|
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
131 | Purple::Cipher cipher |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
132 | SV *input |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
133 | SV *output |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
134 | PREINIT: |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
135 | size_t input_len, output_len; |
|
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
136 | ssize_t ret; |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
137 | guchar *buff = NULL; |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
138 | guchar *data = NULL; |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
139 | CODE: |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
140 | data = (guchar *)SvPV(input, input_len); |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
141 | output_len = input_len + purple_cipher_get_block_size(cipher); |
|
34455
cdc53b913dd4
Clang warnings: gg prpl and perl's SvUPGRADE
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33912
diff
changeset
|
142 | SvUPGRADE_common(output, SVt_PV); |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
143 | buff = (guchar *)SvGROW(output, output_len); |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
144 | ret = purple_cipher_decrypt(cipher, data, input_len, buff, output_len); |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
145 | if (ret >= 0) { |
|
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
146 | RETVAL = 1; |
|
36001
10ae4e6808e5
Silence perl coverity warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
27158
diff
changeset
|
147 | /* coverity[extra_comma] */ |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
148 | SvPOK_only(output); |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
149 | SvCUR_set(output, ret); |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
150 | } else { |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
151 | RETVAL = 0; |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
152 | SvSetSV_nosteal(output, &PL_sv_undef); |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
153 | } |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
154 | OUTPUT: |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
155 | RETVAL |
| 11118 | 156 | |
| 12777 | 157 | void |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
158 | purple_cipher_set_salt(cipher, salt, len) |
|
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
159 | Purple::Cipher cipher |
|
11183
be87fe695c93
[gaim-migrate @ 13295]
Mark Doliner <markdoliner@pidgin.im>
parents:
11130
diff
changeset
|
160 | guchar *salt |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
161 | size_t len |
| 11118 | 162 | |
| 12777 | 163 | void |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
164 | purple_cipher_set_key(cipher, key, len) |
|
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
165 | Purple::Cipher cipher |
|
11183
be87fe695c93
[gaim-migrate @ 13295]
Mark Doliner <markdoliner@pidgin.im>
parents:
11130
diff
changeset
|
166 | guchar *key |
|
33912
01e0d716a28e
ciphers cleanup: fix perl compilation; better purple_cipher_digest_region
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
27158
diff
changeset
|
167 | size_t len |
| 11118 | 168 | |
| 12777 | 169 | size_t |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
170 | purple_cipher_get_key_size(cipher) |
|
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
171 | Purple::Cipher cipher |
| 11118 | 172 | |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
173 | Purple::Cipher::BatchMode |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
174 | purple_cipher_get_batch_mode(cipher) |
|
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
175 | Purple::Cipher cipher |
| 11118 | 176 | |
| 12777 | 177 | size_t |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
178 | purple_cipher_get_block_size(cipher) |
|
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
179 | Purple::Cipher cipher |
| 11118 | 180 | |
| 12777 | 181 | void |
|
34552
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
182 | purple_cipher_set_batch_mode(cipher, mode) |
|
d39fc37af80a
Refactored libpurple/plugins/perl/common to use the GObject-based PurpleCipher
Ankit Vani <a@nevitus.org>
parents:
33912
diff
changeset
|
183 | Purple::Cipher cipher |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
184 | Purple::Cipher::BatchMode mode |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
185 | |
|
34606
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
186 | MODULE = Purple::Cipher PACKAGE = Purple::AESCipher PREFIX = purple_aes_cipher_ |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
187 | PROTOTYPES: ENABLE |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
188 | |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
189 | Purple::Cipher |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
190 | purple_aes_cipher_new() |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
191 | |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
192 | MODULE = Purple::Cipher PACKAGE = Purple::DES3Cipher PREFIX = purple_des3_cipher_ |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
193 | PROTOTYPES: ENABLE |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
194 | |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
195 | Purple::Cipher |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
196 | purple_des3_cipher_new() |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
197 | |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
198 | MODULE = Purple::Cipher PACKAGE = Purple::DESCipher PREFIX = purple_des_cipher_ |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
199 | PROTOTYPES: ENABLE |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
200 | |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
201 | Purple::Cipher |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
202 | purple_des_cipher_new() |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
203 | |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
204 | MODULE = Purple::Cipher PACKAGE = Purple::HMACCipher PREFIX = purple_hmac_cipher_ |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
205 | PROTOTYPES: ENABLE |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
206 | |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
207 | Purple::Cipher |
|
34607
d6983411079e
Added cipher includes, and hash argument to _new() of PurpleHMACCipher and PurplePBKDF2Cipher
Ankit Vani <a@nevitus.org>
parents:
34606
diff
changeset
|
208 | purple_hmac_cipher_new(hash) |
|
d6983411079e
Added cipher includes, and hash argument to _new() of PurpleHMACCipher and PurplePBKDF2Cipher
Ankit Vani <a@nevitus.org>
parents:
34606
diff
changeset
|
209 | Purple::Hash hash |
|
34606
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
210 | |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
211 | MODULE = Purple::Cipher PACKAGE = Purple::PBKDF2Cipher PREFIX = purple_pbkdf2_cipher_ |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
212 | PROTOTYPES: ENABLE |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
213 | |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
214 | Purple::Cipher |
|
34607
d6983411079e
Added cipher includes, and hash argument to _new() of PurpleHMACCipher and PurplePBKDF2Cipher
Ankit Vani <a@nevitus.org>
parents:
34606
diff
changeset
|
215 | purple_pbkdf2_cipher_new(hash) |
|
d6983411079e
Added cipher includes, and hash argument to _new() of PurpleHMACCipher and PurplePBKDF2Cipher
Ankit Vani <a@nevitus.org>
parents:
34606
diff
changeset
|
216 | Purple::Hash hash |
|
34606
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
217 | |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
218 | MODULE = Purple::Cipher PACKAGE = Purple::RC4Cipher PREFIX = purple_rc4_cipher_ |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
219 | PROTOTYPES: ENABLE |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
220 | |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
221 | Purple::Cipher |
|
bca53cda8ed5
Added ciphers and hashes _new functions to .xs files
Ankit Vani <a@nevitus.org>
parents:
34567
diff
changeset
|
222 | purple_rc4_cipher_new() |
|
35026
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
223 | |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
224 | MODULE = Purple::Cipher PACKAGE = Purple::Hash PREFIX = purple_hash_ |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
225 | PROTOTYPES: ENABLE |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
226 | |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
227 | gchar_own* |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
228 | purple_http_digest_calculate_response(algorithm, method, digest_uri, qop, entity, nonce, nonce_count, client_nonce, session_key) |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
229 | const gchar* algorithm |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
230 | const gchar* method |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
231 | const gchar* digest_uri |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
232 | const gchar* qop |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
233 | const gchar* entity |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
234 | const gchar* nonce |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
235 | const gchar* nonce_count |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
236 | const gchar* client_nonce |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
237 | const gchar* session_key |
| 11118 | 238 | |
|
35026
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
239 | gchar_own* |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
240 | purple_http_digest_calculate_session_key(algorithm, username, realm, password, nonce, client_nonce) |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
241 | const gchar* algorithm |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
242 | const gchar* username |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
243 | const gchar* realm |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
244 | const gchar* password |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
245 | const gchar* nonce |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
246 | const gchar* client_nonce |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
247 | |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
248 | void |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
249 | purple_hash_reset(hash) |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
250 | Purple::Hash hash |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
251 | |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
252 | void |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
253 | purple_hash_append(Purple::Hash hash, guchar *data, size_t length(data)) |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
254 | PROTOTYPE: $$ |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
255 | |
|
35026
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
256 | gboolean |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
257 | purple_hash_digest(hash, digest) |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
258 | Purple::Hash hash |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
259 | SV *digest |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
260 | PREINIT: |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
261 | guchar *buff = NULL; |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
262 | size_t digest_size; |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
263 | CODE: |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
264 | digest_size = purple_hash_get_digest_size(hash); |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
265 | SvUPGRADE_common(digest, SVt_PV); |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
266 | buff = (guchar *)SvGROW(digest, digest_size); |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
267 | if (purple_hash_digest(hash, buff, digest_size)) { |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
268 | SvCUR_set(digest, digest_size); |
| 36002 | 269 | /* coverity[extra_comma] */ |
|
35026
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
270 | SvPOK_only(digest); |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
271 | RETVAL = 1; |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
272 | } else { |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
273 | SvSetSV_nosteal(digest, &PL_sv_undef); |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
274 | RETVAL = 0; |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
275 | } |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
276 | OUTPUT: |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
277 | RETVAL |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
278 | |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
279 | gboolean |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
280 | purple_hash_digest_to_str(hash, digest_s) |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
281 | Purple::Hash hash |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
282 | SV *digest_s |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
283 | PREINIT: |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
284 | gchar *buff = NULL; |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
285 | size_t digest_size, str_len; |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
286 | CODE: |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
287 | digest_size = purple_hash_get_digest_size(hash); |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
288 | str_len = 2 * digest_size; |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
289 | SvUPGRADE_common(digest_s, SVt_PV); |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
290 | buff = SvGROW(digest_s, str_len + 1); |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
291 | if (purple_hash_digest_to_str(hash, buff, str_len + 1)) { |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
292 | SvCUR_set(digest_s, str_len); |
| 36002 | 293 | /* coverity[extra_comma] */ |
|
35026
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
294 | SvPOK_only(digest_s); |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
295 | RETVAL = 1; |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
296 | } else { |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
297 | SvSetSV_nosteal(digest_s, &PL_sv_undef); |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
298 | RETVAL = 0; |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
299 | } |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
300 | OUTPUT: |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
301 | RETVAL |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
302 | |
|
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
303 | size_t |
|
35026
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
304 | purple_hash_get_block_size(hash) |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
305 | Purple::Hash hash |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
306 | |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
307 | MODULE = Purple::Hash PACKAGE = Purple::MD4Hash PREFIX = purple_md4_hash_ |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
308 | PROTOTYPES: ENABLE |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
309 | |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
310 | Purple::Hash |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
311 | purple_md4_hash_new() |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
312 | |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
313 | MODULE = Purple::Hash PACKAGE = Purple::MD5Hash PREFIX = purple_md5_hash_ |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
314 | PROTOTYPES: ENABLE |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
315 | |
|
35026
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
316 | Purple::Hash |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
317 | purple_md5_hash_new() |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
318 | |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
319 | MODULE = Purple::Hash PACKAGE = Purple::SHA1Hash PREFIX = purple_sha1_hash_ |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
320 | PROTOTYPES: ENABLE |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
321 | |
|
35026
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
322 | Purple::Hash |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
323 | purple_sha1_hash_new() |
|
23982
204b6e71f403
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <datallah@pidgin.im>
parents:
15894
diff
changeset
|
324 | |
|
35026
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
325 | MODULE = Purple::Hash PACKAGE = Purple::SHA256Hash PREFIX = purple_sha256_hash_ |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
326 | PROTOTYPES: ENABLE |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
327 | |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
328 | Purple::Hash |
|
fde23518e1e5
Moved PurpleHash to cipher.[ch]
Ankit Vani <a@nevitus.org>
parents:
35001
diff
changeset
|
329 | purple_sha256_hash_new() |