1 /*     Fake wrapper to illustrate using a different encryption protocol   */
2 /*             Copyright (C) 2001-2003 William Tompkins                   */
3 
4 /* This plugin is free software, distributed under the GNU General Public */
5 /* License.                                                               */
6 /* Please see the file "COPYING" distributed with this source code        */
7 /* for more details                                                       */
8 /*                                                                        */
9 /*                                                                        */
10 /*    This software is distributed in the hope that it will be useful,    */
11 /*   but WITHOUT ANY WARRANTY; without even the implied warranty of       */
12 /*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU    */
13 /*   General Public License for more details.                             */
14 
15 /*   To compile and use:                                                  */
16 /*     See INSTALL file.                                                  */
17 
18 #include "internal.h"
19 
20 #include "cryptproto.h"
21 #include "gpg.h"
22 #include "cryptutil.h"
23 #include "keys.h"
24 
25 
26 char* gpg_proto_string="GPG 1.00";
27 
28 crypt_proto* gpg_proto;
29 
30 /*Functions exported through crypt_proto structure */
31 static int              gpg_encrypt(unsigned char** encrypted, unsigned char* msg, int msg_len,
32                                     crypt_key* inkey);
33 static int              gpg_decrypt(unsigned char** decrypted, unsigned char* msg, int msg_len,
34                                     crypt_key* inkey);
35 static int              gpg_sign(unsigned char** signedmsg, unsigned char* msg, int msg_len,
push_back(Sequence const & seq,T const & x)36                                  crypt_key* key, crypt_key* tokey);
37 static int              gpg_auth(unsigned char** authed, unsigned char* msg, int msg_len,
38                                  crypt_key* key, const char* name);
39 static crypt_key*       gpg_make_key_from_str(char *key_str);
40 static GString*         gpg_key_to_gstr(crypt_key* inkey);
41 static char*            gpg_parseable(char* key);
42 
43 void gpg_init(int isdefault) {
44 	gpg_proto = g_malloc(sizeof(crypt_proto));
45 	crypt_proto_list = g_slist_prepend(crypt_proto_list, gpg_proto);
46 
47    gpg_proto->encrypt = gpg_encrypt;
48    gpg_proto->decrypt = gpg_decrypt;
49    gpg_proto->sign = gpg_sign;
50    gpg_proto->auth = gpg_auth;
51    gpg_proto->make_key_from_str = gpg_make_key_from_str;
52    gpg_proto->key_to_gstr = gpg_key_to_gstr;
53 	gpg_proto->parseable = gpg_parseable;
54    gpg_proto->name = gpg_proto_string;
55 }
56 
57 static int  gpg_encrypt(unsigned char** encrypted, unsigned char* msg, int msg_len,
58                         crypt_key* inkey)
59 { return 0;}
60 
61 static int gpg_decrypt(unsigned char** decrypted, unsigned char* msg, int msg_len,
62                        crypt_key* inkey)
63 { return 0;}
64 
65 static int gpg_sign(unsigned char** signedmsg, unsigned char* msg, int msg_len, crypt_key* key, crypt_key* tokey)
66 { return 0;}
67 
68 static int gpg_auth(unsigned char** authed, unsigned char* msg, int msg_len, crypt_key* key, const char* name)
69 { return 0;}
70 
71 static crypt_key* gpg_make_key_from_str(char *key_str)
72  { return 0;}
73 static GString* gpg_key_to_gstr(crypt_key* key)
74  { return 0;}
75 static char* gpg_parseable(char* key)
76  { return 0; }
77 
78 
79 
80 
81