Mercurial > pidgin
annotate libpurple/plugins/perl/common/Cipher.xs @ 23655:af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Technically some of these change the API, but in those couple cases, the way it
is now is either broken, not usable or pretty unlikely to be used. Feel free
to yell at me and/or revert this if you think this is unacceptable.
Fixes #5912
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Thu, 07 Aug 2008 02:48:21 +0000 |
parents | 2f8274ce570a |
children | 907f5f41e32a |
rev | line source |
---|---|
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 #include "module.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
2 |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
3 MODULE = Purple::Cipher PACKAGE = Purple::Cipher PREFIX = purple_cipher_ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
4 PROTOTYPES: ENABLE |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
5 |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
6 BOOT: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
7 { |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
8 HV *stash = gv_stashpv("Purple::Cipher::BatchMode", 1); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
9 HV *cipher_caps = gv_stashpv("Purple::Cipher::Caps", 1); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
10 |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
11 static const constiv *civ, const_iv[] = { |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
12 #define const_iv(name) {#name, (IV)PURPLE_CIPHER_BATCH_MODE_##name} |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
13 const_iv(ECB), |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
14 const_iv(CBC), |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
15 #undef const_iv |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
16 }; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
17 |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
18 static const constiv bm_const_iv[] = { |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
19 #define const_iv(name) {#name, (IV)PURPLE_CIPHER_CAPS_##name} |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
20 const_iv(SET_OPT), |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
21 const_iv(GET_OPT), |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
22 const_iv(INIT), |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
23 const_iv(RESET), |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
24 const_iv(UNINIT), |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
25 const_iv(SET_IV), |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
26 const_iv(APPEND), |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
27 const_iv(DIGEST), |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
28 const_iv(ENCRYPT), |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
29 const_iv(DECRYPT), |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
30 const_iv(SET_SALT), |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
31 const_iv(GET_SALT_SIZE), |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
32 const_iv(SET_KEY), |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
33 const_iv(GET_KEY_SIZE), |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
34 const_iv(SET_BATCH_MODE), |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
35 const_iv(GET_BATCH_MODE), |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
36 const_iv(GET_BLOCK_SIZE), |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
37 const_iv(SET_KEY_WITH_LEN), |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
38 const_iv(UNKNOWN), |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
39 #undef const_iv |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
40 }; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
41 |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
42 for (civ = const_iv + sizeof(const_iv) / sizeof(const_iv[0]); civ-- > const_iv; ) |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
43 newCONSTSUB(stash, (char *)civ->name, newSViv(civ->iv)); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
44 |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
45 for (civ = bm_const_iv + sizeof(bm_const_iv) / sizeof(bm_const_iv[0]); civ-- > bm_const_iv; ) |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
46 newCONSTSUB(cipher_caps, (char *)civ->name, newSViv(civ->iv)); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
47 } |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
48 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
49 const gchar * |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
50 purple_cipher_get_name(cipher) |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
51 Purple::Cipher cipher |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
52 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
53 guint |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
54 purple_cipher_get_capabilities(cipher) |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
55 Purple::Cipher cipher |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
56 |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
57 size_t |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
58 purple_cipher_digest_region(name, data_sv, in_len, digest) |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
59 const gchar *name |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
60 SV *data_sv |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
61 size_t in_len |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
62 SV *digest |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
63 PREINIT: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
64 gboolean ret; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
65 guchar *buff = NULL; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
66 guchar *data = NULL; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
67 size_t data_len; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
68 CODE: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
69 data = SvPV(data_sv, data_len); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
70 SvUPGRADE(digest, SVt_PV); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
71 buff = SvGROW(digest, in_len); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
72 ret = purple_cipher_digest_region(name, data, data_len, in_len, buff, &RETVAL); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
73 if(!ret) { |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
74 SvSetSV_nosteal(digest, &PL_sv_undef); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
75 XSRETURN_UNDEF; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
76 } |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
77 SvCUR_set(digest, RETVAL); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
78 SvPOK_only(digest); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
79 OUTPUT: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
80 RETVAL |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
81 |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
82 gchar_own* |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
83 purple_cipher_http_digest_calculate_response(algorithm, method, digest_uri, qop, entity, nonce, nonce_count, client_nonce, session_key) |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
84 const gchar* algorithm |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
85 const gchar* method |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
86 const gchar* digest_uri |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
87 const gchar* qop |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
88 const gchar* entity |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
89 const gchar* nonce |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
90 const gchar* nonce_count |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
91 const gchar* client_nonce |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
92 const gchar* session_key |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
93 |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
94 gchar_own* |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
95 purple_cipher_http_digest_calculate_session_key(algorithm, username, realm, password, nonce, client_nonce) |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
96 const gchar* algorithm |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
97 const gchar* username |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
98 const gchar* realm |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
99 const gchar* password |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
100 const gchar* nonce |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
101 const gchar* client_nonce |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
102 |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
103 MODULE = Purple::Cipher PACKAGE = Purple::Ciphers PREFIX = purple_ciphers_ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
104 PROTOTYPES: ENABLE |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
105 |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
106 Purple::Cipher |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
107 purple_ciphers_find_cipher(name) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
108 gchar * name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
109 |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
110 Purple::Cipher |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
111 purple_ciphers_register_cipher(name, ops) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
112 gchar * name |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
113 Purple::Cipher::Ops ops |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
114 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
115 gboolean |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
116 purple_ciphers_unregister_cipher(cipher) |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
117 Purple::Cipher cipher |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
118 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
119 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
120 purple_ciphers_get_ciphers() |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
121 PREINIT: |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
122 GList *l; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
123 PPCODE: |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
124 for (l = purple_ciphers_get_ciphers(); l != NULL; l = l->next) { |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
125 XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Cipher"))); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
126 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
127 |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
128 Purple::Handle |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
129 purple_ciphers_get_handle() |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
130 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
131 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
132 purple_ciphers_init() |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
133 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
134 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
135 purple_ciphers_uninit() |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
136 |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
137 MODULE = Purple::Cipher PACKAGE = Purple::Cipher::Context PREFIX = purple_cipher_context_ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
138 PROTOTYPES: ENABLE |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
139 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
140 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
141 purple_cipher_context_set_option(context, name, value) |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
142 Purple::Cipher::Context context |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
143 gchar *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
144 gpointer value |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
145 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
146 gpointer |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
147 purple_cipher_context_get_option(context, name) |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
148 Purple::Cipher::Context context |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
149 gchar *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
150 |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
151 Purple::Cipher::Context |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
152 purple_cipher_context_new(klass, cipher, extra = NULL) |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
153 Purple::Cipher cipher |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
154 void *extra |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
155 C_ARGS: cipher, extra |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
156 |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
157 Purple::Cipher::Context |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
158 purple_cipher_context_new_by_name(klass, name, extra = NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
159 gchar *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
160 void *extra |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
161 C_ARGS: name, extra |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
162 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
163 void |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
164 purple_cipher_context_reset(context, extra = NULL) |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
165 Purple::Cipher::Context context |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
166 gpointer extra |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
167 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
168 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
169 purple_cipher_context_destroy(context) |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
170 Purple::Cipher::Context context |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
171 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
172 void |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
173 purple_cipher_context_set_iv(Purple::Cipher::Context context, guchar *iv, size_t length(iv)) |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
174 PROTOTYPE: $$ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
175 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
176 void |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
177 purple_cipher_context_append(Purple::Cipher::Context context, guchar *data, size_t length(data)) |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
178 PROTOTYPE: $$ |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
179 |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
180 size_t |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
181 purple_cipher_context_digest(context, in_len, digest) |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
182 Purple::Cipher::Context context |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
183 size_t in_len |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
184 SV *digest |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
185 PREINIT: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
186 gboolean ret; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
187 guchar *buff = NULL; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
188 CODE: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
189 SvUPGRADE(digest, SVt_PV); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
190 buff = SvGROW(digest, in_len); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
191 ret = purple_cipher_context_digest(context, in_len, buff, &RETVAL); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
192 if(!ret) { |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
193 SvSetSV_nosteal(digest, &PL_sv_undef); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
194 XSRETURN_UNDEF; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
195 } |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
196 SvCUR_set(digest, RETVAL); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
197 SvPOK_only(digest); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
198 OUTPUT: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
199 RETVAL |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
200 |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
201 size_t |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
202 purple_cipher_context_digest_to_str(context, in_len, digest_s) |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
203 Purple::Cipher::Context context |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
204 size_t in_len |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
205 SV *digest_s |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
206 PREINIT: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
207 gboolean ret; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
208 gchar *buff = NULL; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
209 CODE: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
210 in_len += 1; /* perl shouldn't need to care about '\0' at the end */ |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
211 SvUPGRADE(digest_s, SVt_PV); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
212 buff = SvGROW(digest_s, in_len); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
213 ret = purple_cipher_context_digest_to_str(context, in_len, buff, &RETVAL); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
214 if(!ret) { |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
215 SvSetSV_nosteal(digest_s, &PL_sv_undef); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
216 XSRETURN_UNDEF; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
217 } |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
218 SvCUR_set(digest_s, RETVAL); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
219 SvPOK_only(digest_s); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
220 OUTPUT: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
221 RETVAL |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
222 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
223 gint |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
224 purple_cipher_context_encrypt(context, data_sv, output, OUTLIST size_t outlen) |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
225 Purple::Cipher::Context context |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
226 SV *data_sv |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
227 SV *output |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
228 PROTOTYPE: $$$ |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
229 PREINIT: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
230 size_t datalen; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
231 guchar *buff = NULL; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
232 guchar *data = NULL; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
233 CODE: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
234 data = SvPV(data_sv, datalen); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
235 SvUPGRADE(output, SVt_PV); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
236 buff = SvGROW(output, datalen); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
237 RETVAL = purple_cipher_context_encrypt(context, data, datalen, buff, &outlen); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
238 if(outlen != 0) { |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
239 SvPOK_only(output); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
240 SvCUR_set(output, outlen); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
241 } else { |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
242 SvSetSV_nosteal(output, &PL_sv_undef); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
243 } |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
244 OUTPUT: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
245 RETVAL |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
246 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
247 gint |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
248 purple_cipher_context_decrypt(context, data_sv, output, OUTLIST size_t outlen) |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
249 Purple::Cipher::Context context |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
250 SV *data_sv |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
251 SV *output |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
252 PROTOTYPE: $$$ |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
253 PREINIT: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
254 size_t datalen; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
255 guchar *buff = NULL; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
256 guchar *data = NULL; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
257 CODE: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
258 data = SvPV(data_sv, datalen); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
259 SvUPGRADE(output, SVt_PV); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
260 buff = SvGROW(output, datalen); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
261 RETVAL = purple_cipher_context_decrypt(context, data, datalen, buff, &outlen); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
262 if(outlen != 0) { |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
263 SvPOK_only(output); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
264 SvCUR_set(output, outlen); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
265 } else { |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
266 SvSetSV_nosteal(output, &PL_sv_undef); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
267 } |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
268 OUTPUT: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
269 RETVAL |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
270 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
271 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
272 purple_cipher_context_set_salt(context, salt) |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
273 Purple::Cipher::Context context |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
274 guchar *salt |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
275 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
276 size_t |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
277 purple_cipher_context_get_salt_size(context) |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
278 Purple::Cipher::Context context |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
279 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
280 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
281 purple_cipher_context_set_key(context, key) |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
282 Purple::Cipher::Context context |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
283 guchar *key |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
284 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
285 size_t |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
286 purple_cipher_context_get_key_size(context) |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
287 Purple::Cipher::Context context |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
288 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
289 void |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
290 purple_cipher_context_set_data(context, data) |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
291 Purple::Cipher::Context context |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
292 gpointer data |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
293 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
294 gpointer |
15833
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
295 purple_cipher_context_get_data(context) |
2f8274ce570a
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15373
diff
changeset
|
296 Purple::Cipher::Context context |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
297 |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
298 Purple::Cipher::BatchMode |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
299 purple_cipher_context_get_batch_mode(context) |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
300 Purple::Cipher::Context context |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
301 |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
302 size_t |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
303 purple_cipher_context_get_block_size(context) |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
304 Purple::Cipher::Context context |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
305 |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
306 void |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
307 purple_cipher_context_set_batch_mode(context, mode) |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
308 Purple::Cipher::Context context |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
309 Purple::Cipher::BatchMode mode |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
310 |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
311 void |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
312 purple_cipher_context_set_key_with_len(Purple::Cipher::Context context, guchar *key, size_t length(key)) |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
313 PROTOTYPE: $$ |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
314 |