Mercurial > pidgin
annotate libpurple/plugins/perl/common/Cipher.xs @ 32819:2c6510167895 default tip
propagate from branch 'im.pidgin.pidgin.2.x.y' (head 3315c5dfbd0ad16511bdcf865e5b07c02d07df24)
to branch 'im.pidgin.pidgin' (head cbd1eda6bcbf0565ae7766396bb8f6f419cb6a9a)
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Sat, 02 Jun 2012 02:30:49 +0000 |
parents | 31f65046b92d |
children |
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: |
26935
31f65046b92d
Various perl warning fixes as well as real fixes to gconstpointer functions
Paul Aurich <paul@darkrain42.org>
parents:
23656
diff
changeset
|
69 data = (guchar *)SvPV(data_sv, data_len); |
23655
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); |
26935
31f65046b92d
Various perl warning fixes as well as real fixes to gconstpointer functions
Paul Aurich <paul@darkrain42.org>
parents:
23656
diff
changeset
|
71 buff = (guchar *)SvGROW(digest, in_len); |
23655
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 |
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
|
131 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
|
132 PROTOTYPES: ENABLE |
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_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
|
136 Purple::Cipher::Context context |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
137 gchar *name |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
138 gpointer value |
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 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
|
141 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
|
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 |
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
|
145 Purple::Cipher::Context |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
146 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
|
147 Purple::Cipher cipher |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
148 void *extra |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
149 C_ARGS: cipher, extra |
15373
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_by_name(klass, name, extra = NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
153 gchar *name |
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: name, extra |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
156 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
157 void |
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_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
|
159 Purple::Cipher::Context context |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
160 gpointer extra |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
161 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
162 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
|
163 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
|
164 Purple::Cipher::Context context |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
165 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
166 void |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
167 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
|
168 PROTOTYPE: $$ |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
169 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
170 void |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
171 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
|
172 PROTOTYPE: $$ |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
173 |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
174 size_t |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
175 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
|
176 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
|
177 size_t in_len |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
178 SV *digest |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
179 PREINIT: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
180 gboolean ret; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
181 guchar *buff = NULL; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
182 CODE: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
183 SvUPGRADE(digest, SVt_PV); |
26935
31f65046b92d
Various perl warning fixes as well as real fixes to gconstpointer functions
Paul Aurich <paul@darkrain42.org>
parents:
23656
diff
changeset
|
184 buff = (guchar *)SvGROW(digest, in_len); |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
185 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
|
186 if(!ret) { |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
187 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
|
188 XSRETURN_UNDEF; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
189 } |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
190 SvCUR_set(digest, RETVAL); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
191 SvPOK_only(digest); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
192 OUTPUT: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
193 RETVAL |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
194 |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
195 size_t |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
196 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
|
197 Purple::Cipher::Context context |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
198 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
|
199 SV *digest_s |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
200 PREINIT: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
201 gboolean ret; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
202 gchar *buff = NULL; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
203 CODE: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
204 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
|
205 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
|
206 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
|
207 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
|
208 if(!ret) { |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
209 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
|
210 XSRETURN_UNDEF; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
211 } |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
212 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
|
213 SvPOK_only(digest_s); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
214 OUTPUT: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
215 RETVAL |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
216 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
217 gint |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
218 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
|
219 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
|
220 SV *data_sv |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
221 SV *output |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
222 PROTOTYPE: $$$ |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
223 PREINIT: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
224 size_t datalen; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
225 guchar *buff = NULL; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
226 guchar *data = NULL; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
227 CODE: |
26935
31f65046b92d
Various perl warning fixes as well as real fixes to gconstpointer functions
Paul Aurich <paul@darkrain42.org>
parents:
23656
diff
changeset
|
228 data = (guchar *)SvPV(data_sv, datalen); |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
229 SvUPGRADE(output, SVt_PV); |
26935
31f65046b92d
Various perl warning fixes as well as real fixes to gconstpointer functions
Paul Aurich <paul@darkrain42.org>
parents:
23656
diff
changeset
|
230 buff = (guchar *)SvGROW(output, datalen); |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
231 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
|
232 if(outlen != 0) { |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
233 SvPOK_only(output); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
234 SvCUR_set(output, outlen); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
235 } else { |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
236 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
|
237 } |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
238 OUTPUT: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
239 RETVAL |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
240 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
241 gint |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
242 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
|
243 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
|
244 SV *data_sv |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
245 SV *output |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
246 PROTOTYPE: $$$ |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
247 PREINIT: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
248 size_t datalen; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
249 guchar *buff = NULL; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
250 guchar *data = NULL; |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
251 CODE: |
26935
31f65046b92d
Various perl warning fixes as well as real fixes to gconstpointer functions
Paul Aurich <paul@darkrain42.org>
parents:
23656
diff
changeset
|
252 data = (guchar *)SvPV(data_sv, datalen); |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
253 SvUPGRADE(output, SVt_PV); |
26935
31f65046b92d
Various perl warning fixes as well as real fixes to gconstpointer functions
Paul Aurich <paul@darkrain42.org>
parents:
23656
diff
changeset
|
254 buff = (guchar *)SvGROW(output, datalen); |
23655
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
255 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
|
256 if(outlen != 0) { |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
257 SvPOK_only(output); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
258 SvCUR_set(output, outlen); |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
259 } else { |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
260 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
|
261 } |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
262 OUTPUT: |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
263 RETVAL |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
264 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
265 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
|
266 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
|
267 Purple::Cipher::Context context |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
268 guchar *salt |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
269 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
270 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
|
271 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
|
272 Purple::Cipher::Context context |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
273 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
274 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
|
275 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
|
276 Purple::Cipher::Context context |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
277 guchar *key |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
278 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
279 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
|
280 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
|
281 Purple::Cipher::Context context |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
282 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
283 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
|
284 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
|
285 Purple::Cipher::Context context |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
286 gpointer data |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
287 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
288 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
|
289 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
|
290 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
|
291 |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
292 Purple::Cipher::BatchMode |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
293 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
|
294 Purple::Cipher::Context context |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
295 |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
296 size_t |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
297 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
|
298 Purple::Cipher::Context context |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
299 |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
300 void |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
301 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
|
302 Purple::Cipher::Context context |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
303 Purple::Cipher::BatchMode mode |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
304 |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
305 void |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
306 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
|
307 PROTOTYPE: $$ |
af603a54ae5a
Some Perl bindings fixes and additions from Zsombor Welker.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
15833
diff
changeset
|
308 |