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

Annotation of /trunk/Include/wptKeyserver.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 146 - (hide annotations)
Fri Jan 13 14:20:51 2006 UTC (19 years, 1 month ago) by twoaday
File MIME type: text/plain
File size: 3967 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 werner 37 /* wptKeyserver.h - Keyserver headerfile
2 twoaday 146 * Copyright (C) 2000-2006 Timo Schulz
3 werner 37 *
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 twoaday 115 PROXY_USER = 0, /* proxy username */
32     PROXY_PASS = 1, /* proxy password */
33 werner 37 };
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 twoaday 115 extern char *default_keyserver;
67 twoaday 146 extern WORD default_keyserver_port;
68 werner 37
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     const char* kserver_check_keyid (const char *keyid);
85     const char* kserver_get_proxy (int *r_port);
86     const char* kserver_get_proxy_info (int id);
87    
88 twoaday 146 void kserver_change_proxy (keyserver_proxy_ctx *ctx);
89     void proxy_release (keyserver_proxy_ctx *ctx);
90     const char* kserver_get_hostname (int idx, int type, unsigned short *port);
91 werner 37 void keyserver_set_default (const char *hostname, unsigned short port);
92     void set_default_kserver (void);
93    
94     /*-- General --*/
95     int check_IP_or_hostname (const char *name);
96 twoaday 146 const char* kserver_strerror (void);
97 werner 37 int kserver_check_inet_connection (void);
98 twoaday 146 int kserver_connect (const char *hostname, WORD port, int *conn_fd);
99     int kserver_sendkey (const char *hostname, WORD port,
100 twoaday 115 const char *pubkey, int len);
101 twoaday 146 int kserver_recvkey (const char *hostname, WORD port,
102 werner 37 const char *keyid, char *key, int maxkeylen);
103    
104 twoaday 146 int kserver_search_init(const char *hostname, WORD port,
105 twoaday 115 const char *keyid, int *conn_fd);
106 werner 37 int kserver_search_chkresp (int conn_fd);
107     int kserver_search (int conn_fd, keyserver_key *key);
108    
109     /*-- Finger/LDAP Protocol --*/
110     int ldap_recvkey (const char *hostname, const char *keyid, char *key,
111     int maxkeylen);
112     int finger_recvkey (const char * host, const char * user, char * key,
113     int maxkeylen);
114    
115     /*-- Dialog support --*/
116 twoaday 115 int hkp_send_key (HWND dlg, const char *kserver, unsigned short port,
117     const char *pattern);
118     int hkp_recv_key (HWND dlg, const char *kserver, unsigned short port,
119     const char *pattern, int proto, int flags);
120 werner 37
121 twoaday 115 #endif /* WPT_KEYSERVER_H */

Properties

Name Value
svn:eol-style native

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26