/[winpt]/trunk/Include/wptKeyserver.h
ViewVC logotype

Contents of /trunk/Include/wptKeyserver.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 151 - (show annotations)
Wed Jan 18 11:53:10 2006 UTC (19 years, 1 month ago) by twoaday
File MIME type: text/plain
File size: 4009 byte(s)
2006-01-13  Timo Schulz  <ts@g10code.com>
 
        * wptKeyCache.h (gpg_keycache_next_updated_key): New.
         
2006-01-11  Timo Schulz  <ts@g10code.com>
 
        * wptGPG.h (gpg_data_putc): New.


1 /* wptKeyserver.h - Keyserver headerfile
2 * Copyright (C) 2000-2006 Timo Schulz
3 *
4 * This file is part of WinPT.
5 *
6 * WinPT is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * WinPT is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with WinPT; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21 #ifndef WPT_KEYSERVER_H
22 #define WPT_KEYSERVER_H
23
24 #define HKP_PORT 11371 /* Horowitz Keyserver Protocol */
25 #define FINGER_PORT 79 /* Finger Protocol */
26
27 /* Default keyserver URL. */
28 #define DEF_HKP_KEYSERVER "http://subkeys.pgp.net"
29
30 enum proxy_t {
31 PROXY_USER = 0, /* proxy username */
32 PROXY_PASS = 1, /* proxy password */
33 };
34
35 /* Valid key server protocols. */
36 enum ksproto_t {
37 KSPROTO_HTTP = 0,
38 KSPROTO_LDAP = 1,
39 KSPROTO_FINGER = 2
40 };
41 #define KSPROTO_HKP 0 /* alias for http */
42
43 struct keyserver_ctx {
44 const char *name;
45 unsigned short port;
46 const char *pattern;
47 };
48
49 struct keyserver {
50 char *name; /* name of the keyserver. */
51 int port; /* used tcp port. */
52 int used; /* 1=entry will be used. */
53 int proto; /* protocol (0..2). */
54 };
55
56 struct keyserver_proxy_ctx {
57 int port; /* proxy server port. */
58 char *host; /* proxy server host. */
59 char *user; /* proxy user. */
60 char *base64_user; /* base64 encoded proxy user. */
61 char *pass; /* proxy password. */
62 };
63
64 #define MAX_KEYSERVERS 32
65 extern keyserver server[MAX_KEYSERVERS]; /* runtime initialized */
66 extern char *default_keyserver;
67 extern WORD default_keyserver_port;
68
69 struct keyserver_key {
70 int bits; /* length of the key. */
71 char keyid[8+1]; /* keyid of the key. */
72 char date[10+1]; /* date of creation. */
73 char uid[384]; /* primary user-id. */
74 };
75
76
77 /*-- Winsock2 support --*/
78 int wsock_init (void);
79 void wsock_end (void);
80 const char* wsock_strerror (void);
81
82 /*-- Keyserver config --*/
83 int kserver_load_conf (const char *conf);
84 int kserver_save_conf (const char *conf);
85 const char* kserver_check_keyid (const char *keyid);
86 const char* kserver_get_proxy (int *r_port);
87 const char* kserver_get_proxy_info (int id);
88
89 void kserver_change_proxy (keyserver_proxy_ctx *ctx);
90 void proxy_release (keyserver_proxy_ctx *ctx);
91 const char* kserver_get_hostname (int idx, int type, unsigned short *port);
92 void keyserver_set_default (const char *hostname, unsigned short port);
93 void set_default_kserver (void);
94
95 /*-- General --*/
96 int check_IP_or_hostname (const char *name);
97 const char* kserver_strerror (void);
98 int kserver_check_inet_connection (void);
99 int kserver_connect (const char *hostname, WORD port, int *conn_fd);
100 int kserver_sendkey (const char *hostname, WORD port,
101 const char *pubkey, int len);
102 int kserver_recvkey (const char *hostname, WORD port,
103 const char *keyid, char *key, int maxkeylen);
104
105 int kserver_search_init(const char *hostname, WORD port,
106 const char *keyid, int *conn_fd);
107 int kserver_search_chkresp (int conn_fd);
108 int kserver_search (int conn_fd, keyserver_key *key);
109
110 /*-- Finger/LDAP Protocol --*/
111 int ldap_recvkey (const char *hostname, const char *keyid, char *key,
112 int maxkeylen);
113 int finger_recvkey (const char * host, const char * user, char * key,
114 int maxkeylen);
115
116 /*-- Dialog support --*/
117 int hkp_send_key (HWND dlg, const char *kserver, unsigned short port,
118 const char *pattern);
119 int hkp_recv_key (HWND dlg, const char *kserver, unsigned short port,
120 const char *pattern, int proto, int flags);
121
122 #endif /* WPT_KEYSERVER_H */

Properties

Name Value
svn:eol-style native

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26