1 /* vim:tw=78:ts=8:sw=4:set ft=c: */
3 Copyright (C) 2006-2010 Ben Kibbey <bjk@luxsci.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program 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
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02110-1301 USA
31 #ifndef DNS_USE_GETTIMEOFDAY_FOR_ID
32 #define DNS_USE_GETTIMEOFDAY_FOR_ID 1
35 #include <arpa/nameser.h>
47 #define N_(msgid) dgettext("libpwmd", msgid)
49 #define N_(msgid) (msgid)
52 #define N_ARRAY(a) (sizeof(a)/sizeof(a[0]))
92 LIBSSH2_SESSION
*session
;
93 LIBSSH2_CHANNEL
*channel
;
94 LIBSSH2_KNOWNHOSTS
*kh
;
96 struct libssh2_agent_publickey
*agent_identity
;
97 struct libssh2_agent_publickey
*agent_identity_prev
;
98 struct libssh2_knownhost
*hostent
;
99 struct libssh2_knownhost
*hostent_ip
;
101 pwmd_async_cmd_t cmd
;
102 pwmd_ssh_async_t state
;
106 #define OPT_LOCK_ON_OPEN 0x01
107 #define OPT_BASE64 0x02
110 assuan_context_t ctx
;
112 pwmd_tcp_conn_t
*tcp_conn
;
113 pwmd_ip_version_t prot
;
114 pwmd_knownhost_cb_t kh_cb
;
120 pwmd_async_cmd_t cmd
;
121 pwmd_async_cmd_t lastcmd
;
122 char *result
; // not related to anything the client can see.
124 pid_t pid
; // for pinentry timeouts when used with ..async2().
125 assuan_context_t pctx
;
126 int nb_fd
; // for pwmd_open/save_async2().
135 char *pinentry_display
;
143 int pinentry_timeout
;
144 int disable_pinentry
;
145 pwmd_passphrase_cb_t passfunc
;
147 pwmd_status_cb_t status_func
;
149 pwmd_inquire_cb_t inquire_func
;
151 size_t inquire_total
;
154 int (*_inquire_func
)(void *, const char *);
171 char password
[ASSUAN_LINELENGTH
+1];
174 gpg_error_t
_assuan_command(pwm_t
*pwm
, assuan_context_t ctx
,
175 char **result
, const char *cmd
);
176 gpg_error_t
_connect_finalize(pwm_t
*pwm
);