2 Copyright (C) 2006-2016, 2017 Ben Kibbey <bjk@luxsci.net>
4 This file is part of libpwmd.
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 This library 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 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
45 #define N_(msgid) dgettext("libpwmd", msgid)
47 #define N_(msgid) (msgid)
50 #define N_ARRAY(a) (sizeof(a)/sizeof(a[0]))
54 PWMD_IPV6
, PWMD_IPV4
, PWMD_IP_ANY
57 #if defined(WITH_SSH) || defined(WITH_GNUTLS)
64 struct addrinfo
*addrs
;
65 struct addrinfo
*addr
;
66 pthread_cond_t dns_cond
;
67 pthread_mutex_t dns_mutex
;
77 #define OPT_LOCK_ON_OPEN 0x0001
78 #define OPT_SIGPIPE 0x0002
83 #if defined(WITH_SSH) || defined(WITH_GNUTLS)
89 /* Options set with pwmd_setopt(). */
90 pwmd_read_cb_t read_cb
;
92 pwmd_write_cb_t write_cb
;
95 pwmd_ip_version_t prot
;
96 pwmd_knownhost_cb_t kh_cb
;
108 pid_t pinentry_pid
; // for local pinentry timeouts
109 assuan_context_t pctx
;
114 char *pinentry_display
;
115 char *pinentry_lcctype
;
116 char *pinentry_lcmessages
;
117 char *pinentry_error
;
118 char *pinentry_prompt
;
120 int pinentry_tries
; // local pinentry
121 int pinentry_try
; // local pinentry
122 char *passphrase_hint
;
123 char *passphrase_info
;
125 int pinentry_timeout
;
126 int current_pinentry_timeout
;
127 int disable_pinentry
;
129 int pinentry_disabled
; // for sending the disable command
130 pwmd_status_cb_t status_func
;
132 pwmd_inquire_cb_t inquire_func
;
134 size_t inquire_total
;
136 size_t inquire_maxlen
;
138 gpg_error_t (*_inquire_func
) (void *, const char *);
143 int override_inquire
;
145 unsigned version
; // of pwmd
148 gpg_error_t
_assuan_command (pwm_t
* pwm
, assuan_context_t ctx
,
149 char **result
, size_t * len
, const char *cmd
);
150 gpg_error_t
_connect_finalize (pwm_t
* pwm
);
151 #if defined(WITH_SSH) || defined(WITH_GNUTLS)
152 void free_tcp (pwm_t
*);
153 gpg_error_t
tcp_connect_common (pwm_t
* pwm
);