pinentry-x2go-0.7.5.6/acinclude.m40000644000000000000000000000776312070425227013511 0ustar dnl Autoconf macros used by PINENTRY dnl dnl Copyright (C) 2002 g10 Code GmbH dnl dnl dnl GNUPG_CHECK_TYPEDEF(TYPE, HAVE_NAME) dnl Check whether a typedef exists and create a #define $2 if it exists dnl AC_DEFUN([GNUPG_CHECK_TYPEDEF], [ AC_MSG_CHECKING(for $1 typedef) AC_CACHE_VAL(gnupg_cv_typedef_$1, [AC_TRY_COMPILE([#define _GNU_SOURCE 1 #include #include ], [ #undef $1 int a = sizeof($1); ], gnupg_cv_typedef_$1=yes, gnupg_cv_typedef_$1=no )]) AC_MSG_RESULT($gnupg_cv_typedef_$1) if test "$gnupg_cv_typedef_$1" = yes; then AC_DEFINE($2,1,[Defined if a `]$1[' is typedef'd]) fi ]) ###################################################################### # Check whether mlock is broken (hpux 10.20 raises a SIGBUS if mlock # is not called from uid 0 (not tested whether uid 0 works) # For DECs Tru64 we have also to check whether mlock is in librt # mlock is there a macro using memlk() ###################################################################### dnl GNUPG_CHECK_MLOCK dnl define([GNUPG_CHECK_MLOCK], [ AC_CHECK_FUNCS(mlock) if test "$ac_cv_func_mlock" = "no"; then AC_CHECK_HEADERS(sys/mman.h) if test "$ac_cv_header_sys_mman_h" = "yes"; then # Add librt to LIBS: AC_CHECK_LIB(rt, memlk) AC_CACHE_CHECK([whether mlock is in sys/mman.h], gnupg_cv_mlock_is_in_sys_mman, [AC_TRY_LINK([ #include #ifdef HAVE_SYS_MMAN_H #include #endif ], [ int i; /* glibc defines this for functions which it implements * to always fail with ENOSYS. Some functions are actually * named something starting with __ and the normal name * is an alias. */ #if defined (__stub_mlock) || defined (__stub___mlock) choke me #else mlock(&i, 4); #endif ; return 0; ], gnupg_cv_mlock_is_in_sys_mman=yes, gnupg_cv_mlock_is_in_sys_mman=no)]) if test "$gnupg_cv_mlock_is_in_sys_mman" = "yes"; then AC_DEFINE(HAVE_MLOCK,1, [Defined if the system supports an mlock() call]) fi fi fi if test "$ac_cv_func_mlock" = "yes"; then AC_MSG_CHECKING(whether mlock is broken) AC_CACHE_VAL(gnupg_cv_have_broken_mlock, AC_TRY_RUN([ #include #include #include #include #include #include int main() { char *pool; int err; long int pgsize = getpagesize(); pool = malloc( 4096 + pgsize ); if( !pool ) return 2; pool += (pgsize - ((long int)pool % pgsize)); err = mlock( pool, 4096 ); if( !err || errno == EPERM ) return 0; /* okay */ return 1; /* hmmm */ } ], gnupg_cv_have_broken_mlock="no", gnupg_cv_have_broken_mlock="yes", gnupg_cv_have_broken_mlock="assume-no" ) ) if test "$gnupg_cv_have_broken_mlock" = "yes"; then AC_DEFINE(HAVE_BROKEN_MLOCK,1, [Defined if the mlock() call does not work]) AC_MSG_RESULT(yes) AC_CHECK_FUNCS(plock) else if test "$gnupg_cv_have_broken_mlock" = "no"; then AC_MSG_RESULT(no) else AC_MSG_RESULT(assuming no) fi fi fi ]) pinentry-x2go-0.7.5.6/assuan/assuan-buffer.c0000644000000000000000000002573212070425227015513 0ustar /* assuan-buffer.c - read and send data * Copyright (C) 2001 Free Software Foundation, Inc. * * This file is part of GnuPG. * * GnuPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * GnuPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include #include #include #include #include #include #include #ifdef USE_GNU_PTH # include #endif #include "assuan-defs.h" #ifdef HAVE_JNLIB_LOGGING #include "../jnlib/logging.h" #endif static const char * my_log_prefix (void) { #ifdef HAVE_JNLIB_LOGGING return log_get_prefix (NULL); #else return ""; #endif } static int writen ( int fd, const char *buffer, size_t length ) { while (length) { #ifdef USE_GNU_PTH int nwritten = pth_write (fd, buffer, length); #else int nwritten = write (fd, buffer, length); #endif if (nwritten < 0) { if (errno == EINTR) continue; return -1; /* write error */ } length -= nwritten; buffer += nwritten; } return 0; /* okay */ } /* read an entire line */ static int readline (int fd, char *buf, size_t buflen, int *r_nread, int *iseof) { size_t nleft = buflen; char *p; *iseof = 0; *r_nread = 0; while (nleft > 0) { #ifdef USE_GNU_PTH int n = pth_read (fd, buf, nleft); #else int n = read (fd, buf, nleft); #endif if (n < 0) { if (errno == EINTR) continue; return -1; /* read error */ } else if (!n) { *iseof = 1; break; /* allow incomplete lines */ } p = buf; nleft -= n; buf += n; *r_nread += n; for (; n && *p != '\n'; n--, p++) ; if (n) break; /* at least one full line available - that's enough for now */ } return 0; } int _assuan_read_line (ASSUAN_CONTEXT ctx) { char *line = ctx->inbound.line; int n, nread, atticlen; int rc; if (ctx->inbound.eof) return -1; atticlen = ctx->inbound.attic.linelen; if (atticlen) { memcpy (line, ctx->inbound.attic.line, atticlen); ctx->inbound.attic.linelen = 0; for (n=0; n < atticlen && line[n] != '\n'; n++) ; if (n < atticlen) { rc = 0; /* found another line in the attic */ nread = atticlen; atticlen = 0; } else { /* read the rest */ assert (atticlen < LINELENGTH); rc = readline (ctx->inbound.fd, line + atticlen, LINELENGTH - atticlen, &nread, &ctx->inbound.eof); } } else rc = readline (ctx->inbound.fd, line, LINELENGTH, &nread, &ctx->inbound.eof); if (rc) { if (ctx->log_fp) fprintf (ctx->log_fp, "%s[%p] <- [Error: %s]\n", my_log_prefix (), ctx, strerror (errno)); return ASSUAN_Read_Error; } if (!nread) { assert (ctx->inbound.eof); if (ctx->log_fp) fprintf (ctx->log_fp, "%s[%p] <- [EOF]\n", my_log_prefix (),ctx); return -1; } ctx->inbound.attic.pending = 0; nread += atticlen; for (n=0; n < nread; n++) { if (line[n] == '\n') { if (n+1 < nread) { char *s, *d; int i; n++; /* we have to copy the rest because the handlers are allowed to modify the passed buffer */ for (d=ctx->inbound.attic.line, s=line+n, i=nread-n; i; i--) { if (*s=='\n') ctx->inbound.attic.pending = 1; *d++ = *s++; } ctx->inbound.attic.linelen = nread-n; n--; } if (n && line[n-1] == '\r') n--; line[n] = 0; ctx->inbound.linelen = n; if (ctx->log_fp) { fprintf (ctx->log_fp, "%s[%p] <- ", my_log_prefix (), ctx); if (ctx->confidential) fputs ("[Confidential data not shown]", ctx->log_fp); else _assuan_log_print_buffer (ctx->log_fp, ctx->inbound.line, ctx->inbound.linelen); putc ('\n', ctx->log_fp); } return 0; } } if (ctx->log_fp) fprintf (ctx->log_fp, "%s[%p] <- [Invalid line]\n", my_log_prefix (), ctx); *line = 0; ctx->inbound.linelen = 0; return ctx->inbound.eof? ASSUAN_Line_Not_Terminated : ASSUAN_Line_Too_Long; } /* Read the next line from the client or server and return a pointer to a buffer with holding that line. linelen returns the length of the line. This buffer is valid until another read operation is done on this buffer. The caller is allowed to modify this buffer. He should only use the buffer if the function returns without an error. Returns: 0 on success or an assuan error code See also: assuan_pending_line(). */ AssuanError assuan_read_line (ASSUAN_CONTEXT ctx, char **line, size_t *linelen) { AssuanError err; if (!ctx) return ASSUAN_Invalid_Value; err = _assuan_read_line (ctx); *line = ctx->inbound.line; *linelen = ctx->inbound.linelen; return err; } /* Return true when a full line is pending for a read, without the need for actual IO */ int assuan_pending_line (ASSUAN_CONTEXT ctx) { return ctx && ctx->inbound.attic.pending; } AssuanError assuan_write_line (ASSUAN_CONTEXT ctx, const char *line ) { int rc; if (!ctx) return ASSUAN_Invalid_Value; /* fixme: we should do some kind of line buffering */ if (ctx->log_fp) { fprintf (ctx->log_fp, "%s[%p] -> ", my_log_prefix (), ctx); if (ctx->confidential) fputs ("[Confidential data not shown]", ctx->log_fp); else _assuan_log_print_buffer (ctx->log_fp, line, strlen (line)); putc ('\n', ctx->log_fp); } rc = writen (ctx->outbound.fd, line, strlen(line)); if (rc) rc = ASSUAN_Write_Error; if (!rc) { rc = writen (ctx->outbound.fd, "\n", 1); if (rc) rc = ASSUAN_Write_Error; } return rc; } /* Write out the data in buffer as datalines with line wrapping and percent escaping. This fucntion is used for GNU's custom streams */ int _assuan_cookie_write_data (void *cookie, const char *buffer, size_t size) { ASSUAN_CONTEXT ctx = cookie; char *line; size_t linelen; if (ctx->outbound.data.error) return 0; line = ctx->outbound.data.line; linelen = ctx->outbound.data.linelen; line += linelen; while (size) { /* insert data line header */ if (!linelen) { *line++ = 'D'; *line++ = ' '; linelen += 2; } /* copy data, keep some space for the CRLF and to escape one character */ while (size && linelen < LINELENGTH-2-2) { if (*buffer == '%' || *buffer == '\r' || *buffer == '\n') { sprintf (line, "%%%02X", *(unsigned char*)buffer); line += 3; linelen += 3; buffer++; } else { *line++ = *buffer++; linelen++; } size--; } if (linelen >= LINELENGTH-2-2) { if (ctx->log_fp) { fprintf (ctx->log_fp, "%s[%p] -> ", my_log_prefix (), ctx); if (ctx->confidential) fputs ("[Confidential data not shown]", ctx->log_fp); else _assuan_log_print_buffer (ctx->log_fp, ctx->outbound.data.line, linelen); putc ('\n', ctx->log_fp); } *line++ = '\n'; linelen++; if (writen (ctx->outbound.fd, ctx->outbound.data.line, linelen)) { ctx->outbound.data.error = ASSUAN_Write_Error; return 0; } line = ctx->outbound.data.line; linelen = 0; } } ctx->outbound.data.linelen = linelen; return 0; } /* Write out any buffered data This fucntion is used for GNU's custom streams */ int _assuan_cookie_write_flush (void *cookie) { ASSUAN_CONTEXT ctx = cookie; char *line; size_t linelen; if (ctx->outbound.data.error) return 0; line = ctx->outbound.data.line; linelen = ctx->outbound.data.linelen; line += linelen; if (linelen) { if (ctx->log_fp) { fprintf (ctx->log_fp, "%s[%p] -> ", my_log_prefix (), ctx); if (ctx->confidential) fputs ("[Confidential data not shown]", ctx->log_fp); else _assuan_log_print_buffer (ctx->log_fp, ctx->outbound.data.line, linelen); putc ('\n', ctx->log_fp); } *line++ = '\n'; linelen++; if (writen (ctx->outbound.fd, ctx->outbound.data.line, linelen)) { ctx->outbound.data.error = ASSUAN_Write_Error; return 0; } ctx->outbound.data.linelen = 0; } return 0; } /** * assuan_send_data: * @ctx: An assuan context * @buffer: Data to send or NULL to flush * @length: length of the data to send/ * * This function may be used by the server or the client to send data * lines. The data will be escaped as required by the Assuan protocol * and may get buffered until a line is full. To force sending the * data out @buffer may be passed as NULL (in which case @length must * also be 0); however when used by a client this flush operation does * also send the terminating "END" command to terminate the reponse on * a INQUIRE response. However, when assuan_transact() is used, this * function takes care of sending END itself. * * Return value: 0 on success or an error code **/ AssuanError assuan_send_data (ASSUAN_CONTEXT ctx, const void *buffer, size_t length) { if (!ctx) return ASSUAN_Invalid_Value; if (!buffer && length) return ASSUAN_Invalid_Value; if (!buffer) { /* flush what we have */ _assuan_cookie_write_flush (ctx); if (ctx->outbound.data.error) return ctx->outbound.data.error; if (!ctx->is_server) return assuan_write_line (ctx, "END"); } else { _assuan_cookie_write_data (ctx, buffer, length); if (ctx->outbound.data.error) return ctx->outbound.data.error; } return 0; } pinentry-x2go-0.7.5.6/assuan/assuan-defs.h0000644000000000000000000001025412070425227015161 0ustar /* assuan-defs.c - Internal definitions to Assuan * Copyright (C) 2001 Free Software Foundation, Inc. * * This file is part of GnuPG. * * GnuPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * GnuPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef ASSUAN_DEFS_H #define ASSUAN_DEFS_H #include #include "assuan.h" #define LINELENGTH ASSUAN_LINELENGTH struct cmdtbl_s { const char *name; int cmd_id; int (*handler)(ASSUAN_CONTEXT, char *line); }; struct assuan_context_s { AssuanError err_no; const char *err_str; int os_errno; /* last system error number used with certain error codes*/ int confidential; int is_server; /* set if this is context belongs to a server */ int in_inquire; char *hello_line; char *okay_line; /* see assan_set_okay_line() */ void *user_pointer; /* for assuan_[gs]et_pointer () */ FILE *log_fp; struct { int fd; int eof; char line[LINELENGTH]; int linelen; /* w/o CR, LF - might not be the same as strlen(line) due to embedded nuls. However a nul is always written at this pos */ struct { char line[LINELENGTH]; int linelen ; int pending; /* i.e. at least one line is available in the attic */ } attic; } inbound; struct { int fd; struct { FILE *fp; char line[LINELENGTH]; int linelen; int error; } data; } outbound; int pipe_mode; /* We are in pipe mode, i.e. we can handle just one connection and must terminate then */ pid_t pid; /* In pipe mode, the pid of the child server process. In socket mode, the pid of the server */ int listen_fd; /* The fd we are listening on (used by socket servers) */ pid_t client_pid; /* for a socket server the PID of the client or -1 if not available */ void (*deinit_handler)(ASSUAN_CONTEXT); int (*accept_handler)(ASSUAN_CONTEXT); int (*finish_handler)(ASSUAN_CONTEXT); struct cmdtbl_s *cmdtbl; size_t cmdtbl_used; /* used entries */ size_t cmdtbl_size; /* allocated size of table */ void (*bye_notify_fnc)(ASSUAN_CONTEXT); void (*reset_notify_fnc)(ASSUAN_CONTEXT); void (*cancel_notify_fnc)(ASSUAN_CONTEXT); int (*option_handler_fnc)(ASSUAN_CONTEXT,const char*, const char*); void (*input_notify_fnc)(ASSUAN_CONTEXT, const char *); void (*output_notify_fnc)(ASSUAN_CONTEXT, const char *); int input_fd; /* set by INPUT command */ int output_fd; /* set by OUTPUT command */ }; /*-- assuan-pipe-server.c --*/ int _assuan_new_context (ASSUAN_CONTEXT *r_ctx); void _assuan_release_context (ASSUAN_CONTEXT ctx); /*-- assuan-handler.c --*/ int _assuan_register_std_commands (ASSUAN_CONTEXT ctx); /*-- assuan-buffer.c --*/ int _assuan_read_line (ASSUAN_CONTEXT ctx); int _assuan_cookie_write_data (void *cookie, const char *buffer, size_t size); int _assuan_cookie_write_flush (void *cookie); /*-- assuan-client.c --*/ AssuanError _assuan_read_from_server (ASSUAN_CONTEXT ctx, int *okay, int *off); /*-- assuan-util.c --*/ void *_assuan_malloc (size_t n); void *_assuan_calloc (size_t n, size_t m); void *_assuan_realloc (void *p, size_t n); void _assuan_free (void *p); #define xtrymalloc(a) _assuan_malloc ((a)) #define xtrycalloc(a,b) _assuan_calloc ((a),(b)) #define xtryrealloc(a,b) _assuan_realloc((a),(b)) #define xfree(a) _assuan_free ((a)) #define set_error(c,e,t) assuan_set_error ((c), ASSUAN_ ## e, (t)) void _assuan_log_print_buffer (FILE *fp, const void *buffer, size_t length); void _assuan_log_sanitized_string (const char *string); #endif /*ASSUAN_DEFS_H*/ pinentry-x2go-0.7.5.6/assuan/assuan.h0000644000000000000000000001627312070425227014251 0ustar /* assuan.c - Definitions for the Assuna protocol * Copyright (C) 2001, 2002 Free Software Foundation, Inc. * * This file is part of GnuPG. * * GnuPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * GnuPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef ASSUAN_H #define ASSUAN_H #include #include #ifdef __cplusplus extern "C" { #if 0 } #endif #endif /* 5 is pinentry. */ #define ASSUAN_ERROR(code) ((5 << 24) | code) typedef enum { ASSUAN_No_Error = 0, ASSUAN_General_Error = ASSUAN_ERROR (257), ASSUAN_Out_Of_Core = ASSUAN_ERROR (86 | (1 << 15)), ASSUAN_Invalid_Value = ASSUAN_ERROR (261), ASSUAN_Timeout = ASSUAN_ERROR (62), ASSUAN_Read_Error = ASSUAN_ERROR (270), /* Not 100%, but sufficient here. */ ASSUAN_Write_Error = ASSUAN_ERROR (271), /* Not 100%, but sufficient here. */ ASSUAN_Problem_Starting_Server = ASSUAN_ERROR (269), ASSUAN_Not_A_Server = ASSUAN_ERROR (267), ASSUAN_Not_A_Client = ASSUAN_ERROR (268), ASSUAN_Nested_Commands = ASSUAN_ERROR (264), ASSUAN_Invalid_Response = ASSUAN_ERROR (260), ASSUAN_No_Data_Callback = ASSUAN_ERROR (265), ASSUAN_No_Inquire_Callback = ASSUAN_ERROR (266), ASSUAN_Connect_Failed = ASSUAN_ERROR (259), ASSUAN_Accept_Failed = ASSUAN_ERROR (258), /* error codes above 99 are meant as status codes */ ASSUAN_Not_Implemented = ASSUAN_ERROR (69), ASSUAN_Server_Fault = ASSUAN_ERROR (80), ASSUAN_Unknown_Command = ASSUAN_ERROR (275), ASSUAN_Syntax_Error = ASSUAN_ERROR (276), ASSUAN_Parameter_Conflict = ASSUAN_ERROR (280), ASSUAN_Line_Too_Long = ASSUAN_ERROR (263), ASSUAN_Line_Not_Terminated = ASSUAN_ERROR (262), ASSUAN_Canceled = ASSUAN_ERROR (99), ASSUAN_Invalid_Option = ASSUAN_ERROR (174), /* GPG_ERR_UNKNOWN_OPTION */ ASSUAN_Locale_Problem = ASSUAN_ERROR (166), ASSUAN_Not_Confirmed = ASSUAN_ERROR (114), } assuan_error_t; #define ASSUAN_Parameter_Error ASSUAN_Parameter_Conflict typedef assuan_error_t AssuanError; /* Deprecated. */ /* This is a list of pre-registered ASSUAN commands */ typedef enum { ASSUAN_CMD_NOP = 0, ASSUAN_CMD_CANCEL, /* cancel the current request */ ASSUAN_CMD_BYE, ASSUAN_CMD_AUTH, ASSUAN_CMD_RESET, ASSUAN_CMD_OPTION, ASSUAN_CMD_DATA, ASSUAN_CMD_END, ASSUAN_CMD_INPUT, ASSUAN_CMD_OUTPUT, ASSUAN_CMD_USER = 256 /* Other commands should be used with this offset*/ } AssuanCommand; #define ASSUAN_LINELENGTH 1002 /* 1000 + [CR,]LF */ struct assuan_context_s; typedef struct assuan_context_s *assuan_context_t; typedef struct assuan_context_s *ASSUAN_CONTEXT; /* Deprecated. */ /*-- assuan-handler.c --*/ int assuan_register_command (ASSUAN_CONTEXT ctx, int cmd_id, const char *cmd_string, int (*handler)(ASSUAN_CONTEXT, char *)); int assuan_register_bye_notify (ASSUAN_CONTEXT ctx, void (*fnc)(ASSUAN_CONTEXT)); int assuan_register_reset_notify (ASSUAN_CONTEXT ctx, void (*fnc)(ASSUAN_CONTEXT)); int assuan_register_cancel_notify (ASSUAN_CONTEXT ctx, void (*fnc)(ASSUAN_CONTEXT)); int assuan_register_input_notify (ASSUAN_CONTEXT ctx, void (*fnc)(ASSUAN_CONTEXT, const char *)); int assuan_register_output_notify (ASSUAN_CONTEXT ctx, void (*fnc)(ASSUAN_CONTEXT, const char *)); int assuan_register_option_handler (ASSUAN_CONTEXT ctx, int (*fnc)(ASSUAN_CONTEXT, const char*, const char*)); int assuan_process (ASSUAN_CONTEXT ctx); int assuan_process_next (ASSUAN_CONTEXT ctx); int assuan_get_active_fds (ASSUAN_CONTEXT ctx, int what, int *fdarray, int fdarraysize); AssuanError assuan_set_okay_line (ASSUAN_CONTEXT ctx, const char *line); void assuan_write_status (ASSUAN_CONTEXT ctx, const char *keyword, const char *text); /*-- assuan-listen.c --*/ AssuanError assuan_set_hello_line (ASSUAN_CONTEXT ctx, const char *line); AssuanError assuan_accept (ASSUAN_CONTEXT ctx); int assuan_get_input_fd (ASSUAN_CONTEXT ctx); int assuan_get_output_fd (ASSUAN_CONTEXT ctx); AssuanError assuan_close_input_fd (ASSUAN_CONTEXT ctx); AssuanError assuan_close_output_fd (ASSUAN_CONTEXT ctx); /*-- assuan-pipe-server.c --*/ int assuan_init_pipe_server (ASSUAN_CONTEXT *r_ctx, int filedes[2]); void assuan_deinit_server (ASSUAN_CONTEXT ctx); /*-- assuan-socket-server.c --*/ int assuan_init_socket_server (ASSUAN_CONTEXT *r_ctx, int listen_fd); /*-- assuan-pipe-connect.c --*/ AssuanError assuan_pipe_connect (ASSUAN_CONTEXT *ctx, const char *name, char *const argv[], int *fd_child_list); /*-- assuan-socket-connect.c --*/ AssuanError assuan_socket_connect (ASSUAN_CONTEXT *ctx, const char *name, pid_t server_pid); /*-- assuan-connect.c --*/ void assuan_disconnect (ASSUAN_CONTEXT ctx); pid_t assuan_get_pid (ASSUAN_CONTEXT ctx); /*-- assuan-client.c --*/ AssuanError assuan_transact (ASSUAN_CONTEXT ctx, const char *command, AssuanError (*data_cb)(void *, const void *, size_t), void *data_cb_arg, AssuanError (*inquire_cb)(void*, const char *), void *inquire_cb_arg, AssuanError (*status_cb)(void*, const char *), void *status_cb_arg); /*-- assuan-inquire.c --*/ AssuanError assuan_inquire (ASSUAN_CONTEXT ctx, const char *keyword, char **r_buffer, size_t *r_length, size_t maxlen); /*-- assuan-buffer.c --*/ AssuanError assuan_read_line (ASSUAN_CONTEXT ctx, char **line, size_t *linelen); int assuan_pending_line (ASSUAN_CONTEXT ctx); AssuanError assuan_write_line (ASSUAN_CONTEXT ctx, const char *line ); AssuanError assuan_send_data (ASSUAN_CONTEXT ctx, const void *buffer, size_t length); /*-- assuan-util.c --*/ void assuan_set_malloc_hooks ( void *(*new_alloc_func)(size_t n), void *(*new_realloc_func)(void *p, size_t n), void (*new_free_func)(void*) ); void assuan_set_log_stream (ASSUAN_CONTEXT ctx, FILE *fp); int assuan_set_error (ASSUAN_CONTEXT ctx, int err, const char *text); void assuan_set_pointer (ASSUAN_CONTEXT ctx, void *pointer); void *assuan_get_pointer (ASSUAN_CONTEXT ctx); void assuan_begin_confidential (ASSUAN_CONTEXT ctx); void assuan_end_confidential (ASSUAN_CONTEXT ctx); /*-- assuan-errors.c (built) --*/ const char *assuan_strerror (AssuanError err); #ifdef __cplusplus } #endif #endif /*ASSUAN_H*/ pinentry-x2go-0.7.5.6/assuan/assuan-handler.c0000644000000000000000000004007512070425227015654 0ustar /* assuan-handler.c - dispatch commands * Copyright (C) 2001 Free Software Foundation, Inc. * * This file is part of GnuPG. * * GnuPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * GnuPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include #include #include #include #include "assuan-defs.h" #define spacep(p) (*(p) == ' ' || *(p) == '\t') #define digitp(a) ((a) >= '0' && (a) <= '9') static int dummy_handler (ASSUAN_CONTEXT ctx, char *line) { return set_error (ctx, Server_Fault, "no handler registered"); } static int std_handler_nop (ASSUAN_CONTEXT ctx, char *line) { return 0; /* okay */ } static int std_handler_cancel (ASSUAN_CONTEXT ctx, char *line) { if (ctx->cancel_notify_fnc) ctx->cancel_notify_fnc (ctx); return set_error (ctx, Not_Implemented, NULL); } static int std_handler_option (ASSUAN_CONTEXT ctx, char *line) { char *key, *value, *p; for (key=line; spacep (key); key++) ; if (!*key) return set_error (ctx, Syntax_Error, "argument required"); if (*key == '=') return set_error (ctx, Syntax_Error, "no option name given"); for (value=key; *value && !spacep (value) && *value != '='; value++) ; if (*value) { if (spacep (value)) *value++ = 0; /* terminate key */ for (; spacep (value); value++) ; if (*value == '=') { *value++ = 0; /* terminate key */ for (; spacep (value); value++) ; if (!*value) return set_error (ctx, Syntax_Error, "option argument expected"); } if (*value) { for (p = value + strlen(value) - 1; p > value && spacep (p); p--) ; if (p > value) *++p = 0; /* strip trailing spaces */ } } if (*key == '-' && key[1] == '-' && key[2]) key += 2; /* the double dashes are optional */ if (*key == '-') return set_error (ctx, Syntax_Error, "option should not begin with one dash"); if (ctx->option_handler_fnc) return ctx->option_handler_fnc (ctx, key, value); return 0; } static int std_handler_bye (ASSUAN_CONTEXT ctx, char *line) { if (ctx->bye_notify_fnc) ctx->bye_notify_fnc (ctx); assuan_close_input_fd (ctx); assuan_close_output_fd (ctx); return -1; /* pretty simple :-) */ } static int std_handler_auth (ASSUAN_CONTEXT ctx, char *line) { return set_error (ctx, Not_Implemented, NULL); } static int std_handler_reset (ASSUAN_CONTEXT ctx, char *line) { if (ctx->reset_notify_fnc) ctx->reset_notify_fnc (ctx); assuan_close_input_fd (ctx); assuan_close_output_fd (ctx); return 0; } static int std_handler_end (ASSUAN_CONTEXT ctx, char *line) { return set_error (ctx, Not_Implemented, NULL); } static int parse_cmd_input_output (ASSUAN_CONTEXT ctx, char *line, int *rfd) { char *endp; if (strncmp (line, "FD=", 3)) return set_error (ctx, Syntax_Error, "FD= expected"); line += 3; if (!digitp (*line)) return set_error (ctx, Syntax_Error, "number required"); *rfd = strtoul (line, &endp, 10); /* remove that argument so that a notify handler won't see it */ memset (line, ' ', endp? (endp-line):strlen(line)); if (*rfd == ctx->inbound.fd) return set_error (ctx, Parameter_Conflict, "fd same as inbound fd"); if (*rfd == ctx->outbound.fd) return set_error (ctx, Parameter_Conflict, "fd same as outbound fd"); return 0; } /* Format is INPUT FD= */ static int std_handler_input (ASSUAN_CONTEXT ctx, char *line) { int rc, fd; rc = parse_cmd_input_output (ctx, line, &fd); if (rc) return rc; ctx->input_fd = fd; if (ctx->input_notify_fnc) ctx->input_notify_fnc (ctx, line); return 0; } /* Format is OUTPUT FD= */ static int std_handler_output (ASSUAN_CONTEXT ctx, char *line) { int rc, fd; rc = parse_cmd_input_output (ctx, line, &fd); if (rc) return rc; ctx->output_fd = fd; if (ctx->output_notify_fnc) ctx->output_notify_fnc (ctx, line); return 0; } /* This is a table with the standard commands and handler for them. The table is used to initialize a new context and assuciate strings and handlers with cmd_ids */ static struct { const char *name; int cmd_id; int (*handler)(ASSUAN_CONTEXT, char *line); int always; /* always initialize this command */ } std_cmd_table[] = { { "NOP", ASSUAN_CMD_NOP, std_handler_nop, 1 }, { "CANCEL", ASSUAN_CMD_CANCEL, std_handler_cancel, 1 }, { "OPTION", ASSUAN_CMD_OPTION, std_handler_option, 1 }, { "BYE", ASSUAN_CMD_BYE, std_handler_bye, 1 }, { "AUTH", ASSUAN_CMD_AUTH, std_handler_auth, 1 }, { "RESET", ASSUAN_CMD_RESET, std_handler_reset, 1 }, { "END", ASSUAN_CMD_END, std_handler_end, 1 }, { "INPUT", ASSUAN_CMD_INPUT, std_handler_input }, { "OUTPUT", ASSUAN_CMD_OUTPUT, std_handler_output }, { "OPTION", ASSUAN_CMD_OPTION, std_handler_option, 1 }, { NULL } }; /** * assuan_register_command: * @ctx: the server context * @cmd_id: An ID value for the command * @cmd_name: A string with the command name * @handler: The handler function to be called * * Register a handler to be used for a given command. * * The @cmd_name must be %NULL or an empty string for all @cmd_ids * below %ASSUAN_CMD_USER because predefined values are used. * * Return value: **/ int assuan_register_command (ASSUAN_CONTEXT ctx, int cmd_id, const char *cmd_name, int (*handler)(ASSUAN_CONTEXT, char *)) { int i; if (cmd_name && !*cmd_name) cmd_name = NULL; if (cmd_id < ASSUAN_CMD_USER) { if (cmd_name) return ASSUAN_Invalid_Value; /* must be NULL for these values*/ for (i=0; std_cmd_table[i].name; i++) { if (std_cmd_table[i].cmd_id == cmd_id) { cmd_name = std_cmd_table[i].name; if (!handler) handler = std_cmd_table[i].handler; break; } } if (!std_cmd_table[i].name) return ASSUAN_Invalid_Value; /* not a pre-registered one */ } if (!handler) handler = dummy_handler; if (!cmd_name) return ASSUAN_Invalid_Value; /* fprintf (stderr, "DBG-assuan: registering %d as `%s'\n", cmd_id, cmd_name); */ if (!ctx->cmdtbl) { ctx->cmdtbl_size = 50; ctx->cmdtbl = xtrycalloc ( ctx->cmdtbl_size, sizeof *ctx->cmdtbl); if (!ctx->cmdtbl) return ASSUAN_Out_Of_Core; ctx->cmdtbl_used = 0; } else if (ctx->cmdtbl_used >= ctx->cmdtbl_size) { struct cmdtbl_s *x; x = xtryrealloc ( ctx->cmdtbl, (ctx->cmdtbl_size+10) * sizeof *x); if (!x) return ASSUAN_Out_Of_Core; ctx->cmdtbl = x; ctx->cmdtbl_size += 50; } ctx->cmdtbl[ctx->cmdtbl_used].name = cmd_name; ctx->cmdtbl[ctx->cmdtbl_used].cmd_id = cmd_id; ctx->cmdtbl[ctx->cmdtbl_used].handler = handler; ctx->cmdtbl_used++; return 0; } int assuan_register_bye_notify (ASSUAN_CONTEXT ctx, void (*fnc)(ASSUAN_CONTEXT)) { if (!ctx) return ASSUAN_Invalid_Value; ctx->bye_notify_fnc = fnc; return 0; } int assuan_register_reset_notify (ASSUAN_CONTEXT ctx, void (*fnc)(ASSUAN_CONTEXT)) { if (!ctx) return ASSUAN_Invalid_Value; ctx->reset_notify_fnc = fnc; return 0; } int assuan_register_cancel_notify (ASSUAN_CONTEXT ctx, void (*fnc)(ASSUAN_CONTEXT)) { if (!ctx) return ASSUAN_Invalid_Value; ctx->cancel_notify_fnc = fnc; return 0; } int assuan_register_option_handler (ASSUAN_CONTEXT ctx, int (*fnc)(ASSUAN_CONTEXT, const char*, const char*)) { if (!ctx) return ASSUAN_Invalid_Value; ctx->option_handler_fnc = fnc; return 0; } int assuan_register_input_notify (ASSUAN_CONTEXT ctx, void (*fnc)(ASSUAN_CONTEXT, const char *)) { if (!ctx) return ASSUAN_Invalid_Value; ctx->input_notify_fnc = fnc; return 0; } int assuan_register_output_notify (ASSUAN_CONTEXT ctx, void (*fnc)(ASSUAN_CONTEXT, const char *)) { if (!ctx) return ASSUAN_Invalid_Value; ctx->output_notify_fnc = fnc; return 0; } /* Helper to register the standards commands */ int _assuan_register_std_commands (ASSUAN_CONTEXT ctx) { int i, rc; for (i=0; std_cmd_table[i].name; i++) { if (std_cmd_table[i].always) { rc = assuan_register_command (ctx, std_cmd_table[i].cmd_id, NULL, NULL); if (rc) return rc; } } return 0; } /* Process the special data lines. The "D " has already been removed from the line. As all handlers this function may modify the line. */ static int handle_data_line (ASSUAN_CONTEXT ctx, char *line, int linelen) { return set_error (ctx, Not_Implemented, NULL); } /* like ascii_strcasecmp but assume that B is already uppercase */ static int my_strcasecmp (const char *a, const char *b) { if (a == b) return 0; for (; *a && *b; a++, b++) { if (((*a >= 'a' && *a <= 'z')? (*a&~0x20):*a) != *b) break; } return *a == *b? 0 : (((*a >= 'a' && *a <= 'z')? (*a&~0x20):*a) - *b); } /* Parse the line, break out the command, find it in the command table, remove leading and white spaces from the arguments, all the handler with the argument line and return the error */ static int dispatch_command (ASSUAN_CONTEXT ctx, char *line, int linelen) { char *p; const char *s; int shift, i; if (*line == 'D' && line[1] == ' ') /* divert to special handler */ return handle_data_line (ctx, line+2, linelen-2); for (p=line; *p && *p != ' ' && *p != '\t'; p++) ; if (p==line) return set_error (ctx, Syntax_Error, "leading white-space"); if (*p) { /* Skip over leading WS after the keyword */ *p++ = 0; while ( *p == ' ' || *p == '\t') p++; } shift = p - line; for (i=0; (s=ctx->cmdtbl[i].name); i++) { if (!strcmp (line, s)) break; } if (!s) { /* and try case insensitive */ for (i=0; (s=ctx->cmdtbl[i].name); i++) { if (!my_strcasecmp (line, s)) break; } } if (!s) return set_error (ctx, Unknown_Command, NULL); line += shift; linelen -= shift; /* fprintf (stderr, "DBG-assuan: processing %s `%s'\n", s, line); */ return ctx->cmdtbl[i].handler (ctx, line); } static int process_request (ASSUAN_CONTEXT ctx) { int rc; if (ctx->in_inquire) return ASSUAN_Nested_Commands; rc = _assuan_read_line (ctx); if (rc) return rc; if (*ctx->inbound.line == '#' || !ctx->inbound.linelen) return 0; /* comment line - ignore */ ctx->outbound.data.error = 0; ctx->outbound.data.linelen = 0; /* dispatch command and return reply */ rc = dispatch_command (ctx, ctx->inbound.line, ctx->inbound.linelen); /* check from data write errors */ if (ctx->outbound.data.fp) { /* Flush the data lines */ fclose (ctx->outbound.data.fp); ctx->outbound.data.fp = NULL; if (!rc && ctx->outbound.data.error) rc = ctx->outbound.data.error; } else /* flush any data send w/o using the data fp */ { assuan_send_data (ctx, NULL, 0); if (!rc && ctx->outbound.data.error) rc = ctx->outbound.data.error; } /* Error handling */ if (!rc) { rc = assuan_write_line (ctx, ctx->okay_line? ctx->okay_line : "OK"); } else if (rc == -1) { /* No error checking because the peer may have already disconnect */ assuan_write_line (ctx, "OK closing connection"); ctx->finish_handler (ctx); } else { char errline[256]; if (rc < 100) sprintf (errline, "ERR %d server fault (%.50s)", ASSUAN_Server_Fault, assuan_strerror (rc)); else { const char *text = ctx->err_no == rc? ctx->err_str:NULL; sprintf (errline, "ERR %d %.50s%s%.100s", rc, assuan_strerror (rc), text? " - ":"", text?text:""); } rc = assuan_write_line (ctx, errline); } ctx->confidential = 0; if (ctx->okay_line) { xfree (ctx->okay_line); ctx->okay_line = NULL; } return rc; } /** * assuan_process: * @ctx: assuan context * * This fucntion is used to handle the assuan protocol after a * connection has been established using assuan_accept(). This is the * main protocol handler. * * Return value: 0 on success or an error code if the assuan operation * failed. Note, that no error is returned for operational errors. **/ int assuan_process (ASSUAN_CONTEXT ctx) { int rc; do { rc = process_request (ctx); } while (!rc); if (rc == -1) rc = 0; return rc; } /** * assuan_process_next: * @ctx: Assuan context * * Same as assuan_process() but the user has to provide the outer * loop. He should loop as long as the return code is zero and stop * otherwise; -1 is regular end. * * See also: assuan_get_active_fds() * Return value: -1 for end of server, 0 on success or an error code **/ int assuan_process_next (ASSUAN_CONTEXT ctx) { return process_request (ctx); } /** * assuan_get_active_fds: * @ctx: Assuan context * @what: 0 for read fds, 1 for write fds * @fdarray: Caller supplied array to store the FDs * @fdarraysize: size of that array * * Return all active filedescriptors for the given context. This * function can be used to select on the fds and call * assuan_process_next() if there is an active one. The first fd in * the array is the one used for the command connection. * * Note, that write FDs are not yet supported. * * Return value: number of FDs active and put into @fdarray or -1 on * error which is most likely a too small fdarray. **/ int assuan_get_active_fds (ASSUAN_CONTEXT ctx, int what, int *fdarray, int fdarraysize) { int n = 0; if (!ctx || fdarraysize < 2 || what < 0 || what > 1) return -1; if (!what) { if (ctx->inbound.fd != -1) fdarray[n++] = ctx->inbound.fd; } else { if (ctx->outbound.fd != -1) fdarray[n++] = ctx->outbound.fd; if (ctx->outbound.data.fp) fdarray[n++] = fileno (ctx->outbound.data.fp); } return n; } /* Set the text used for the next OK reponse. This string is automatically reset to NULL after the next command. */ AssuanError assuan_set_okay_line (ASSUAN_CONTEXT ctx, const char *line) { if (!ctx) return ASSUAN_Invalid_Value; if (!line) { xfree (ctx->okay_line); ctx->okay_line = NULL; } else { /* FIXME: we need to use gcry_is_secure() to test whether we should allocate the entire line in secure memory */ char *buf = xtrymalloc (3+strlen(line)+1); if (!buf) return ASSUAN_Out_Of_Core; strcpy (buf, "OK "); strcpy (buf+3, line); xfree (ctx->okay_line); ctx->okay_line = buf; } return 0; } void assuan_write_status (ASSUAN_CONTEXT ctx, const char *keyword, const char *text) { char buffer[256]; char *helpbuf; size_t n; if ( !ctx || !keyword) return; if (!text) text = ""; n = 2 + strlen (keyword) + 1 + strlen (text) + 1; if (n < sizeof (buffer)) { strcpy (buffer, "S "); strcat (buffer, keyword); if (*text) { strcat (buffer, " "); strcat (buffer, text); } assuan_write_line (ctx, buffer); } else if ( (helpbuf = xtrymalloc (n)) ) { strcpy (helpbuf, "S "); strcat (helpbuf, keyword); if (*text) { strcat (helpbuf, " "); strcat (helpbuf, text); } assuan_write_line (ctx, helpbuf); xfree (helpbuf); } } pinentry-x2go-0.7.5.6/assuan/assuan-listen.c0000644000000000000000000000610312070425227015527 0ustar /* assuan-listen.c - Wait for a connection (server) * Copyright (C) 2001 Free Software Foundation, Inc. * * This file is part of GnuPG. * * GnuPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * GnuPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include #include #include #include #include #include "assuan-defs.h" AssuanError assuan_set_hello_line (ASSUAN_CONTEXT ctx, const char *line) { if (!ctx) return ASSUAN_Invalid_Value; if (!line) { xfree (ctx->hello_line); ctx->hello_line = NULL; } else { char *buf = xtrymalloc (3+strlen(line)+1); if (!buf) return ASSUAN_Out_Of_Core; strcpy (buf, "OK "); strcpy (buf+3, line); xfree (ctx->hello_line); ctx->hello_line = buf; } return 0; } /** * assuan_accept: * @ctx: context * * Cancel any existing connectiion and wait for a connection from a * client. The initial handshake is performed which may include an * initial authentication or encryption negotiation. * * Return value: 0 on success or an error if the connection could for * some reason not be established. **/ AssuanError assuan_accept (ASSUAN_CONTEXT ctx) { int rc; if (!ctx) return ASSUAN_Invalid_Value; if (ctx->pipe_mode > 1) return -1; /* second invocation for pipemode -> terminate */ ctx->finish_handler (ctx); rc = ctx->accept_handler (ctx); if (rc) return rc; /* send the hello */ rc = assuan_write_line (ctx, ctx->hello_line? ctx->hello_line : "OK Your orders please"); if (rc) return rc; if (ctx->pipe_mode) ctx->pipe_mode = 2; return 0; } int assuan_get_input_fd (ASSUAN_CONTEXT ctx) { return ctx? ctx->input_fd : -1; } int assuan_get_output_fd (ASSUAN_CONTEXT ctx) { return ctx? ctx->output_fd : -1; } /* Close the fd descriptor set by the command INPUT FD=n. We handle this fd inside assuan so that we can do some initial checks */ AssuanError assuan_close_input_fd (ASSUAN_CONTEXT ctx) { if (!ctx || ctx->input_fd == -1) return ASSUAN_Invalid_Value; close (ctx->input_fd); ctx->input_fd = -1; return 0; } /* Close the fd descriptor set by the command OUTPUT FD=n. We handle this fd inside assuan so that we can do some initial checks */ AssuanError assuan_close_output_fd (ASSUAN_CONTEXT ctx) { if (!ctx || ctx->output_fd == -1) return ASSUAN_Invalid_Value; close (ctx->output_fd); ctx->output_fd = -1; return 0; } pinentry-x2go-0.7.5.6/assuan/assuan-pipe-server.c0000644000000000000000000000540012070425227016471 0ustar /* assuan-pipe-server.c - Assuan server working over a pipe * Copyright (C) 2001 Free Software Foundation, Inc. * * This file is part of GnuPG. * * GnuPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * GnuPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include #include #include #include "assuan-defs.h" static void deinit_pipe_server (ASSUAN_CONTEXT ctx) { /* nothing to do for this simple server */ } static int accept_connection (ASSUAN_CONTEXT ctx) { /* This is a NOP for a pipe server */ return 0; } static int finish_connection (ASSUAN_CONTEXT ctx) { /* This is a NOP for a pipe server */ return 0; } /* Create a new context. Note that the handlers are set up for a pipe server/client - this wau we don't need extra dummy functions */ int _assuan_new_context (ASSUAN_CONTEXT *r_ctx) { ASSUAN_CONTEXT ctx; int rc; *r_ctx = NULL; ctx = xtrycalloc (1, sizeof *ctx); if (!ctx) return ASSUAN_Out_Of_Core; ctx->input_fd = -1; ctx->output_fd = -1; ctx->inbound.fd = -1; ctx->outbound.fd = -1; ctx->listen_fd = -1; ctx->client_pid = (pid_t)-1; /* use the pipe server handler as a default */ ctx->deinit_handler = deinit_pipe_server; ctx->accept_handler = accept_connection; ctx->finish_handler = finish_connection; rc = _assuan_register_std_commands (ctx); if (rc) xfree (ctx); else *r_ctx = ctx; return rc; } int assuan_init_pipe_server (ASSUAN_CONTEXT *r_ctx, int filedes[2]) { int rc; rc = _assuan_new_context (r_ctx); if (!rc) { ASSUAN_CONTEXT ctx = *r_ctx; ctx->is_server = 1; ctx->inbound.fd = filedes[0]; ctx->outbound.fd = filedes[1]; ctx->pipe_mode = 1; } return rc; } void _assuan_release_context (ASSUAN_CONTEXT ctx) { if (ctx) { xfree (ctx->hello_line); xfree (ctx->okay_line); xfree (ctx); } } void assuan_deinit_server (ASSUAN_CONTEXT ctx) { if (ctx) { /* We use this function pointer to avoid linking other server when not needed but still allow for a generic deinit function */ ctx->deinit_handler (ctx); ctx->deinit_handler = NULL; _assuan_release_context (ctx); } } pinentry-x2go-0.7.5.6/assuan/assuan-util.c0000644000000000000000000000765612070425227015224 0ustar /* assuan-util.c - Utility functions for Assuan * Copyright (C) 2001 Free Software Foundation, Inc. * * This file is part of GnuPG. * * GnuPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * GnuPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include #include #include #include #include "assuan-defs.h" #ifdef HAVE_JNLIB_LOGGING #include "../jnlib/logging.h" #endif static void *(*alloc_func)(size_t n) = malloc; static void *(*realloc_func)(void *p, size_t n) = realloc; static void (*free_func)(void*) = free; void assuan_set_malloc_hooks ( void *(*new_alloc_func)(size_t n), void *(*new_realloc_func)(void *p, size_t n), void (*new_free_func)(void*) ) { alloc_func = new_alloc_func; realloc_func = new_realloc_func; free_func = new_free_func; } void * _assuan_malloc (size_t n) { return alloc_func (n); } void * _assuan_realloc (void *a, size_t n) { return realloc_func (a, n); } void * _assuan_calloc (size_t n, size_t m) { void *p = _assuan_malloc (n*m); if (p) memset (p, 0, n* m); return p; } void _assuan_free (void *p) { if (p) free_func (p); } /* Store the error in the context so that the error sending function can take out a descriptive text. Inside the assuan code, use the macro set_error instead of this function. */ int assuan_set_error (ASSUAN_CONTEXT ctx, int err, const char *text) { ctx->err_no = err; ctx->err_str = text; return err; } void assuan_set_pointer (ASSUAN_CONTEXT ctx, void *pointer) { if (ctx) ctx->user_pointer = pointer; } void * assuan_get_pointer (ASSUAN_CONTEXT ctx) { return ctx? ctx->user_pointer : NULL; } void assuan_set_log_stream (ASSUAN_CONTEXT ctx, FILE *fp) { if (ctx) { if (ctx->log_fp) fflush (ctx->log_fp); ctx->log_fp = fp; } } void assuan_begin_confidential (ASSUAN_CONTEXT ctx) { if (ctx) { ctx->confidential = 1; } } void assuan_end_confidential (ASSUAN_CONTEXT ctx) { if (ctx) { ctx->confidential = 0; } } void _assuan_log_print_buffer (FILE *fp, const void *buffer, size_t length) { const unsigned char *s; int n; for (n=length,s=buffer; n; n--, s++) { if (*s < ' ' || (*s >= 0x7f && *s <= 0xa0)) break; } s = buffer; if (!n && *s != '[') fwrite (buffer, length, 1, fp); else { putc ('[', fp); for (n=0; n < length; n++, s++) fprintf (fp, " %02x", *s); putc (' ', fp); putc (']', fp); } } /* print a user supplied string after filtering out potential bad characters*/ void _assuan_log_sanitized_string (const char *string) { const unsigned char *s = (const unsigned char*)string; #ifdef HAVE_JNLIB_LOGGING FILE *fp = log_get_stream (); #else FILE *fp = stderr; #endif for (; *s; s++) { if (*s < 0x20 || (*s >= 0x7f && *s <= 0xa0)) { putc ('\\', fp); if (*s == '\n') putc ('n', fp); else if (*s == '\r') putc ('r', fp); else if (*s == '\f') putc ('f', fp); else if (*s == '\v') putc ('v', fp); else if (*s == '\b') putc ('b', fp); else if (!*s) putc ('0', fp); else fprintf (fp, "x%02x", *s ); } else putc (*s, fp); } } pinentry-x2go-0.7.5.6/assuan/ChangeLog0000644000000000000000000001717312070425227014360 0ustar 2008-02-14 Werner Koch * assuan.h (ASSUAN_Parameter_Error): Add new alias. 2008-01-10 Marcus Brinkmann * assuan-handler.c (dispatch_command): Use Syntax_Error instead of Invalid_Command. * assuan.h (assuan_error_t): Change all error codes to gpg-error codes. 2004-12-22 Werner Koch * assuan.h (assuan_error_t, assuan_context_t): New aliases. * assuan-buffer.c (readline): Renamed EOF to ISEOF to avoid compiler warnings. 2004-04-20 Werner Koch * mkerrors: Add missing last LF. 2004-01-30 Werner Koch * assuan-inquire.c, assuan-connect.c, assuan-client.c * assuan-socket-server.c, assuan-pipe-connect.c * assuan-socket-connect.c: Removed. * assuan-handler.c (assuan_get_data_fp): Removed. 2003-12-23 Werner Koch * Makefile.am (EXTRA_DIST): Added Manifest. * Manifest: Added. 2003-12-22 Werner Koch * assuan.h (ASSUAN_Locale_Problem): Added. 2002-04-04 Werner Koch * assuan-buffer.c (my_log_prefix): New. Use it for all i/o debug output. 2002-03-06 Werner Koch * assuan-client.c (_assuan_read_from_server): Detect END. (assuan_transact): Pass it to the data callback. 2002-02-27 Werner Koch * assuan-client.c (assuan_transact): Add 2 more arguments to support status lines. Passing NULL yields the old behaviour. * assuan-handler.c (process_request): Flush data lines send without using the data fp. 2002-02-14 Werner Koch * assuan-inquire.c (assuan_inquire): Check for a cancel command and return ASSUAN_Canceled. Allow for non-data inquiry. * assuan.h: Add a few token specific error codes. 2002-02-13 Werner Koch * assuan-defs.h (assuan_context_s): New var CLIENT_PID. * assuan-pipe-server.c (_assuan_new_context): set default value. * assuan-socket-server.c (accept_connection): get the actual pid. 2002-02-12 Werner Koch * assuan-buffer.c (writen,readline) [USE_GNU_PT]: Use pth_read/write. * assuan-socket-server.c (accept_connection) [USE_GNU_PTH]: Ditto. 2002-02-01 Marcus Brinkmann * Makefile.am (MOSTLYCLEANFILES): New variable. 2002-01-23 Werner Koch * assuan-socket-connect.c (LOGERRORX): and removed typo. 2002-01-22 Marcus Brinkmann * assuan-socket-connect.c (LOGERRORX): Reverse arguments to fputs. 2002-01-21 Werner Koch * assuan-connect.c: Move all except assuan_get_pid to... * assuan-pipe-connect.c: this. (assuan_pipe_disconnect): Removed. (do_finish, do_deinit): New (assuan_pipe_connect): and set them into the context. * assuan-socket-connect.c: New. * assuan-util.c (_assuan_log_sanitized_string): New. * assuan-pipe-server.c (assuan_init_pipe_server): Factored most code out to ... (_assuan_new_context): new func. (_assuan_release_context): New * assuan-connect.c (assuan_pipe_connect): Use the new functions. 2002-01-20 Werner Koch * assuan.h: Added Invalid Option error code. * assuan-handler.c (std_handler_option): New. (std_cmd_tbl): Add OPTION as standard command. (assuan_register_option_handler): New. (dispatch_command): Use case insensitive matching as a fallback. (my_strcasecmp): New. 2002-01-19 Werner Koch * assuan-buffer.c (_assuan_read_line): Add output logging. (assuan_write_line): Ditto. (_assuan_cookie_write_data): Ditto. (_assuan_cookie_write_flush): Ditto. * assuan-util.c (_assuan_log_print_buffer): New. (assuan_set_log_stream): New. (assuan_begin_confidential): New. (assuan_end_confidential): New. * assuan-defs.h: Add a few handler variables. * assuan-pipe-server.c (assuan_deinit_pipe_server): Removed. (deinit_pipe_server): New. (assuan_deinit_server): New. Changed all callers to use this. * assuan-listen.c (assuan_accept): Use the accept handler. * assuan-handler.c (process_request): Use the close Handler. * assuan-socket-server.c: New. 2002-01-14 Werner Koch * assuan-client.c (_assuan_read_from_server): Skip spaces after the keyword. 2002-01-03 Werner Koch * assuan-handler.c (assuan_set_okay_line): New. (process_request): And use it here. 2002-01-02 Werner Koch * assuan-inquire.c (init_membuf,put_membuf,get_membuf): Apply a hidden 0 behind the buffer so that the buffer can be used as a string in certain contexts. 2001-12-14 Marcus Brinkmann * assuan-connect.c (assuan_pipe_connect): New argument FD_CHILD_LIST. Don't close those fds. * assuan.h: Likewise for prototype. 2001-12-14 Werner Koch * assuan-listen.c (assuan_close_input_fd): New. (assuan_close_output_fd): New. * assuan-handler.c (std_handler_reset): Always close them after a reset command. (std_handler_bye): Likewise. 2001-12-14 Marcus Brinkmann * assuan-buffer.c (_assuan_read_line): New variable ATTICLEN, use it to save the length of the attic line. Rediddle the code a bit to make it more clear what happens. 2001-12-14 Marcus Brinkmann * assuan-defs.h (LINELENGTH): Define as ASSUAN_LINELENGTH. assuan.h: Define ASSUAN_LINELENGTH. 2001-12-13 Marcus Brinkmann * assuan-buffer.c (assuan_read_line): Fix order of execution to get correct return values. 2001-12-13 Werner Koch * assuan-handler.c (assuan_get_active_fds): Fixed silly bug, pretty obvious that nobody ever tested this function. 2001-12-12 Werner Koch * assuan-connect.c (assuan_pipe_connect): Implemented the inital handshake. * assuan-client.c (read_from_server): Renamed to (_assuan_read_from_server): this and made external. * assuan-listen.c (assuan_set_hello_line): New. (assuan_accept): Use a custom hello line is available. * assuan-buffer.c (assuan_read_line): New. (assuan_pending_line): New. (_assuan_write_line): Renamed to .. (assuan_write_line): this, made public and changed all callers. 2001-12-04 Werner Koch * assuan-connect.c (assuan_pipe_connect): Add more error reporting. * assuan-client.c: New. * assuan-inquire.c: New. * assuan-handler.c (process_request): Check for nested invocations. 2001-11-27 Werner Koch * assuan-handler.c (assuan_register_input_notify): New. (assuan_register_output_notify): New. 2001-11-26 Werner Koch * assuan.h: Added more status codes. 2001-11-25 Werner Koch * assuan-handler.c (assuan_register_bye_notify) (assuan_register_reset_notify) (assuan_register_cancel_notify): New and call them from the standard handlers. (assuan_process): Moved bulk of function to .. (process_request): .. new. (assuan_process_next): One shot version of above. (assuan_get_active_fds): New. 2001-11-24 Werner Koch * assuan-connect.c (assuan_get_pid): New. * assuan-buffer.c (_assuan_read_line): Deal with reads of more than a line. * assuan-defs.h: Add space in the context for this. ************************************************************ * Please note that this is a stripped down Assuan version. * ************************************************************ Copyright 2001, 2002, 2004 Free Software Foundation, Inc. This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without modifications, as long as this notice is preserved. This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. pinentry-x2go-0.7.5.6/assuan/Makefile.am0000644000000000000000000000245212070425227014634 0ustar # Assuan Makefile for test purposes # Copyright (C) 2001 Free Software Foundation, Inc. # # This file is part of GnuPG. # # GnuPG is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # GnuPG is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA ## Process this file with automake to produce Makefile.in EXTRA_DIST = mkerrors Manifest INCLUDES = -I.. -I$(top_srcdir)/include BUILT_SOURCES = assuan-errors.c MOSTLYCLEANFILES = assuan-errors.c noinst_LIBRARIES = libassuan.a #libassuan_a_LDFLAGS = libassuan_a_SOURCES = \ assuan.h \ assuan-defs.h \ assuan-util.c \ assuan-errors.c \ assuan-buffer.c \ assuan-handler.c \ assuan-listen.c \ assuan-pipe-server.c assuan-errors.c : assuan.h $(srcdir)/mkerrors < $(srcdir)/assuan.h > assuan-errors.c pinentry-x2go-0.7.5.6/assuan/mkerrors0000755000000000000000000000335112070425227014371 0ustar #!/bin/sh # mkerrors - Extract error strings from assuan.h # and create C source for assuan_strerror # Copyright (C) 2001 Free Software Foundation, Inc. # # This file is part of GnuPG. # # GnuPG is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # GnuPG is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA cat < #include "assuan.h" /** * assuan_strerror: * @err: Error code * * This function returns a textual representaion of the given * errorcode. If this is an unknown value, a string with the value * is returned (Beware: it is hold in a static buffer). * * Return value: String with the error description. **/ const char * assuan_strerror (AssuanError err) { const char *s; static char buf[25]; switch (err) { EOF awk ' /ASSUAN_No_Error/ { okay=1 } !okay {next} /}/ { exit 0 } /ASSUAN_[A-Za-z_]*/ { print_code($1) } function print_code( s ) { printf " case %s: s=\"", s ; gsub(/_/, " ", s ); printf "%s\"; break;\n", tolower(substr(s,8)); } ' cat < Security related bug reports: License: GPLv2+ Oleksandr Shneyder Mike Gabriel Robert Bihlmeyer Werner Koch, g10 Code GmbH Steffen Hansen, Klarälvdalens Datakonsult AB Marcus Brinkmann, g10 Code GmbH Timo Schulz, g10 Code GmbH pinentry-x2go-0.7.5.6/ChangeLog.pinentry-gnupg0000644000000000000000000015516112070425227016053 0ustar This file contains all changes of the underlying GnuPG pinentry tool -------------------------------------------------------------------- After the top date, the X2Go fork has begun... Mike Gabriel, 20120613 ====== 2008-02-15 Werner Koch Release 0.7.4. 2008-02-14 Werner Koch * configure.ac: Check for -Wno-pointer-sign. * pinentry/pinentry.c (cmd_getinfo): New. (register_commands): Register it. 2008-01-02 Marcus Brinkmann * configure.ac: Use PKG_CONFIG instead of PKGCONFIG and pkg-config. Use AC_PATH_PROG instead of AC_CHECK_PROG. * Makefile.am (install-exec-local): Add exe extension to link. 2007-11-29 Marcus Brinkmann Released 0.7.4. 2007-11-19 Werner Koch * doc/pinentry.texi (Protocol): Typo fixes by Bernhard Herzog. Describe SETQUALITYBAR_TT. 2007-11-19 Bernhard Herzog (wk) * qt/pinentrydialog.cpp (PinEntryDialog): Fixed crash 2007-11-19 Werner Koch * gtk+-2/pinentry-gtk-2.c (create_window): Use again map-event and unmap-event as this works on my setup far more reliable than expose-event/no-expose-event. * gtk+-2/gtksecentry.c (get_cursor_time): s/time/blinktime/ t avoid shadowing warning. * pinentry/pinentry.h (struct pinentry): Change QUALITY_BAR to a char ptr. (struct pinentry): Add QUALITY_BAR_TT. * pinentry/pinentry.c (cmd_setqualitybar): Allow to set a label text. (cmd_setqualitybar_tt): New. * gtk+-2/pinentry-gtk-2.c (create_window): Take label and tooltip from global. * qt/pinentrydialog.h (setQualityBar, setQualityBarTT) (_quality_bar_label): New. * qt/pinentrydialog.cpp (setQualityBar, setQualityBarTT): New. (PinEntryDialog): Remove setting of tooltip. * qt/main.cpp (qt_cmd_handler): Propagate quality bar label and tootip. 2007-11-19 Bernhard Herzog (wk) * qt/pinentrydialog.cpp (PinEntryDialog): Move the quality bar below the text entry and align them properly. Show a tooltip. * gtk+-2/pinentry-gtk-2.c (create_window): Ditto. Don't let it change its height. (QUALITYBAR_EMPTY_TEXT): New. 2007-09-18 Werner Koch * qt/secqlineedit.h (SecQLineEdit): New signal textModified. * qt/secqlineedit.cpp (finishChange): Emit it. * qt/pinentrydialog.cpp (setPinentryInfo): New. (PinEntryDialog): Add arg ENABLE_QUALITY_BAR. * qt/pinentrydialog.h (setPinentryInfo): New. (PinEntryDialog): Add arg ENABLE_QUALITY_BAR. * pinentry/pinentry.h (struct pinentry): Add member QUALITY_BAR and CTX_ASSUAN. * pinentry/pinentry.c (cmd_setqualitybar): New. (copy_and_escape): New. (pinentry_inq_quality): New. 2007-07-09 Werner Koch * doc/pinentry.texi: Fixed direntry syntax. * configure.ac: Add --without-libcap. From the Gentoo patch archive. * gtk+-2/pinentry-gtk-2.c (create_window): Use expose-event instead of map-event. From Alon Bar-Lev. 2007-07-06 Werner Koch Released 0.7.3. * config.sub, config.guess: Updated from current Savannah CVS. 2007-06-27 Werner Koch * w32/main.c: Revamped the SetFocus stuff. It is all not that easy. 2007-06-26 Werner Koch * w32/Makefile.am (pinentry_w32_LDFLAGS): Add -mconsole again. * w32/main.c (dlg_proc): Set focus. (resize_button): New. No code yet. (dlg_proc): Call it for the buttons. (w32_cmd_handler): Restore old foreground window. 2007-06-20 Werner Koch * w32/Makefile.am (pinentry_w32_LDFLAGS): Remove -mconsole. * w32/main.c (wchar_to_utf8): New. (ok_button_clicked): Use it. (utf8_to_wchar): New. (set_dlg_item_text): New. (dlg_proc): Use new function so that we are able to correctly display all prompts. (main): Load LockSetForegroundWindow. (dlg_proc): Call LockSetForegroundWindow via its fnc ptr. (center_window): New. Taken from GPGol. (dlg_proc): Call it. (w32_cmd_handler): Revamped the confirm mode. 2007-06-18 Werner Koch * w32/main.c (dlg_proc): Call LockSetForegroundWindow. * Makefile.am (signed-dist, %.sig): Remove. * autogen.sh: Modernized. 2007-05-10 Marcus Brinkmann * pinentry/pinentry.h (pinentry_color_t): New type. (struct pinentry): New members COLOR_FG, COLOR_FG_BRIGHT, COLOR_BG, COLOR_SO. * pinentry/pinentry.c (pinentry_parse_opts): Support new option --colors. (parse_color): New function. * pinentry/pinentry-curses.c (USE_COLORS): New macro. (pinentry_color): New static variable. (dialog_create): Redo color management. * pinentry/pinentry-curses.c (dialog_create): Re-add calculation of cancel button position. Adjust calculation of OK button position if it is the only one used. 2007-04-13 Marcus Brinkmann * qt/secqlineedit.h (SecQLineEdit::contextMenuEvent, SecQLineEdit::createPopupMenu): Remove prototype. * qt/secqlineedit.cpp (SecQLineEdit::contextMenuEvent, SecQLineEdit::createPopupMenu): Remove implementation. Submitted by Tobias Koenig . 2007-02-14 Werner Koch * pinentry/pinentry.h (struct pinentry): Add TOUCH_FILE. * pinentry/pinentry.c (option_handler): New option "touch-file". (pinentry_have_display): Ignore an empty DISPLAY. * pinentry/pinentry-curses.c (do_touch_file): New. (curses_cmd_handler): Call it. * configure.ac: Check for utime.h. 2007-01-24 Werner Koch * pinentry/pinentry.c (cmd_message): New. (cmd_confirm): New command option --one-button. (cmd_getpin): Zeroise ONE_BUTTON. * pinentry/pinentry.h (struct pinentry): Add field ONE_BUTTON. * gtk/pinentry-gtk.c (create_window): Take care of new option. * gtk+-2/pinentry-gtk-2.c (create_window): Ditto. * pinentry/pinentry-curses.c (dialog_create): Ditto. (dialog_create, dialog_switch_pos): Allow CANCEL to be optional. 2006-07-29 Marcus Brinkmann * secmem/secmem.c (init_pool): Close FD after establishing the mapping. 2005-09-28 Marcus Brinkmann * configure.ac (PINENTRY_GTK): Error out if iconv is not found but needed. * config.rpath: New file from gettext. Needed by iconv.m4. 2005-07-11 Marcus Brinkmann * pinentry/pinentry-curses.c (dialog_switch_pos): Set the cursor state to invisible before moving around. Move the cursor to the beginning of the dialog buttons for accessibility. 2005-06-16 Marcus Brinkmann * pinentry/pinentry-curses.c (dialog_run): Only convert pin if a pin actually exists. 2005-01-27 Werner Koch Released 0.7.2. * gtk+-2/Makefile.am: Removed padlock-keyhole.xpm. * configure.ac: Use AC_GNU_SOURCE instead of the custom define. Prefer gtk2 pinentry over qt. 2005-01-21 Marcus Brinkmann * doc/pinentry.texi: Fix spelling errors. Submitted by Ville Skyttä. 2004-12-23 Werner Koch * w32/pinentry-w32.rc: Remove the default texts for description, prompt and error. Make it system modal. Enlarge the description field. 2004-12-22 Timo Schulz * w32/main.c: Remove all helper functions and use a callback to set the dialog items directly. (dlg_proc): Set 'result' to -1 to indicate cancel. (ok_button_clicked): Adjusted. Set 'result' to the len of the PIN to indicate success. 2004-12-22 Werner Koch * w32/main.c: Simplified. * w32/dialog.h, w32/dialog.c, w32/controller.h, w32/controller.c: Removed * w32/resource.h, w32/pinentry-w32.rc, w32/main.c, w32/dialog.h * w32/dialog.c, w32/controller.h, w32/controller.c * w32/Makefile.am: New. Based on Timo's work. Update to automake 1.9. * autogen.sh (configure_ac): Add --build-w32 option. * Makefile.am: Support for the W32 pinentry. * configure.ac: Ditto. Reformatted some error messages. Define the usual conditionals for W32. Check for a couple of more usually required headers. * pinentry/pinentry.h (sleep) [W32]: New. * pinentry/pinentry.c: Include langinfo.h only if available. (pinentry_loop) [DOSISH]: Don't do uid check. * secmem/util.c [DOSISH]: Disable UID stuff. 2004-09-27 Marcus Brinkmann * acinclude.m4 (IU_LIB_NCURSES, IU_LIB_CURSES, IU_LIB_TERMCAP): Moved to m4/curses.m4. (AM_ICONV): Moved to m4/iconv.m4. (AM_PATH_GLIB): Moved to m4/glib.m4. (QT_FIND_FILE, QT_PATH_MOC, QT_PATH_X, QT_PRINT_PROGRAM, QT_CHECK_VERSION, QT_PATH_1_3, QT_PATH, QT_CHECK_COMPILER_FLAG, QT_REMOVE_FORBIDDEN, QT_VALIDIFY_CXXFLAGS, QT_CHECK_COMPILERS, QT_CHECK_RPATH, QT_CHECK_LIBPTHREAD, QT_CHECK_PTHREAD_OPTION, QT_CHECK_THREADING): Move to m4/qt.m4. 2004-09-21 Marcus Brinkmann * qt/Makefile.am (pinentry_qt_LDFLAGS): Add $(QT_RPATH). Requested by Leo Savernik . 2004-09-02 Marcus Brinkmann * gtk+-2/padlock-keyhole.xpm: File removed. * gtk+-2/pinentry-gtk-2.c (create_window): Use stock icon. * gtk+-2/gtksecentry.h, gtk+-2/gtksecentry.c: Fix copyright notice. Submitted by Albrecht Dress albrecht.dress@arcor.de. 2004-08-17 Marcus Brinkmann * configure.ac: Invoke AC_PROG_LN_S. (PINENTRY_DEFAULT): New variable. Substitute it. Fail if no default can be determined. * Makefile.am (install-exec-local): Install pinentry default link. * configure.ac: Check for Gtk+-2. * gtk+-2: New directory with gtk+-2 pinentry. * gtk+-2/Makefile.am, gtk+-2/gtksecentry.h, gtk+-2/gtksecentry.c, gtk+-2/pinentry-gtk-2.c, gtk+-2/padlock-keyhole.xpm: New files. * Makefile.am (pinentry_gtk_2): New variable. (SUBDIRS): Add pinentry_gtk_2. Submitted by Albrecht Dress albrecht.dress@arcor.de. 2004-08-04 Werner Koch * pinentry/pinentry.c (usage): Print help to stdout. 2004-07-30 Moritz Schulte * qt/Makefile.am (ncurses_include): Removed -I$(top_srcdir)/pinentry ... (AM_CPPFLAGS): ... added: -I$(top_srcdir)/pinentry. Thanks to Peter Eisentraut. * pinentry/pinentry.c (pinentry_utf8_to_local): Declare INPUT const. (pinentry_local_to_utf8): Likewise. (pinentry_utf8_to_local, pinentry_local_to_utf8): Compile only, if either Curses or GTK+ support is enabled. * configure.ac: Do also check for libiconv when the GTK+ version of pinentry is to be build. Define PINENTRY_CURSES, PINENTRY_GTK, PINENTRY_QT depending on which versions of pinentry should be build. 2004-05-21 Marcus Brinkmann * acinclude.m4 (QT_CHECK_DIRECT): Removed. (QT_PATH_1_3): Do never invoke QT_CHECK_DIRECT. 2004-04-21 Werner Koch Released 0.7.1. 2004-04-20 Werner Koch * secmem/secmem.c [!ORIGINAL_GPG_VERSION]: Include util.h for some typedefs and protos. (secmem_free, secmem_term): Use wipememory2 instead of memset. * autogen.sh (configure_ac): Fixed version check (s/==/=/). 2004-04-02 Thomas Schwinge * autogen.sh: Added ACLOCAL_FLAGS. 2004-02-23 Marcus Brinkmann * qt/main.cpp: Include "pinentry.h", not . 2004-01-30 Werner Koch * configure.ac (fopencookie): Remove that test. 2004-01-28 Moritz Schulte * gtk/gtksecentry.c: (gtk_secure_entry_key_press): Treat GDK_KP_Enter just like GDK_Return. 2004-01-18 Marcus Brinkmann * qt/secqstring.cpp: Do not include "private/qunicodetables_p.h". (isRightToLeft): De-optimize direction query. * qt/secqinternal_p.h, qt/secqinternal.cpp: New files. * qt/Makefile.am (pinentry_qt_SOURCES): Add secqinternal_p.h and secqinternal.cpp. (EXTRA_DIST): Add README.SecQ. * qt/secqlineedit.cpp: Include "secqinternal_p.h". (drawContents): Use SecQSharedDoubleBuffer. 2004-01-02 Werner Koch * configure.ac: Early check for a c++ compiler. 2003-12-23 Werner Koch Released 0.7.0. Added Manifest files to all directories. 2003-12-22 Werner Koch * qt/main.cpp: Include errno.h. (main): Translate the --display option to -display, so that the Qt init code can grasp it. * doc/ChangeLog: Removed and merged with this file. * doc/pinentry.texi: Cleaned up. * doc/fdl.texi: Removed. * pinentry/pinentry.h (struct pinentry): Added LOCALE_ERR. * gtk/pinentry-gtk.c (button_clicked): Set the LOCAE_ERR flag. * pinentry/pinentry-curses.c (dialog_run): Ditto. * pinentry/pinentry.c (cmd_getpin, cmd_confirm): Check this flag. (pinentry_local_to_utf8): Release the correct buffer in the error case. Print diagnostics. (pinentry_utf8_to_local): Print diagnostics. (pinentry_parse_opts): Make short options work. (pinentry_utf8_to_local): Pass nl_langinfo to iconv_open. * gtk/pinentry-gtk.c (button_clicked): Use the right value as input for the conversion. * pinentry/pinentry.c: New variable THIS_PGMNAME. (pinentry_init): Add arg PGMNAME and store it. Use it at all marked placed instead of the constant "pinentry". (usage): Use it here too. * curses/pinentry-curses.c (main): Call pinentry_init with our name. * qt/main.cpp (main): Ditto. * gtk/pinentry-gtk.c (main): Ditto. * configure.ac: Check for mmap. * secmem/util.h (wipememory2,wipememory,wipe): New. * secmem/util.c (wipe): Removed. * secmem/util.c (lower_privs, raise_privs): Commented out. * pinentry/pinentry.c (pinentry_loop): Add paranoia check for dropped privs. * secmem/secmem.c (lock_pool): Cleanup syntax of cpp directives. * gtk/pinentry-gtk.c (main): Print package name in the version line. * curses/pinentry-curses.c (main): Ditto. * qt/main.cpp (main): Ditto. Fixed typo. * gtk/pinentry-gtk.c: Include memory.h. 2003-12-20 Marcus Brinkmann * pinentry/pinentry.h (struct pinentry): New member PARENT_WID. * pinentry/pinentry.c (pinentry): Add new member here. (usage): Add --parent-wid. (pinentry_parse_opts): Add case for "parent-wid". (option_handler): Same here. 2003-12-19 Marcus Brinkmann * pinentry/pinentry.c (cmd_setcancel): Use strcpy_escaped. (cmd_setok): Likewise. (cmd_setprompt): Likewise. (pinentry_utf8_to_local): Don't use nl_langinfo, but just lc_ctype directly. * pinentry/pinentry.c (cmd_getpin): Do not convert passphrase to UTF-8 here. * gtk/pinentry-gtk.c (button_clicked): Convert passphrase to UTF8 here. * pinentry/pinentry-curses.c (dialog_run): Likewise. 2003-12-14 Marcus Brinkmann * pinentry/pinentry.c (pinentry_init): Register secmem_term as atexit function. Set assuan malloc hooks to secmem. (pinentry_parse_opts): Add break statement to silence gcc warning. * pinentry/pinentry.c (cmd_getpin): If canceled, release and clear PINENTRY->pin nevertheless. * acinclude.m4 (qt_incdirs): Add /usr/include/qt3. * qt/Makefile.am (pinentry_qt_SOURCES): Remove cppmemory.h, cppmemory.cpp, pinentrycontroller.h, pinentrycontroller.cpp. (nodist_pinentry_qt_SOURCES): Remove pinentrycontroller.moc.cpp. (libcurses): Move ../pinentry/libpinentry.a from here to ... (pinentry_qt_LDADD): ... here. Change order a bit to make it work. * qt/cppmemory.h, qt/cppmemory.cpp, qt/pinentrycontroller.h, qt/pinentrycontroller.cpp: Files removed. * qt/secqstring.h, qt/secqstring.cpp, secqlineedit.h, secqlineedit.cpp: New files. * qt/Makefile.am (pinentry_qt_SOURCES): Add secqstring.h, secqstring.cpp, secqlineedit.h, and secqlineedit.cpp. (nodist_pinentry_qt_SOURCES): Add secqlineedit.moc.cpp. * qt/main.cpp: Do not include "memory.h" or "secmem-util.h", nor or "pinentrycontroller.h". Include , , and "secqstring.h". Always include . [USE_KDE]: Remove all instances. (curses_main): Function removed. (my_new_handler): Likewise. (qt_main): Likewise. (qt_cmd_handler): New function. (pinentry_cmd_handler): Define always (to qt_cmd_handler). (main): Rewritten. * qt/pinentrydialog.cpp: Do not include , but "secqlineedit.h". (PinEntryDialog::PinEntryDialog): Make _edit a SecQLineEdit object. Connect accepted SIGNAL to accept SLOT, and rejected SIGNAL to reject SLOT. (PinEntryDialog::setText): Make argument SecQString rather than QString. (PinEntryDialog::text): Likewise for return value. * qt/pinentrydialog.h: Declare SecQString and SecQLineEdit classes. (class PinEntryDialog): Disable property text (for now). Adjust argument of setText and return value of text, as well as type of _edit. 2003-12-09 Werner Koch * README.CVS: New. * Makefile.am (EXTRA_DIST): Add README.CVS (ACLOCAL_AMFLAGS): New. * configure.ac: Added min_automake_versions. * autogen.sh: Revamped. 2003-04-23 Steffen Hansen * configure.ac: Version 0.6.10-cvs 2003-04-23 Steffen Hansen * configure.ac: Version 0.6.9 * qt/Makefile.am: Added moc files to DISTCLEANFILES * qt/pinentrycontroller.cpp: Dont spew assuan debug stuff out on stderr. 2003-03-26 Steffen Hansen * qt/cppmemory.cpp, qt/main.cpp: Only override array allocation operators. This should take care of the reported memory-problems and even make pinentry-qt use a bit less memory. 2003-02-15 Steffen Hansen * qt/pinentrydialog.h, qt/pinentrydialog.cpp: Added icons for error/non-error messages. 2003-02-07 Marcus Brinkmann Released 0.6.8. 2003-02-04 Steffen Hansen * qt/main.cpp: Work around '--display' option. This fixes the pinentry-qt problem reported by several people lately. 2003-01-24 Werner Koch * autogen.sh: Print a hint to use maintainer mode. 2002-12-24 Marcus Brinkmann * pinentry/pinentry-curses.c (collect_line): New function. (COPY_OUT, MAKE_BUTTON): New macros. (dialog_create): Rewrite the initializing code and the description calculation routine with word wrapping. 2002-11-20 Werner Koch Released 0.6.7. * pinentry/pinentry-curses.c (dialog_create): Better truncate lines than to go into an infinite loop. We need to implement word wrap. (dialog_run): Add DIALOG_POS_NONE to switch so prevent a warning. 2002-11-12 Werner Koch * config.sub, config.guess: Updated from ftp.gnu.org/gnu/config to version 2002-11-08. 2002-11-09 Werner Koch Released 0.6.6. 2002-11-08 Werner Koch * pinentry/pinentry-curses.c (convert_utf8_string): Renamed to * pinentry/pinentry.c (pinentry_utf8_to_local): this. Changed callers. (pinentry_local_to_utf8): New. (cmd_getpin): Convert result back to UTF-8. * gtk/pinentry-gtk.c (create_utf8_label): New. (create_window): Use it here to set the prompts. 2002-11-06 Werner Koch * pinentry/pinentry-curses.c (dialog_run): Fixed retrun value tests for fopen. 2002-11-05 Werner Koch * secmem/util.c (init_uids): Make it a prototype. * gtk/pinentry-gtk.c (enter_callback): Changed argument name to avoid shadowing warning. (create_window): Removed unused variable I. (ok): Not used, commented. * pinentry/pinentry.c: Include headers for getpid and sleep prototypes. * secmem/util.h: Correctly declare functions taking no args. * gtk/pinentry-gtk.c: Move gtk headers to the top to avoid compiler warnings about shadowing index etc. * curses/pinentry-curses.c: Include stdio.h for the printf prototype. * pinentry/pinentry-curses.c (dialog_switch_pos): Return a value. * pinentry/pinentry.c (pinentry_have_display): New. (pinentry_setbufferlen): Must return a value. Fixed documentation. (usage): Print a question mark as a substitue for the program name. * gtk/pinentry-gtk.c (main): use it here instead of getenv(). * qt/main.cpp (main): Ditto. 2002-10-11 Werner Koch * configure.ac, Makefile.am: Added doc/ and tests for makeinfo * doc/pinentry.texi, doc/Makefile.am: New. * doc/gpl.texi, doc/fdl.texi: Added these standard files. 2002-09-30 Werner Koch Released 0.6.5. * qt/pinentrycontroller.cpp (optionHandler): Make sure that a value is returned. * configure.ac: Use -Wall also for C++. 2002-08-19 Steffen Hansen * Relased 0.6.4. 2002-08-11 Steffen Hansen * Adapted pinentry-qt to new CONFIRM spec. 2002-06-26 Werner Koch Release 0.6.3. 2002-05-24 Werner Koch * AUTHORS: Added Marcus * README: Fixed spelling of Quintuple-Agent. 2002-05-13 Marcus Brinkmann Released 0.6.2. * configure.ac: Set version number to 0.6.2. * NEWS: Add information for 0.6.2. * README: Update for release. 2002-05-09 Marcus Brinkmann * configure.ac: Add option --enable-fallback-curses and bind it to the ncurses check. Add automake conditional BUILD_LIBPINENTRY_CURSES and FALLBACK_CURSES. Add preprocessor symbol FALLBACK_CURSES. * curses/Makefile.am (AM_CPPFLAGS): Add $(NCURSES_INCLUDE). (LDADD): Add ../pinentry/libpinentry-curses.a. * curses/pinentry-curses.c: Include "pinentry-curses.h". Moved most of the meat to ... * pinentry/pinentry-curses.c: ... here. New file. Make all functions and global variables static. (dialog_cmd_handler): Rename to ... (curses_cmd_handler): ... this. * pinentry/pinentry-curses.h: New file. * pinentry/Makefile.am (noinst_LIBRARIES) [BUILD_LIBPINENTRY_CURSES]: Add libpinentry-curses.a. (libpinentry_curses_a_SOURCES): New target. * gtk/Makefile.am (INCLUDES): Moved all to ... (AM_CPPFLAGS): ... here. [CURSES_FALLBACK]: Define ncurses_include and libcurses. (AM_CPPFLAGS): Add $(ncurses_include). (LDADD): Add $(libcurses). * gtk/pinentry-gtk.c: Rename TIMEOUT to TIME_OUT to avoid conflict with curses.h. [CURSES_FALLBACK]: Include "pinentry-curses.h". (button_clicked): Likewise. (create_window): Likewise. (cmd_handler): Renamed to ... (gtk_cmd_handler): ... this. (pinentry_cmd_handler): Set to gtk_cmd_handler. (main) [CURSES_FALLBACK]: Initialize GTK+ only if environment variable DISPLAY is set, otherwise fall back to curses dialog. * pinentry/pinentry.h: Protect against multiple inclusion. 2002-05-09 Marcus Brinkmann * curses/pinentry-curses.c (dialog_create): Allow multi-line error texts. * pinentry/pinentry.c (cmd_seterror): Call strcpy_escaped, rather than strcpy, to allow percent-escaping the error text. 2002-04-25 Steffen Hansen * pinentry-qt: Use ok and cancel value if provided. 2002-04-25 Marcus Brinkmann * gtk/pinentry-gtk.c (create_window): Use ok and cancel value if provided. 2002-04-25 Marcus Brinkmann * qt/pinentrycontroller.h: New members _ok and _cancel. * qt/pinentrycontroller.cpp (registerCommands): Add SETOK and SETCANCEL. (assuanOk): New method. (assuanCancel): Likewise. 2002-04-25 Marcus Brinkmann * curses/pinentry-curses.c (dialog_create): Grok the new ok and cancel members to set the pbutton texts, rather than parsing the prompt in the confirm case. * pinentry/pinentry.h (struct pinentry): Add new members ok and cancel. * pinentry/pinentry.c (register_commands): Add new commands SETOK and SETCANCEL to set button texts. (struct pinentry pinentry): Add initializers for new members. (cmd_setok): New function. (cmd_setcancel): Likewise. 2002-04-24 Marcus Brinkmann * curses/pinentry-curses.c (dialog_create): Add '<' and '>' around the user provided button texts. Replace sizeof by strlen to fix size calculation of ok and cancel button. 2002-04-23 Marcus Brinkmann * pinentry/pinentry.h (struct pinentry): New variables lc_ctype and lc_messages. * pinentry/pinentry.c (usage): New options --lc-ctype and --lc-messages. (pinentry_parse_opts): Likewise. (option_handler): Likewise. (struct pinentry pinentry): New initializers for new members. * curses/pinentry-curses.c (convert_utf8_string): New function. (struct dialog): New members ok and cancel. (dialog_create): New variables ERR, DESCRIPTION, ERROR, PROMPT, OK, and CANCEL. Initialize them with the localised versions of the pinentry strings. If in confirm mode, split up the prompt at '|' and use the values as button texts. Use localised strings. (dialog_switch_pos): Use localised strings. (dialog_run): Free dialog strings. * acinclude.m4 (AM_ICONV): New check from gettext. * configure.ac: Run AM_ICONV if curses pinentry is build. Don't check for inttypes.h, don't check size of unsigned int or unsigned long. (LIBCAP): Move check to interface independent part. 2002-04-21 Steffen Hansen * Removed X11 dependency and use Qt for grabbing the keyboard. * Clear the lineedit before asking the user for the PIN. 2002-04-12 Steffen Hansen * Enable pinentry-qt if Qt is found 2002-04-06 Marcus Brinkmann * qt: New directory. * qt/Makefile.am, qt/cppmemory.cpp, qt/main.cpp, pinentrycontroller.cpp, qt/pinentrycontroller.h, qt/pinentrydialog.cpp, qt/pinentrydialog.h: New file, copied from kde/. * kde: Directory removed. * kde/Makefile.am, kde/cppmemory.cpp, kde/main.cpp, kde/pinentry.desktop, kde/pinentrycontroller.cpp, kde/pinentrycontroller.h, kde/pinentrydialog.cpp, kde/pinentrydialog.h: Files removed. * acinclude.m4: Removed the KE checks and completely overhauled the Qt checks, putting all Qt checks in their own namespace QT_, and make it declare QT_-prefixed variables for linking and compilation. * configure.ac: Use the new Qt checks instead the KDE checks. Replace "kde" with "qt" everywhere. * Makefile.am: Replace "kde" with "qt" everywhere. 2002-04-06 Marcus Brinkmann * acinclude.m4: Reworked the Qt and KDE checks, cutting out a lot of dead and not-so-dead wood. Gave all KDE checks proper names. * configure.ac: Use the new names for the KDE checks. 2002-04-06 Marcus Brinkmann * kde/Makefile.am (EXTRA_DIST): Remove variable. (install-data-local): Remove target. (uninstall-local): Likewise. 2002-04-05 Marcus Brinkmann Released 0.6.0. * configure.ac: Set version number to 0.6. * NEWS: Add information for 0.6.0. * secmem/Makefile.am (libsecmem_a_SOURCES): Replace secmem.h with memory. * kde/Makefile.am (pinentry_kde_SOURCES): Move pinentrydialog.moc.cpp and pinentrycontroller.moc.cpp to ... (nodist_pinentry_kde_SOURCES): ... this new target. 2002-04-05 Marcus Brinkmann * acinclude.m4: A lot of new checks more or less straight from KDE's admin/acinclude.m4.in. * configure.ac (AC_CANONICAL_HOST): Call that macro. (AC_CHECK_COMPILERS, AC_PATH_KDE): Call those macros if KDE pinentry is enabled. * kde/Makefile.am (CXXFLAGS, XXX_PREFIX, XXX_KDE_DEFINES, LIB_QT, LIB_KDECORE, LIB_KDEUI, KDE_RPATH, MOC, kde_appsdir): Variables removed. (AM_CPPFLAGS): Replace XXX_KDE_DEFINES by all_includes. (pinentry_kde_LDFLAGS): Add all_libraries. * README: Document that automatic check is not possible for KDE. 2002-04-05 Marcus Brinkmann * curses/pinentry-curses.c (dialog_run): Add handling for TAB key. (dialog_create): New variable description_x. Calculate dimension of multi-line description correctly. 2002-04-04 Marcus Brinkmann * pinentry/pinentry.h (struct pinentry): New members DISPLAY, TTYNAME and TTYTYPE. * pinentry/pinentry.c (pinentry): Likewise. * pinentry/pinentry.c: Include . (usage): Add new options --display, --ttyname and --ttytype. (option_handler): Likewise. (pinentry_parse_opts): Likewise. * curses/pinentry-curses.c (dialog_cmd_handler): Use PINENTRY->ttyname and PINENTRY->ttytype. 2002-03-30 Marcus Brinkmann * acinclude.m4: Add AM_PATH_GLIB and AM_PATH_GTK. 2002-03-29 Marcus Brinkmann * configure.ac: Choose a more appropriate AC_CONFIG_SRCDIR. 2002-03-29 Marcus Brinkmann * kde/Makefile.am (pinentry_kde_LDADD): Link with $(LIBCAP). * gtk/Makefile.am (install-exec-local): Moved to ... * Makefile.am (install-exec-local): ... here. 2002-03-29 Marcus Brinkmann * kde/Makefile.am (kde_appsdir): New variable. * kde/Makefile.am (install-data-local): Use DESTDIR. (uninstall-local): Likewise. 2002-03-29 Marcus Brinkmann Merge of the gpinentry and curses pinentry program into the pinentry distribution. For this, the structure of the repository has been thoroughly overhauled. Some of the changes: * secmem: New directory with secure memory allocation code. * pinentry: New directory with pinentry support library. * curses: New directory with curses frontend. * gtk: New directory with GTK+ frontend. * kde: New directory with only the core of the old kpinentry program. * admin: Directory removed. * po: Directory removed. * kpinentry: Directory removed. * doc: Directory removed. * jnlib: Directory removed.x The changes in more detail: * AUTHORS: Add authors of other pinentry frontends. * ChangeLog: Add the one from gpinentry. * Makefile.am: Completely rewritten. * README: Add content. * TODO: Add content. * NEWS: New file from gpinentry. * THANKS: New file from gpinentry. * acinclude.m4: New file. * configure.ac: New file which configures for all frontends. * curses/Makefile.am, curses/pinentry-curses.c: New files for curses frontend. * gtk/Makefile.am, gtk/gtksecentry.c, gtk/gtksecentry.h, gtk/pinentry-gtk.c: New files, modified from gpinentry, for GTK+ frontend. * kde/Makefile.am, kde/cppmemory.cpp, kde/main.cpp, kde/pinentry.desktop, kde/pinentrycontroller.cpp, kde/pinentrycontroller.h, kde/pinentrydialog.cpp, kde/pinentrydialog.h: New files, modified from kpinentry, for KDE frontend. * pinentry/Makefile.am, pinentry/pinentry.c, pinentry/pinentry.h: New files containing pinentry support library, partly factored out from gpinentry. * secmem/Makefile.am, secmem/memory.h, secmem/secmem-util.h, secmem/secmem.c, secmem/util.c, secmem/util.h: New files containing secure memory allocation code common to all pinentry frontends. * Makefile.dist, acconfig.h, configure.files, configure.in.in: Files removed in favor of new configure.ac. * pinentry.lsm: Removed file never used. * stamp-h.in: Removed generated file. * admin/ChangeLog, admin/Makefile.common, admin/acinclude.m4.in, admin/am_edit, admin/am_edit.py, admin/conf.change.pl, admin/config.guess, admin/config.pl, admin/config.sub, admin/configure.in.min, admin/debianrules, admin/depcomp, admin/install-sh, admin/libtool.m4.in, admin/ltcf-c.sh, admin/ltcf-cxx.sh, admin/ltcf-gcj.sh, admin/ltconfig, admin/ltmain.sh, admin/missing, admin/mkinstalldirs, admin/ylwrap: Removed KDE build suite in favor of configure.ac. * doc/Makefile.am, doc/en/Makefile.am, doc/en/index.docbook: Removed files never used. * jnlib/ChangeLog, jnlib/Makefile.am, jnlib/argparse.c, jnlib/argparse.h jnlib/dotlock.c, jnlib/dotlock.h, jnlib/libjnlib-config.h, jnlib/logging.c, jnlib/logging.h, jnlib/mischelp.h, jnlib/stringhelp.c, jnlib/stringhelp.h, jnlib/strlist.c, jnlib/strlist.h, jnlib/types.h, jnlib/xmalloc.c, jnlib/xmalloc.h: Removed files no longer used. * kpinentry/Makefile.am, kpinentry/cppmemory.cpp, kpinentry/cppmemory.h, kpinentry/i18n.h, kpinentry/main.cpp, kpinentry/memory.h, kpinentry/pinentry.desktop, kpinentry/pinentrycontroller.cpp, kpinentry/pinentrycontroller.h, kpinentry/pinentrydialog.cpp, kpinentry/pinentrydialog.h, kpinentry/secmem.cpp, kpinentry/util.cpp, kpinentry/util.h: Removed files in favor of new files in kde/. * po/Makefile.am, po/pinentry.pot: Removed files never used. * autogen.sh: New file. 2002-03-04 Werner Koch * gpinentry.c (enter_callback): New (create_window): Connect it to the entry field. 2002-02-18 Werner Koch Released 0.5.1. * gpinentry.c (create_window): Add CONFIRM_MODE. (cmd_confirm): Implemented. * assuan/: Updated from NewPG. 2002-01-20 Werner Koch * gpinentry.c (option_handler): New to allow changing of the grab status. (grab_keyboard): Shortcut this when global grab is not set. 2002-01-04 Werner Koch Released 0.5.0. * configure.ac: Bumbed version * util.h (xtoi_1, xtoi_2): New. * gpinentry.c (strcpy_escaped): New (cmd_setdesc, cmd_seterror): Use it here to allo multiline texts. * gpinentry: Removed debugging outbut (create_window): Tweaked layout. 2001-12-07 Werner Koch New package gpinentry based on quintuple-agent. Removed all stuff except for the basic configuration stuff and what is needed to build gpinentry. Also removed i18n support. * gpinentry.c: Renamed from secret-query.c 2001-02-12 Robert Bihlmeyer * 1.0.0 released. Woo-hoo! * configure.in, NEWS: Bumped version. 2001-02-04 Robert Bihlmeyer * agent.c (make_tmpdir): Honor $TMPDIR. (agent): Would exit on every minor problem. Now, we just close the offending connection. Ignore SIGPIPE, so that EPIPE will close connection. 2001-01-11 Robert Bihlmeyer * secmem.c: Move one include statement so that the thing compiles. * secret-query.c (main): Minor source cosmetics. 2000-11-16 Robert Bihlmeyer * gtksecentry.c (gtk_secure_entry_insert_text): Secured a couple of memory (de)allocations that were missed. Thanks to John Steele for spotting these. 2000-11-10 Robert Bihlmeyer * Thoughts: Removed in favor of new TODO. * README: Remove content and refer to doc/manual.info instead. * agent.c (do_get): Would burn badly on a premature exit of the query program (which would occur routinely if you selected /cancel/). 2000-10-25 Robert Bihlmeyer * memory.h: Include sys/types.h for size_t. 2000-10-08 Robert Bihlmeyer * README: Removed apology about missing documentation. Updated paragraph about Linux capability patch. Typo & Refill. 2000-10-03 Robert Bihlmeyer * 0.9 released. * Makefile.am (EXTRA_DIST): Distribute BUGS (the file, that is). * configure.in, NEWS: Bumped version. * Makefile.am, configure.in: Add debian subdir. * README: Recommend GTK+. Update list of checked platforms. 2000-10-02 Robert Bihlmeyer * secret-query.c (ok): Simplify. Put empty line between headers and secret. (usage): Document '--help' and '--version'. * agent.c (do_get): Use enhanced secret-query output to fill in options. 2000-10-01 Robert Bihlmeyer * secret-query.c (main): Clarify error. * client.c (query_options): New global variable. (main): New option '--query-options' to pass options to the query program. (xgetpass): Use it. * agent.c (main): New option '--query-options' to pass options to the query program. (do_get): Use 'query_options'. * acconfig.h, configure.in: Add QUERY_PROGRAM definition. * client.c: Remove here. * agent.c (do_get): Use it here, too. * secret-query.c (main): New option '--no-global-grab' introduced, that prevents keyboard grabbing unless the window has focus. 2000-09-11 Robert Bihlmeyer * secret-query.c (usage): Add two missing pieces of "\n\". * agent.c (main): --nofork is now the default, and the option is deprecated. New option --fork added to turn forking on again. Close stdout (and stderr unless debugging) even when not forking, so that normal usage inside eval is still possible. (agent): Exit gracefully on HUP, so that logging out now kills the agent. * README (Contact Information): Old URL - duh! (Using Secret Agent): We no longer fork per default. * Makefile.am (lib/libutil.a): New target, allows targets that not automatically recurse (but still depend on libutil.a) to succeed. 2000-07-20 Robert Bihlmeyer * secret-query.c (usage): New function. (main): Parse options: debug, enhanced, help, version. Turn on locale support. If enhanced, insert widgets to ask for timeout and insurance. (ok): If enhanced, print more information on exit. (grab_keyboard): Die if grab was unsuccessful. 2000-05-31 Robert Bihlmeyer * 0.8 released. * configure.in, NEWS: Bumped version. * Makefile.am (SUBDIRS): Include doc. * configure.in, acconfig.h: Check for ssize_t. Check for vsnprintf(), strdup(). Generate doc/Makefile. * apgp.c, agpg.c, agentlib.c, util.c: Include more stuff. * agent.c (do_get): Use asprintf() instead of snprintf() so we don't need to roll our own for yet another function. Fix some includes. * acinclude.m4: gettext macros copied from automake and fixed. 2000-05-30 Robert Bihlmeyer * configure.in, Makefile.am: Properly include doc subdir. 2000-05-29 Robert Bihlmeyer * configure.in, acconfig.h: Add test for XMESSAGE path. * client.c (main): Decode command from string to integer code first, then evaluate that in ifs. * secret-ask.c: New file, external ask-for-confirmation utility. * configure.in, Makefile.am: Add secret-ask to programs being built when GTK is available. Rename QUERY to more descriptive GTK_PROGRAMS. * agent.c (do_get): If GTK is available, try executing secret-ask first. Only put the comment into the insure-question if there is a comment. (main): --csh was missing from usage message. 2000-04-23 Robert Bihlmeyer * secret-query.c (constrain_size): Lower window max_width to accomodate bugs in GTK and Scwm. * agent.c (main): Set x_enabled if X appears to be available. Use it to selectively make FLAGS_INSURE supported. (do_get): Use it instead of testing at every call. (do_put): Requests containing unsupported flags fail. (forget_old_stuff): Would not set next_deadline correctly. (do_get): Implement FLAGS_INSURE. * client.c (main): "list" format changed so that comment is to the far right. Display the deadline as proper date/time, too. 1999-11-11 Robert Bihlmeyer * agent.c (next_deadline): New global variable, holds time when next secret has to be killed. (store): Keep it up-to-date. (forget_old_stuff): New function, reaps secrets ready to kill, keeps next_deadline updated. (agent): Use it on all secrets, whenever a deadline is active. 1999-11-08 Robert Bihlmeyer * agent.h (request_put): Add flags, deadline. Increase REQUEST_MAGIC. (reply_get): Ditto, and increase REPLY_MAGIC. * agent.c (store): Store flags, deadline in reply. (do_put): Hand flags, deadline from request on to store(). (do_get): Store on-demand queried secrets without deadline or special flags, for now. (agent): Do not ignore obsolete clients, return an error reply. * agentlib.c (agent_put): Add flags, deadline arguments, and copy them into the request. * agentlib.h (agent_put): Update prototype. * * client.c (main): Added --time-to-live (-t) and --insure (-i) options, influencing PUT's deadline and flags, respectively. (main): Change list format to include new attributes. 1999-11-05 Robert Bihlmeyer * configure.in: check had redundant definition. * acconfig.h: Remove here, too. * configure.in: Check for . If not found, check for unsigned {int, long} sizes. * agent.h: Either include , or try to define uint32_t yourself. Need to include "config.h". 1999-11-04 Robert Bihlmeyer * Makefile.am (signed-dist): New rule, generates sig for dist. (%.sig): New rule, for detached signatures in general. * configure.in: Check for ulong. * acconfig.h: Document it. * secmem.c: Unconditionally defining it is no longer necessary here. But do include in all cases. * 0.7 released. * secmem.c: ulong is not defined on all systems. * agent.h: should define `uint32_t' as per Unix98, so we use that. 1999-11-02 Robert Bihlmeyer * agent.h: Augmented requests and replies with magic numbers. Data structures heavily commented. All structures and enums typedef'd. * agent.c: Adapted. (store): Set magic number in stored reply. (do_put): Set magic number in reply. (do_delete): Ditto. (do_list): Ditto. (agent): Check magic number in request. * agentlib.c: Adapted. (send_request): Set magic number in request. Check it in reply. * agentlib.h: Adapted. * agpg.c: Adapted. * apgp.c: Adapted. * client.c: Adapted. 1999-10-31 Robert Bihlmeyer * secmem.c: Instead of defining ulong directly, include * secret-query.c (constrain_size): New function, puts constrains on size of toplevel window. (grab_keyboard): Removed protection against multiple calls. (ungrab_keyboard): New function, cancelling a keyboard grab. (main): Hang `grab_keyboard' onto map-event which makes it actually work, hang `ungrab_keyboard' onto unmap-event. Hang `constrain_size' onto size-request. * secmem.c: ulong was undefined on some systems. 1999-10-19 Robert Bihlmeyer * Makefile.am (install-exec-local): Ignore setcap errors. * apgp.c: New program, based on agpg.c, but for pgp2.6. * Makefile.am (bin_PROGRAMS, apgp_SOURCES): Added it. * agpg.c (GPG): New constant. (find_id, main): Use it throughout. (find_id): Forgot to pclose on success. * secret-query.c (main): Don't expand anything. Use a button box for the buttons. Prompt label can be overridden from the commandline. * agent.c (do_get): Make spawned secret-query show the id. * client.c (xgetpass): Pass prompt to secret-query. (main): Include id in xgetpass prompt. 1999-10-14 Robert Bihlmeyer * configure.in: setcap must be searched outside the usual user PATH, too. * Makefile.am (install-exec-local): Set cap_ipc_lock permitted on installed binaries, if possible. * agent.c (xdup2): New function, dup2 with error handling. (move_fd): New function, moves fds. (store): New function, abstracted out from do_put. (do_put): Use it. (do_get): If secret was not found, and DISPLAY is set, try to query the user about it. If successful, store it. (main): Route standard file descriptors to /dev/null rather than just closing them. The latter would confuse children. 1999-10-13 Robert Bihlmeyer * gtksecentry.c, gtksecentry.h: New files, being slightly modified versions of GTK+'s gtkentry.[ch], spiffed up to use secure memory. * secret-query.c (ok, unselect, main): Replace GtkEntry with GtkSecureEntry. (main): Initialize secure memory. * Makefile.am (secret_query_SOURCES): Added gtksecentry.[ch]. * README (Security): New chapter. * configure.in, acconfig.h: Check for POSIX capabilities, and the setcap program. * Makefile.am: Link LIBCAP to those binaries using secmem.c. * util.h: Include for size_t. 1999-09-21 Robert Bihlmeyer * secmem.c: Synced with gnupg-1.0 (top new feature: capabilities). (log_fatal): New function, logs to stderr, and dies. 1999-09-08 Robert Bihlmeyer * secmem.c (log_info): New function, logs to stderr. * agent.c (agent): select() expects the number of fds, not the highest fd. So remember that number. * agent.c (agent): Don't use FD_SETSIZE, which is not defined on all systems. Remember the number of the highest descriptor instead. * configure.in: Replace getline() instead of getdelim() because this is the function we really need. Still check for getdelim(), though - there are systems out there where this is provided, but getline() is not. 1999-09-01 Robert Bihlmeyer * 0.6 released. * configure.in: Bump version. * NEWS: Updated. 1999-08-31 Robert Bihlmeyer * util.c (init_uids, lower_privs, raise_privs, drop_privs): New functions, for setuid binaries, extracted from agent.c. * util.h: Add prototypes for them. * agpg.c (main): Use them. * client.c (main): Ditto. * agent.c (main): Ditto. Removed code that did the same. Unconditionally include "asprintf.h" (it protects itself now). 1999-08-25 Robert Bihlmeyer * Makefile.am (SUBDIRS): Process . before test so that "make check" always builds all in . first. 1999-08-21 Robert Bihlmeyer * secret-query.c: Include "config.h". * agent.h (reply_list_entry, reply_list): New reply structures. * agent.c (send_list_entry): New function. (do_list): First send number of entries, then each entry via send_list_entry(). * agentlib.c (agent_list): Read entries returned by LIST request. * client.c (main): Output all entries returned by agent_list(). * agentlib.c (agent_put): Don't construct PUT request in insecure stack space. 1999-08-20 Robert Bihlmeyer * NEWS: Bump patchlevel. * configure.in: Bump patchlevel. Check for missing setenv(). 1999-08-09 Robert Bihlmeyer * configure.in: Check for strsignal(). * client-test: Obsoleted by test/client. * Makefile.am (SUBDIRS): New subdirectory. * configure.in (AC_OUTPUT): Add here, too. * 0.5 released. * README: Explain why secret-client will not output secrets to a tty, and mention the cat-trick. * agent.c (main): If seteuid is not available, don't use it and issue a warning if running setuid. * configure.in: Run together two REPLACE_FUNCS. Check for seteuid. * client-test: Mask out insecure memory warnings. * agentlib.c (send_request): Let the calling functions reserve space for the reply, but offer a simple way for simple requests. (agent_get): Allocate secure memory. * agent.c (main): Moved secmem_init() after the fork, since that seemingly munlock's all pages. Drop priviledges just in case somebody wants to install this suid-root. Flush stdout. * agpg.c (find_id): Would reorder arguments. Initialize opt_version. (main): Initialize secure memory. * Makefile.am (agpg_SOURCES): Link with secure memory module. * client.c (usage): Fixed another program name reference. 1999-08-06 Robert Bihlmeyer * configure.in: Conditionally define HAVE_GTK. * acconfig.h: Add here too. * client.c (xgetpass): Use "secret-query" only if it was built. (main): Don't output secret (GET command) to ttys. * agpg.c (find_id): Also print own version if "--version" is given. (main): Check agent_init() errors. Print error if exec fails. * agent.c (main): Added an option to produce csh-compatible output. * agent.c, client.c: Forgot the terminating NULL in long options. Fixed the program names in usage and version output. * agent.c (create_socket): AF_UNIX and PF_UNIX are Unix98, so that's what we use. AF_LOCAL, PF_LOCAL removed. * agentlib.c (agent_init): Ditto. 1999-08-05 Robert Bihlmeyer * 0.4 released. * configure.in: Bumped version. Check for missing getdelim. * cgpg: Removed, obsoleted by agpg. * Makefile.am: Here, too. * agpg.c (find_id): New function. (main): Use it. * Makefile.am (INCLUDES): Put GTK_FLAGS and GLIB_FLAGS here. It is the easiest way for sources needing it, and it won't hurt those that don't. (agent.o): Explicit command removed accordingly. 1999-08-04 Robert Bihlmeyer * configure.in: Need double quoting in nested AC_MSG_WARN. * client.c (xgetpass): If no tty is available, but a DISPLAY is, fork off "secure-query" to read the secret. Put the fgets into a loop that keeps reading until all of the secret is read. * client-test: Unset DISPLAY, so that "secret-query" is never used. 1999-08-03 Robert Bihlmeyer * agpg.c: New file, first cut at a C version of the gpg wrapper, written in a hurry (20 keys waiting to be signed, and a growling stomach). * Makefile.am: Add it to built programs. (LDADD): New default. (secret_client_LDADD): Removed, since it was identical to default. 1999-08-01 Robert Bihlmeyer * secret-query.c: New program, queries the user for a password. * Makefile.am (bin_PROGRAMS): Added it. * configure.in: Check for GTK+, build "secret-query" only when that is available. * cgpg: Extra argument for ID is no longer necessary. cgpg will scan the gpg args for switches that affect user-id, and determine the right key itself. Per convention, the key-id is used by "GET". * configure.in: The project name is now "secret-agent". * Makefile.am: "agent" & "client" renamed to "secret-agent" & "secret-client", respectively. * client-test: Adapt to new names. * Thoughts: Removed discussion of other names. Added indication of which things already work. * agent.c (make_tmpdir): Removed occurance of "gpg-agent." * README: First proper version. * client-test: Context diffs are more portable then unified diffs. * agent.c, agent.h, agentlib.c, agentlib.h, client.c, memory.h, util.c, util.h: Banner updated to new name. 1999-07-29 Robert Bihlmeyer * configure.in: Check for missing asprintf. Check if -lsocket is needed. * secmem.c (secmem_dump_stats): Replace usage of ulong. * Makefile.am (INCLUDES): Add the lib subdirectory to include search. * agent.c: Forgot to include . Include RYO asprintf header if this function is missing. For the sake of compatibility, provide a definition for AF_LOCAL, PF_LOCAL, if missing. * agentlib.c: Ditto. 1999-07-28 Robert Bihlmeyer * Makefile.am (client_SOURCES): Add "secmem.c", "memory.h". * client.c (xgetpass): Use secmem_malloc() instead of RYO. (main): Init and shutdown secmem. 1999-07-27 Robert Bihlmeyer * Makefile.am (agent_SOURCES): Add "secmem.c", "i18n.h", "memory.h". (client_SOURCES): Add "i18n.h". * client.c (main): Exit on agent_init() failure. * agent.c (main): Init secmem. Make --debug switch cumulative. (cleanup): Shutdown secmem. (do_put): Use secmem for storage of secrets. (do_delete): Use secmem_free(). Since this wipes the memory on its own, wipe() is superflous now. (agent): Use secmem for inbound requests. (delete_secret): New function, takes part of do_delete's functionality. (do_put): Use it to remove old versions stored under the same id. (do_delete): Use it to delete secrets. * memory.h: New file. * secmem.c: New file, snarfed from GnuPG and modified slightly. * acinclude.m4: New file. * configure.in: (ALL_LINGUAS): Expanded list of available languages. Most of them only have a few translations from gpg, tough ... getopt_long test was commented out for debugging, and left such. Fixed. Check for mlock. * acconfig.h: Comment HAVE_BROKEN_MLOCK. * cgpg: A space was missing. * i18n.h: New file, centralizing the gettext macro defs. * agent.c (BLIND): New macro, that blinds out a secret if debug level is too low. (do_put): Use it. (do_get): Use it. Include i18n.h. * agentlib.c: Include i18n.h * client.c (usage): New function. Usage-message made gettext-friendly. (xgetpass): Use perror() instead of fprintf(). (main): Use it. Make comment an optional argument of PUT. Include i18n.h. 1999-07-26 Robert Bihlmeyer * Makefile.am (client_LDADD): Add lib/libutil.a for portability. (agent_LDADD): Ditto. (SUBDIRS): Add lib directory. (bin_SCRIPTS): New with cgpg, so it gets installed, too. * configure.in: Add lib/Makefile to output. 1999-07-24 Robert Bihlmeyer * cgpg: New file. * Makefile.am (EXTRA_DIST): Added it. * agent.c: Moved inclusion of config.h before inclusion of libintl.h since the latter needs HAVE_LC_MESSAGE. * client.c: Ditto. * clientlib.c: Ditto. * client-test: Update for new client semantics. * client.c (check_status): Use debugmsg(). Do nothing if not debugging. (xgetpass): New function, getpass replacement that uses mlock'ed memory. (main): PUT now asks for the secret rather then getting it from the commandline. GET prints only the secret to stdout. * configure.in: Rearranged. Check for socklen_t. * acconfig.h: Added a definition for it. * client.c: Include packaged getopt.h if the system doesn't provide one. * agent.c: Ditto. (create_socket): Replace AF_FILE, PF_FILE with AF_LOCAL, PF_LOCAL for portability. * agentlib.c (agent_init): Ditto. Explicitly cast addr to a sockaddr pointer. * Makefile.am (client_LDADD): Added @INTLLIBS@. (agent_LDADD): Ditto. 1999-07-19 Robert Bihlmeyer * configure.in: Check for getopt.h and getopt_long. * acconfig.h (HAVE_GETOPT_H): New define. * lib/getopt.c, lib/getopt1.c, lib/getopt.h: Added. 1999-07-18 Robert Bihlmeyer * 0.2 released. * NEWS: Updated. * Makefile.am (agent.o): Mentioning the source explicitly does not work for srcdir!=builddir. * client.c (main): Function arguments are not always evaluated in order, so drop the neat ++optind in favor of optind+1, optind+2, etc. * configure.in: Upped version. 1999-06-28 Robert Bihlmeyer * util.h: Added multi-inclusion guard. * agent.c Include "util.h". (main): Forgot to exit at end. (do_delete): Assume that value is a string and wipe it accordingly. * configure.in (--enable-debug): New switch. * agent.h (status_t): Added STATUS_COMM_ERR code. Added multi-inclusion guard. * client.c (main): Abstracted out most functionality into a function library, namely: * agentlib.c: New file. * agentlib.h: New file. * Makefile.am (client_SOURCES): Added agentlib.c, agentlib.h. * Makefile.am (INCLUDES): GLIB_CFLAGS moved again, this time to the agent.o target. 1999-06-15 Robert Bihlmeyer * 0.1 released. * Makefile.am (agent_CFLAGS): Removed - did not work. (INCLUDES): Moved the GLIB stuff here. 1999-06-14 Robert Bihlmeyer * configure.in (ALL_LINGUAS): Added `de'. * agent.c (do_get): Added more debugmsgs. (do_put): Wouldn't allocate enough for `value'. (main): New option "--nofork" prevents forking. Use macros for the std filedescriptor numbers. Only close stderr if not debugging. (main): Make Usage string gettext-friendly. * client-test (cleanup): New function. Call it on shell exit. (client): New function. Use it instead of calling client binary directly. diff client output with expected one in GET testcases. 1999-06-13 Robert Bihlmeyer * agent.c (failed_reply): New constant. (do_list): Use it. (do_put): The hash key was overwritten - strdup it. Construct a GET reply and save that in the hash. (do_get): Just send the preconstructed reply if the id is present, and failed_reply otherwise. (do_delete): Actually free the hashed stuff. * client.c: Exit with error if agent returned STATUS_FAIL. * Makefile.am (EXTRA_DIST): Added autogen.sh, Thoughts, client-test. (TESTS): Added client-test. (AUTOMAKE_OPTIONS): Added gnits. Copyright 2002, 2003 g10 Code GmbH This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without modifications, as long as this notice is preserved. This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. pinentry-x2go-0.7.5.6/config.h.in0000644000000000000000000000720212070425227013327 0ustar /* config.h.in. Generated from configure.ac by autoheader. */ /* Defined if the mlock() call does not work */ #undef HAVE_BROKEN_MLOCK /* Defined if a `byte' is typedef'd */ #undef HAVE_BYTE_TYPEDEF /* Defined if we run on some of the PCDOS like systems (DOS, Windoze. OS/2) with special properties like no file modes */ #undef HAVE_DOSISH_SYSTEM /* defined if we must run on a stupid file system */ #undef HAVE_DRIVE_LETTERS /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_LANGINFO_H /* Define to 1 if you have the `rt' library (-lrt). */ #undef HAVE_LIBRT /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Defined if the system supports an mlock() call */ #undef HAVE_MLOCK /* Define to 1 if you have the `mmap' function. */ #undef HAVE_MMAP /* Define to 1 if you have the `plock' function. */ #undef HAVE_PLOCK /* Define to 1 if you have the `seteuid' function. */ #undef HAVE_SETEUID /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `stpcpy' function. */ #undef HAVE_STPCPY /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MMAN_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIO_H /* Defined if a `ulong' is typedef'd */ #undef HAVE_ULONG_TYPEDEF /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_UTIME_H /* Defined if we run on a W32 API based system */ #undef HAVE_W32_SYSTEM /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* The capabilities support library is installed */ #undef USE_CAPABILITIES /* set this to limit filenames to the 8.3 format */ #undef USE_ONLY_8DOT3 /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Version number of package */ #undef VERSION /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE pinentry-x2go-0.7.5.6/config.rpath0000755000000000000000000003502512070425227013620 0ustar #! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2005 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` cc_basename=`echo "$CC" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; darwin*) case "$cc_basename" in xlc*) wl='-Wl,' ;; esac ;; mingw* | pw32* | os2*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; newsos6) ;; linux*) case $cc_basename in icc* | ecc*) wl='-Wl,' ;; pgcc | pgf77 | pgf90) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; como) wl='-lopt=' ;; esac ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; sco3.2v5*) ;; solaris*) wl='-Wl,' ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) wl='-Wl,' ;; sysv4*MP*) ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then case "$host_os" in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we cannot use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sunos4*) hardcode_direct=yes ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = yes; then # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=no if test "$GCC" = yes ; then : else case "$cc_basename" in xlc*) ;; *) ld_shlibs=no ;; esac fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd1*) ld_shlibs=no ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; freebsd2*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd* | kfreebsd*-gnu | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; hpux10* | hpux11*) if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=no ;; ia64*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; *) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; openbsd*) hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4.2uw2*) hardcode_direct=yes hardcode_minus_L=no ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) ;; sysv5*) hardcode_libdir_flag_spec= ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. libname_spec='lib$name' case "$host_os" in aix3*) ;; aix4* | aix5*) ;; amigaos*) ;; beos*) ;; bsdi[45]*) ;; cygwin* | mingw* | pw32*) shrext=.dll ;; darwin* | rhapsody*) shrext=.dylib ;; dgux*) ;; freebsd1*) ;; kfreebsd*-gnu) ;; freebsd*) ;; gnu*) ;; hpux9* | hpux10* | hpux11*) case "$host_cpu" in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac ;; irix5* | irix6* | nonstopux*) case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux*) ;; knetbsd*-gnu) ;; netbsd*) ;; newsos6) ;; nto-qnx*) ;; openbsd*) ;; os2*) libname_spec='$name' shrext=.dll ;; osf3* | osf4* | osf5*) ;; sco3.2v5*) ;; solaris*) ;; sunos4*) ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) ;; sysv4*MP*) ;; uts4*) ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' < # Copyright (C) 2001, 2002, 2003, 2004, 2007 g10 Code GmbH # # This file is part of PINENTRY. # # PINENTRY is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # PINENTRY is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA # (Process this file with autoconf to produce a configure script.) AC_PREREQ(2.57) min_automake_version="1.7.6" # Remember to remove the "-cvs" suffix *before* a release and to bump the # version number immediately *after* a release and to re-append the suffix. AC_INIT(pinentry-x2go, 0.7.5.5, [x2go-dev@lists.berlios.de]) AM_CONFIG_HEADER(config.h) AC_CONFIG_SRCDIR(pinentry/pinentry.h) AM_INIT_AUTOMAKE([foreign]) AC_GNU_SOURCE AM_MAINTAINER_MODE AC_CANONICAL_HOST dnl Checks for programs. missing_dir=`cd $ac_aux_dir && pwd` AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_RANLIB # We need to check for cplusplus here becuase we may not do the test # for Qt and autoconf does does not allow that. AC_PROG_CXX AC_PROG_LN_S AC_CHECK_TOOL(WINDRES, windres, :) have_dosish_system=no have_w32_system=no case "${host}" in *-mingw32*) AC_DEFINE(USE_ONLY_8DOT3,1, [set this to limit filenames to the 8.3 format]) AC_DEFINE(HAVE_DRIVE_LETTERS,1, [defined if we must run on a stupid file system]) have_dosish_system=yes have_w32_system=yes ;; i?86-emx-os2 | i?86-*-os2*emx ) # OS/2 with the EMX environment AC_DEFINE(HAVE_DRIVE_LETTERS) have_dosish_system=yes ;; i?86-*-msdosdjgpp*) # DOS with the DJGPP environment AC_DEFINE(HAVE_DRIVE_LETTERS) have_dosish_system=yes ;; esac if test "$have_dosish_system" = yes; then AC_DEFINE(HAVE_DOSISH_SYSTEM,1, [Defined if we run on some of the PCDOS like systems (DOS, Windoze. OS/2) with special properties like no file modes]) fi AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes) if test "$have_w32_system" = yes; then AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system]) fi AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes) AM_CONDITIONAL(BUILD_LIBPINENTRY_CURSES, 0) dnl Checks for compiler features. if test "$GCC" = yes; then CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes" CPPFLAGS="$CPPFLAGS -Wall" AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign]) _gcc_cflags_save=$CFLAGS CFLAGS="-Wno-pointer-sign" AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],_gcc_psign=yes,_gcc_psign=no) AC_MSG_RESULT($_gcc_psign) CFLAGS=$_gcc_cflags_save; if test x"$_gcc_psign" = xyes ; then CFLAGS="$CFLAGS -Wno-pointer-sign" fi fi # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(string.h unistd.h langinfo.h termio.h locale.h utime.h) dnl Checks for library functions. AC_CHECK_FUNCS(seteuid stpcpy mmap) GNUPG_CHECK_MLOCK dnl Checks for libassuan. dnl -> None required becuase we use a stripped down version of libassuan. dnl Checks for libsecmem. GNUPG_CHECK_TYPEDEF(byte, HAVE_BYTE_TYPEDEF) GNUPG_CHECK_TYPEDEF(ulong, HAVE_ULONG_TYPEDEF) dnl Check for libcap AC_ARG_WITH([libcap], AC_HELP_STRING([--without-libcap], [Disable support for capabilities library])) if test "x$with_libcap" != "xno"; then AC_PATH_PROG(SETCAP, setcap, :, "$PATH:/sbin:/usr/sbin") AC_CHECK_LIB(cap, cap_set_proc, [ AC_DEFINE(USE_CAPABILITIES,1,[The capabilities support library is installed]) LIBCAP=-lcap ]) fi AC_SUBST(LIBCAP) dnl dnl Check for curses pinentry program. dnl AC_ARG_ENABLE(pinentry-curses, AC_HELP_STRING([--enable-pinentry-curses], [build curses pinentry]), pinentry_curses=$enableval, pinentry_curses=maybe) AC_ARG_ENABLE(fallback-curses, AC_HELP_STRING([--enable-fallback-curses], [include curses fallback]), fallback_curses=$enableval, fallback_curses=maybe) AC_CONFIG_FILES([ assuan/Makefile secmem/Makefile pinentry/Makefile doc/Makefile Makefile ]) AC_OUTPUT for qmake in $(which qmake-qt4 qmake 2>/dev/null); do break; done; if test -z "$qmake"; then AC_MSG_ERROR([qmake not found]) fi; cd pinentry-x2go && "$qmake" PREFIX="$prefix" QMAKE_CFLAGS="$CPPFLAGS $CFLAGS" QMAKE_LFLAGS="$LDFLAGS" QMAKE_CXXFLAGS="$CPPFLAGS $CXXFLAGS" AC_MSG_NOTICE([ Pinentry-X2Go v${VERSION} has been configured. ]) pinentry-x2go-0.7.5.6/COPYING0000644000000000000000000003543312070425227012346 0ustar GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS pinentry-x2go-0.7.5.6/debian/changelog0000644000000000000000000000605412070425227014404 0ustar pinentry-x2go (0.7.5.6-0~x2go1) unstable; urgency=low [ Mike Gabriel ] * /debian/control: + Maintainer change in package: X2Go Developers . + Priority: optional. [ Reinhard Tartler ] * /debian/rules: + Disable dh_auto_test. -- Mike Gabriel Mon, 31 Dec 2012 17:07:04 +0100 pinentry-x2go (0.7.5.5-0~x2go2) unstable; urgency=low * Do not install the pinentry.info file anymore, it conflicts with the info file from the default/original pinentry package. * Add Conflicts/Replaces entries for pinentry-x2go-gtk. * Bump Standards to 3.9.3. -- Mike Gabriel Mon, 20 Aug 2012 10:05:57 +0200 pinentry-x2go (0.7.5.5-0~x2go1) unstable; urgency=low [ Mike Gabriel ] * New upstream version (0.7.5.5): - Set version and project name in configure.ac template. [ Jan Engelhard ] * New upstream version (0.7.5.5): - The package does not use GNU mode. Mark it as such. Makefile.am: error: required file './ChangeLog' not found. Also replace the totally ancient AM_INIT_AUTOMAKE syntax. - Avoid warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body. - Provide several names for qmake-qt4, become more cross-distro tolerant. - Provide CPPFLAGS for QMAKE_CFLAGS and QMAKE_CXXFLAGS. Provide CPPFLAGS first. -- Mike Gabriel Sun, 15 Jul 2012 09:52:18 +0200 pinentry-x2go (0.7.5.4-0~x2go1) unstable; urgency=low * New upstream version (0.7.5.4): - Drop mdate-sh and texinfo.tex from /doc folder (autotools build cruft). -- Mike Gabriel Thu, 14 Jun 2012 09:47:09 +0200 pinentry-x2go (0.7.5.3-0~x2go1) unstable; urgency=low * Update of copyright information in several file headers. -- Mike Gabriel Wed, 13 Jun 2012 17:11:48 +0200 pinentry-x2go (0.7.5.2-0~x2go1) unstable; urgency=low * New upstream version (0.7.5.2): - Strip code project down to its essentials, remove a lot of unneeded cruft. - Make code tree fully build with autotools, see README file for further info. - Replace string pinentry-qt with pinentry-x2go. * Make dh_clean remove all build cruft. -- Mike Gabriel Wed, 13 Jun 2012 15:11:19 +0200 pinentry-x2go (0.7.5.1-0~x2go1) unstable; urgency=low [ Oleksandr Shneyder ] * Set font size in pinentry dialog to 14 -- Mike Gabriel Wed, 12 Oct 2011 10:42:21 +0200 pinentry-x2go (0.7.5.0-0~x2go1) unstable; urgency=low * Changed version numbering scheme. -- Mike Gabriel Mon, 21 Mar 2011 21:58:02 +0100 pinentry-x2go (0.7.5-2) unstable; urgency=low * merged with pinentry version 0.7.5 -- Oleksandr Shneyder Tue, 27 Jan 2009 07:55:15 +0100 pinentry-x2go (0.7.2-1) unstable; urgency=low * Initial release. -- Oleksandr Shneyder Fri, 3 Aug 2007 08:28:09 +0200 pinentry-x2go-0.7.5.6/debian/compat0000644000000000000000000000000212070425227013723 0ustar 5 pinentry-x2go-0.7.5.6/debian/control0000644000000000000000000000200112070425227014121 0ustar Source: pinentry-x2go Section: utils Priority: optional Maintainer: X2Go Developers Uploaders: Oleksandr Shneyder , Mike Gabriel , Build-Depends: debhelper (>= 7.0.50~), autotools-dev, libqt4-gui, libcap-dev, libglib2.0-dev (>= 2.15.5), m4, qt4-qmake, libqt4-dev, dh-autoreconf Standards-Version: 3.9.3 Homepage: http://code.x2go.org/releases/source/pinentry-x2go Vcs-Git: git://code.x2go.org/pinentry-x2go.git Vcs-Browser: http://code.x2go.org/gitweb?p=pinentry-x2go.git;a=summary Package: pinentry-x2go Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, libqt4-gui Conflicts: pinentry-x2go-gtk Replaces: pinentry-x2go-gtk Description: Qt4-based PIN or pass-phrase entry dialog for x2goclient This package contains a program that allows for entry of PINs or pass phrases. Based on original pinentry-qt software, modified for x2goclient. Web site: http://www.x2go.org/ http://www.gnupg.org/aegypten/ pinentry-x2go-0.7.5.6/debian/copyright0000644000000000000000000000371012070425227014461 0ustar This package was debianized by Oleksandr Shneyder on Thu, 1 Feb 2007 14:11:03 +0100. It was downloaded from www.obviously-nice.de Upstream Author: Oleksandr Shneyder Copyright (C) 2007 obviously nice - http://www.obviouslynice.de This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. Copyright (C) 2007 Oleksandr Shneyder oleksandr.shneyder@obviously-nice.de Copyright (C) 2007 Heinz-Markus Graesing heinz-m.graesing@obviously-nice.de On Debian systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL'. The Debian packaging is (C) 2007, Oleksandr Shneyder and is licensed under the GPL, see above. Program: Pinentry Bug reports: Security related bug reports: Robert Bihlmeyer Werner Koch, g10 Code GmbH Steffen Hansen, Klarälvdalens Datakonsult AB Marcus Brinkmann, g10 Code GmbH pinentry-x2go-0.7.5.6/debian/pinentry-x2go.dirs0000644000000000000000000000001012070425227016124 0ustar usr/bin pinentry-x2go-0.7.5.6/debian/pinentry-x2go.docs0000644000000000000000000000001412070425227016117 0ustar NEWS README pinentry-x2go-0.7.5.6/debian/pinentry-x2go.install0000644000000000000000000000004312070425227016637 0ustar pinentry-x2go/pinentry-x2go usr/binpinentry-x2go-0.7.5.6/debian/rules0000755000000000000000000000132012070425227013601 0ustar #!/usr/bin/make -f export CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) export CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) export CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) export LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) %: dh --with autoreconf $@ override_dh_auto_install: override_dh_auto_test: override_dh_auto_clean: dh_auto_clean rm -f INSTALL rm -f Makefile.in rm -f aclocal.m4 rm -f assuan/Makefile.in rm -f confdefs.h rm -f config.guess rm -f config.sub rm -f configure rm -f debian/autoreconf.after rm -f debian/autoreconf.before rm -f depcomp rm -f doc/Makefile rm -f doc/Makefile.in rm -f install-sh rm -f missing rm -f pinentry/Makefile.in rm -f secmem/Makefile.in pinentry-x2go-0.7.5.6/doc/gpl.texi0000644000000000000000000004375312070425227013541 0ustar @node Copying @appendix GNU GENERAL PUBLIC LICENSE @cindex GPL, GNU General Public License @center Version 2, June 1991 @display Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc. 59 Temple Place -- Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @end display @appendixsubsec Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software---to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. @iftex @appendixsubsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION @end iftex @ifinfo @center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION @end ifinfo @enumerate @item This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The ``Program'', below, refers to any such program or work, and a ``work based on the Program'' means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term ``modification''.) Each licensee is addressed as ``you''. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. @item You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. @item You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: @enumerate a @item You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. @item You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. @item If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) @end enumerate These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. @item You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: @enumerate a @item Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, @item Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, @item Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) @end enumerate The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. @item You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. @item You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. @item Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. @item If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. @item If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. @item The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and ``any later version'', you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. @item If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. @iftex @heading NO WARRANTY @end iftex @ifinfo @center NO WARRANTY @end ifinfo @item BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. @item IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. @end enumerate @iftex @heading END OF TERMS AND CONDITIONS @end iftex @ifinfo @center END OF TERMS AND CONDITIONS @end ifinfo @page @unnumberedsec How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the ``copyright'' line and a pointer to where the full notice is found. @smallexample @var{one line to give the program's name and an idea of what it does.} Copyright (C) 19@var{yy} @var{name of author} This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. @end smallexample Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: @smallexample Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author} Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. @end smallexample The hypothetical commands @samp{show w} and @samp{show c} should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than @samp{show w} and @samp{show c}; they could even be mouse-clicks or menu items---whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a ``copyright disclaimer'' for the program, if necessary. Here is a sample; alter the names: @smallexample @group Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. @var{signature of Ty Coon}, 1 April 1989 Ty Coon, President of Vice @end group @end smallexample This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. pinentry-x2go-0.7.5.6/doc/Makefile.am0000644000000000000000000000164212070425227014107 0ustar # Copyright (C) 2002 g10 Code GmbH # # This file is part of PINENTRY. # # PINENTRY is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # PINENTRY is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA ## Process this file with automake to produce Makefile.in info_TEXINFOS = pinentry.texi pinentry_TEXINFOS = gpl.texi DISTCLEANFILES = pinentry.tmp pinentry.ops pinentry-x2go-0.7.5.6/doc/pinentry.info0000644000000000000000000007110012070425227014574 0ustar This is pinentry.info, produced by makeinfo version 4.11 from pinentry.texi. INFO-DIR-SECTION GNU Utilities START-INFO-DIR-ENTRY * pinentry: (pinentry). Ask securely for a passphrase or PIN. END-INFO-DIR-ENTRY This file documents the use and the internals of the PINENTRY. This is edition 0.7.5, last updated 19 November 2007, of `The `PINEntry' Manual', for version 0.7.5. Published by g10 Code GmbH Hüttenstr. 61 40699 Erkrath, Germany Copyright (C) 2002, 2005 g10 Code GmbH Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The text of the license can be found in the section entitled "Copying".  File: pinentry.info, Node: Top, Next: Using pinentry, Up: (dir) Introduction ************ This manual documents how to use the PINENTRY and its protocol. The PINENTRY is a small GUI application used to enter PINs or passphrases. It is usually invoked by GPG-AGENT (*note Invoking the gpg-agent: (gnupg)Invoking GPG-AGENT, for details). PINENTRY comes in 3 flavors to fit the look and feel of the used GUI toolkit: A GTK+ based one named `pinentry-gtk', a QT based one named `pinentry-qt' and a non-graphical one based on curses and named `pinentry-curses'. Not all of them might be available on your installation. If curses is supported on your system, the GUI based flavors fall back to curses when the `DISPLAY' variable is not set. * Menu: * Using pinentry:: How to use the beast. Developer information * Protocol:: The Assuan protocol description. Miscellaneous * Copying:: GNU General Public License says how you can copy and share PIN-Entry as well as this manual. Indices * Option Index:: Index to command line options. * Index:: Index of concepts and symbol names.  File: pinentry.info, Node: Using pinentry, Next: Protocol, Prev: Top, Up: Top 1 How to use the PINENTRY ************************* You may run PINENTRY directly from the command line and pass the commands according to the Assuan protocol via stdin/stdout. Here is a list of options supported by all 3 flavors of pinentry `--version' Print the program version and licensing information. `--help' Print a usage message summarizing the most useful command line options. `--debug' `-d' Turn on some debugging. Mostly useful for the maintainers. Note that this may reveal sensitive information like the entered passphrase. `--enhanced' `-e' Ask for timeouts and insurance, too. Note that this is currently not fully supported. `--no-global-grab' `-g' Grab the keyboard only when the window is focused. Use this option if you are debugging software using the PINENTRY; otherwise you may not be able to to access your X session anymore (unless you have other means to connect to the machine to kill the PINENTRY). `--parent-wid N' Use window ID N as the parent window for positioning the window. Note, that this is not fully supported by all flavors of PINENTRY. `--display STRING' `--ttyname STRING' `--ttytype STRING' `--lc-type STRING' `--lc-messages STRING' These options are used to pass localization information to PINENTRY. They are required because PINENTRY is usually called by some background process which does not have any information on the locale and terminal to use. Assuan protocol options are an alternative way to pass these information.  File: pinentry.info, Node: Protocol, Next: Copying, Prev: Using pinentry, Up: Top 2 pinentry's Assuan Protocol **************************** The PIN-Entry should never service more than one connection at once. It is reasonable to exec the PIN-Entry prior to a request. The PIN-Entry does not need to stay in memory because the GPG-AGENT has the ability to cache passphrases. The usual way to run the PIN-Entry is by setting up a pipe (and not a socket) and then fork/exec the PIN-Entry. The communication is then done by means of the protocol described here until the client is satisfied with the result. Although it is called a PIN-Entry, it does allow to enter reasonably long strings (at least 2048 characters are supported by every pinentry). The client using the PIN-Entry has to check for correctness. Note that all strings are expected to be encoded as UTF-8; PINENTRY takes care of converting it to the locally used codeset. To include linefeeds or other special characters, you may percent-escape them (i.e. a line feed is encoded as `%0A', the percent sign itself is encoded as `%25'). Here is the list of supported commands: `Set the descriptive text to be displayed' C: SETDESC Enter PIN for Richard Nixon S: OK `Set the prompt to be shown' When asking for a PIN, set the text just before the widget for passphrase entry. C: SETPROMPT PIN: S: OK `Set the button texts' There are two text with can be set to override the English defaults: To set the text for the button signaling confirmation (in UTF-8). C: SETOK Yes S: OK To set the text for the button signaling cancellation or disagreement (in UTF-8). C: SETCANCEL No S: OK `Set the Error text' This is used by the client to display an error message. In contrast to the other commands this error message is automatically reset with a GETPIN or CONFIRM, and is only displayed when asking for a PIN. C: SETERROR Invalid PIN entered - please try again S: OK `Enable a passphrase quality indicator' Adds a quality indicator to the GETPIN window. This indicator is updated as the passphrase is typed. The clients needs to implement an inquiry named "QUALITY" which gets passed the current passpharse (percent-plus escaped) and should send back a string with a single numerical vauelue between -100 and 100. Negative values will be displayed in red. C: SETQUALITYBAR S: OK If a custom label for the quality bar is required, just add that label as an argument as percent escaped string. You will need this feature to translate the label because pinentry has no internal gettext except for stock strings from the toolkit library. If you want to show a tooltip for the quality bar, you may use C: SETQUALITYBAR_TT string S: OK With STRING being a percent escaped string shown as the tooltip. `Ask for a PIN' The meat of this tool is to ask for a passphrase of PIN, it is done with this command: C: GETPIN S: D no more tapes S: OK Note that the passphrase is transmitted in clear using standard data responses. Expect it to be in UTF-8. `Ask for confirmation' To ask for a confirmation (yes or no), you can use this command: C: CONFIRM S: OK The client should use SETDESC to set an appropriate text before issuing this command, and may use SETPROMPT to set the button texts. The value returned is either OK for YES or the error code `ASSUAN_Not_Confirmed'. `Show a message' To show a message, you can use this command: C: MESSAGE S: OK alternativly you may add an option to confirm: C: CONFIRM --one-button S: OK The client should use SETDESC to set an appropriate text before issuing this command, and may use SETOK to set the text for the dismiss button. The value returned is OK or an error message. `Set the output device' When using X, the PINENTRY program must be invoked with an appropriate `DISPLAY' environment variable or the `--display' option. When using a text terminal: C: OPTION ttyname=/dev/tty3 S: OK C: OPTION ttytype=vt100 S: OK C: OPTION lc-ctype=de_DE.UTF-8 S: OK The client should use the `ttyname' option to set the output TTY file name, the `ttytype' option to the `TERM' variable appropriate for this tty and `lc-ctype' to the locale which defines the character set to use for this terminal.  File: pinentry.info, Node: Copying, Next: Option Index, Prev: Protocol, Up: Top Anhang A GNU GENERAL PUBLIC LICENSE *********************************** Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. A.0.1 Preamble -------------- The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 1. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 2. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 3. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a. You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b. You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c. If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 4. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a. Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b. Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c. Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 5. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 6. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 7. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 8. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 9. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 10. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 11. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 12. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 13. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs ============================================= If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. ONE LINE TO GIVE THE PROGRAM'S NAME AND AN IDEA OF WHAT IT DOES. Copyright (C) 19YY NAME OF AUTHOR This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19YY NAME OF AUTHOR Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. SIGNATURE OF TY COON, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.  File: pinentry.info, Node: Option Index, Next: Index, Prev: Copying, Up: Top Option Index ************ [index] * Menu: * d: Using pinentry. (line 20) * debug: Using pinentry. (line 20) * display: Using pinentry. (line 46) * e: Using pinentry. (line 26) * enhanced: Using pinentry. (line 26) * g: Using pinentry. (line 31) * help: Using pinentry. (line 15) * lc-messa: Using pinentry. (line 46) * lc-type: Using pinentry. (line 46) * no-global-grab: Using pinentry. (line 31) * parent-wid: Using pinentry. (line 38) * ttyname: Using pinentry. (line 46) * ttytype: Using pinentry. (line 46) * version: Using pinentry. (line 12)  File: pinentry.info, Node: Index, Prev: Option Index, Up: Top Index ***** [index] * Menu: * GPL, GNU General Public License: Copying. (line 6) * introduction: Top. (line 6)  Tag Table: Node: Top811 Node: Using pinentry2002 Node: Protocol3677 Node: Copying8499 Node: Option Index27692 Node: Index28847  End Tag Table pinentry-x2go-0.7.5.6/doc/pinentry.texi0000644000000000000000000002464312070425227014624 0ustar \input texinfo @c -*-texinfo-*- @c %**start of header @setfilename pinentry.info @include version.texi @macro copyrightnotice Copyright @copyright{} 2002, 2005 g10 Code GmbH @end macro @macro permissionnotice Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The text of the license can be found in the section entitled ``Copying''. @end macro @macro pinentry @sc{pinentry} @end macro @settitle Using the PIN-Entry @c Create a separate index for command line options. @defcodeindex op @c Merge the standard indexes into a single one. @syncodeindex fn cp @syncodeindex vr cp @syncodeindex ky cp @syncodeindex pg cp @syncodeindex tp cp @c printing stuff taken from gcc. @macro gnupgtabopt{body} @code{\body\} @end macro @macro gnupgoptlist{body} @smallexample \body\ @end smallexample @end macro @c Makeinfo handles the above macro OK, TeX needs manual line breaks; @c they get lost at some point in handling the macro. But if @macro is @c used here rather than @alias, it produces double line breaks. @iftex @alias gol = * @end iftex @ifnottex @macro gol @end macro @end ifnottex @c Change the font used for @def... commands, since the default @c proportional one used is bad for names starting __. @tex \global\setfont\defbf\ttbshape{10}{\magstep1} @end tex @c %**end of header @ifnottex @dircategory GNU Utilities @direntry * pinentry: (pinentry). Ask securely for a passphrase or PIN. @end direntry This file documents the use and the internals of the @pinentry{}. This is edition @value{EDITION}, last updated @value{UPDATED}, of @cite{The `PINEntry' Manual}, for version @value{VERSION}. @sp 1 Published by g10 Code GmbH@* Hüttenstr. 61@* 40699 Erkrath, Germany @sp 1 @copyrightnotice{} @sp 1 @permissionnotice{} @end ifnottex @setchapternewpage odd @titlepage @title Using the PIN-Entry @subtitle Version @value{VERSION} @subtitle @value{UPDATED} @author Werner Koch @code{(wk@@gnupg.org)} @page @vskip 0pt plus 1filll @copyrightnotice{} @sp 2 @permissionnotice{} @end titlepage @summarycontents @contents @page @node Top @top Introduction @cindex introduction This manual documents how to use the @pinentry{} and its protocol. The @pinentry{} is a small GUI application used to enter PINs or passphrases. It is usually invoked by @sc{gpg-agent} (@pxref{Invoking GPG-AGENT, ,Invoking the gpg-agent, gnupg, The `GNU Privacy Guard' Manual}, for details). @pinentry{} comes in 3 flavors to fit the look and feel of the used GUI toolkit: A @sc{GTK+} based one named @code{pinentry-gtk}, a @sc{Qt} based one named @code{pinentry-qt} and a non-graphical one based on curses and named @code{pinentry-curses}. Not all of them might be available on your installation. If curses is supported on your system, the GUI based flavors fall back to curses when the @code{DISPLAY} variable is not set. @menu * Using pinentry:: How to use the beast. Developer information * Protocol:: The Assuan protocol description. Miscellaneous * Copying:: GNU General Public License says how you can copy and share PIN-Entry as well as this manual. Indices * Option Index:: Index to command line options. * Index:: Index of concepts and symbol names. @end menu @node Using pinentry @chapter How to use the @pinentry{} @c man begin DESCRIPTION You may run @pinentry{} directly from the command line and pass the commands according to the Assuan protocol via stdin/stdout. @c man end @c man begin OPTIONS Here is a list of options supported by all 3 flavors of pinentry @table @gnupgtabopt @item --version @opindex version Print the program version and licensing information. @item --help @opindex help Print a usage message summarizing the most useful command line options. @item --debug @itemx -d @opindex debug @opindex d Turn on some debugging. Mostly useful for the maintainers. Note that this may reveal sensitive information like the entered passphrase. @item --enhanced @itemx -e @opindex enhanced @opindex e Ask for timeouts and insurance, too. Note that this is currently not fully supported. @item --no-global-grab @itemx -g @opindex no-global-grab @opindex g Grab the keyboard only when the window is focused. Use this option if you are debugging software using the @pinentry{}; otherwise you may not be able to to access your X session anymore (unless you have other means to connect to the machine to kill the @pinentry{}). @item --parent-wid @var{n} @opindex parent-wid Use window ID @var{n} as the parent window for positioning the window. Note, that this is not fully supported by all flavors of @pinentry{}. @item --display @var{string} @itemx --ttyname @var{string} @itemx --ttytype @var{string} @itemx --lc-type @var{string} @itemx --lc-messages @var{string} @opindex display @opindex ttyname @opindex ttytype @opindex lc-type @opindex lc-messa These options are used to pass localization information to @pinentry{}. They are required because @pinentry{} is usually called by some background process which does not have any information on the locale and terminal to use. Assuan protocol options are an alternative way to pass these information. @end table @c @c Assuan Protocol @c @node Protocol @chapter pinentry's Assuan Protocol The PIN-Entry should never service more than one connection at once. It is reasonable to exec the PIN-Entry prior to a request. The PIN-Entry does not need to stay in memory because the @sc{gpg-agent} has the ability to cache passphrases. The usual way to run the PIN-Entry is by setting up a pipe (and not a socket) and then fork/exec the PIN-Entry. The communication is then done by means of the protocol described here until the client is satisfied with the result. Although it is called a PIN-Entry, it does allow to enter reasonably long strings (at least 2048 characters are supported by every pinentry). The client using the PIN-Entry has to check for correctness. Note that all strings are expected to be encoded as UTF-8; @pinentry{} takes care of converting it to the locally used codeset. To include linefeeds or other special characters, you may percent-escape them (i.e. a line feed is encoded as @code{%0A}, the percent sign itself is encoded as @code{%25}). Here is the list of supported commands: @table @gnupgtabopt @item Set the descriptive text to be displayed @example C: SETDESC Enter PIN for Richard Nixon S: OK @end example @item Set the prompt to be shown When asking for a PIN, set the text just before the widget for passphrase entry. @example C: SETPROMPT PIN: S: OK @end example @item Set the button texts There are two text with can be set to override the English defaults: To set the text for the button signaling confirmation (in UTF-8). @example C: SETOK Yes S: OK @end example To set the text for the button signaling cancellation or disagreement (in UTF-8). @example C: SETCANCEL No S: OK @end example @item Set the Error text This is used by the client to display an error message. In contrast to the other commands this error message is automatically reset with a GETPIN or CONFIRM, and is only displayed when asking for a PIN. @example C: SETERROR Invalid PIN entered - please try again S: OK @end example @item Enable a passphrase quality indicator Adds a quality indicator to the GETPIN window. This indicator is updated as the passphrase is typed. The clients needs to implement an inquiry named "QUALITY" which gets passed the current passpharse (percent-plus escaped) and should send back a string with a single numerical vauelue between -100 and 100. Negative values will be displayed in red. @example C: SETQUALITYBAR S: OK @end example If a custom label for the quality bar is required, just add that label as an argument as percent escaped string. You will need this feature to translate the label because pinentry has no internal gettext except for stock strings from the toolkit library. If you want to show a tooltip for the quality bar, you may use @example C: SETQUALITYBAR_TT string S: OK @end example @noindent With STRING being a percent escaped string shown as the tooltip. @item Ask for a PIN The meat of this tool is to ask for a passphrase of PIN, it is done with this command: @example C: GETPIN S: D no more tapes S: OK @end example Note that the passphrase is transmitted in clear using standard data responses. Expect it to be in UTF-8. @item Ask for confirmation To ask for a confirmation (yes or no), you can use this command: @example C: CONFIRM S: OK @end example The client should use SETDESC to set an appropriate text before issuing this command, and may use SETPROMPT to set the button texts. The value returned is either OK for YES or the error code @code{ASSUAN_Not_Confirmed}. @item Show a message To show a message, you can use this command: @example C: MESSAGE S: OK @end example alternativly you may add an option to confirm: @example C: CONFIRM --one-button S: OK @end example The client should use SETDESC to set an appropriate text before issuing this command, and may use SETOK to set the text for the dismiss button. The value returned is OK or an error message. @item Set the output device When using X, the @pinentry{} program must be invoked with an appropriate @code{DISPLAY} environment variable or the @code{--display} option. When using a text terminal: @example C: OPTION ttyname=/dev/tty3 S: OK C: OPTION ttytype=vt100 S: OK C: OPTION lc-ctype=de_DE.UTF-8 S: OK @end example The client should use the @code{ttyname} option to set the output TTY file name, the @code{ttytype} option to the @code{TERM} variable appropriate for this tty and @code{lc-ctype} to the locale which defines the character set to use for this terminal. @end table @c --------------------------------------------------------------------- @c Legal Blurbs @c --------------------------------------------------------------------- @include gpl.texi @c --------------------------------------------------------------------- @c Indexes @c --------------------------------------------------------------------- @node Option Index @unnumbered Option Index @printindex op @node Index @unnumbered Index @printindex cp @c --------------------------------------------------------------------- @c Epilogue @c --------------------------------------------------------------------- @bye pinentry-x2go-0.7.5.6/doc/stamp-vti0000644000000000000000000000015012070425227013713 0ustar @set UPDATED 10 August 2012 @set UPDATED-MONTH 10 August 2012 @set EDITION 0.7.5.6 @set VERSION 0.7.5.6 pinentry-x2go-0.7.5.6/doc/version.texi0000644000000000000000000000014512070425227014430 0ustar @set UPDATED 10 August 2012 @set UPDATED-MONTH August 2012 @set EDITION 0.7.5.6 @set VERSION 0.7.5.6 pinentry-x2go-0.7.5.6/m4/glib.m40000644000000000000000000002037412070425227013010 0ustar # Configure paths for GLIB # Owen Taylor 97-11-3 dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or dnl gthread is specified in MODULES, pass to glib-config dnl AC_DEFUN([AM_PATH_GLIB], [dnl dnl Get the cflags and libraries from the glib-config script dnl AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)], glib_config_prefix="$withval", glib_config_prefix="") AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)], glib_config_exec_prefix="$withval", glib_config_exec_prefix="") AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program], , enable_glibtest=yes) if test x$glib_config_exec_prefix != x ; then glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix" if test x${GLIB_CONFIG+set} != xset ; then GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config fi fi if test x$glib_config_prefix != x ; then glib_config_args="$glib_config_args --prefix=$glib_config_prefix" if test x${GLIB_CONFIG+set} != xset ; then GLIB_CONFIG=$glib_config_prefix/bin/glib-config fi fi for module in . $4 do case "$module" in gmodule) glib_config_args="$glib_config_args gmodule" ;; gthread) glib_config_args="$glib_config_args gthread" ;; esac done AC_PATH_PROG(GLIB_CONFIG, glib-config, no) min_glib_version=ifelse([$1], ,0.99.7,$1) AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) no_glib="" if test "$GLIB_CONFIG" = "no" ; then no_glib=yes else GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags` GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs` glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_glibtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$GLIB_LIBS $LIBS" dnl dnl Now check if the installed GLIB is sufficiently new. (Also sanity dnl checks the results of glib-config to some extent dnl rm -f conf.glibtest AC_TRY_RUN([ #include #include #include int main () { int major, minor, micro; char *tmp_version; system ("touch conf.glibtest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_glib_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_glib_version"); exit(1); } if ((glib_major_version != $glib_config_major_version) || (glib_minor_version != $glib_config_minor_version) || (glib_micro_version != $glib_config_micro_version)) { printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, glib_major_version, glib_minor_version, glib_micro_version); printf ("*** was found! If glib-config was correct, then it is best\n"); printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n"); printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } else if ((glib_major_version != GLIB_MAJOR_VERSION) || (glib_minor_version != GLIB_MINOR_VERSION) || (glib_micro_version != GLIB_MICRO_VERSION)) { printf("*** GLIB header files (version %d.%d.%d) do not match\n", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", glib_major_version, glib_minor_version, glib_micro_version); } else { if ((glib_major_version > major) || ((glib_major_version == major) && (glib_minor_version > minor)) || ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", glib_major_version, glib_minor_version, glib_micro_version); printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the glib-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n"); printf("*** correct copy of glib-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_glib" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$GLIB_CONFIG" = "no" ; then echo "*** The glib-config script installed by GLIB could not be found" echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the GLIB_CONFIG environment variable to the" echo "*** full path to glib-config." else if test -f conf.glibtest ; then : else echo "*** Could not run GLIB test program, checking why..." CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" AC_TRY_LINK([ #include #include ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GLIB or finding the wrong" echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" echo "***" echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" echo "*** came with the system with the command" echo "***" echo "*** rpm --erase --nodeps gtk gtk-devel" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GLIB was incorrectly installed" echo "*** or that you have moved GLIB since it was installed. In the latter case, you" echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GLIB_CFLAGS="" GLIB_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) rm -f conf.glibtest ]) pinentry-x2go-0.7.5.6/m4/iconv.m40000644000000000000000000000665312070425227013215 0ustar # iconv.m4 serial AM4 (gettext-0.11.3) dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_func_iconv=yes) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_lib_iconv=yes am_cv_func_iconv=yes) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST(LIBICONV) AC_SUBST(LTLIBICONV) ]) AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL(am_cv_proto_iconv, [ AC_TRY_COMPILE([ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([$]{ac_t:- }[$]am_cv_proto_iconv) AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, [Define as const if the declaration of iconv() needs const.]) fi ]) pinentry-x2go-0.7.5.6/Makefile.am0000644000000000000000000000237012070425227013341 0ustar # Makefile.am # Copyright (C) 2002 g10 Code GmbH # # This file is part of PINENTRY. # # PINENTRY is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # PINENTRY is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA ## Process this file with automake to produce Makefile.in ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = SUBDIRS = assuan secmem pinentry pinentry-x2go install-exec-local: @list='$(bin_PROGRAMS)'; for p in $$list; do \ echo " $(SETCAP) cap_ipc_lock+p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ $(SETCAP) cap_ipc_lock+p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'` || true; \ done pinentry-x2go-0.7.5.6/NEWS0000644000000000000000000001252012070425227012002 0ustar Noteworthy changes in version 0.7.5.5 (2012-06-21) ------------------------------------------------ * Continue development... Noteworthy changes in version 0.7.5.4 (2012-06-14) ------------------------------------------------ * Drop more build cruft from /doc folder. Noteworthy changes in version 0.7.5.3 (2012-06-13) ------------------------------------------------ * Update of copyright headers in pinentry-x2go folder. Noteworthy changes in version 0.7.5.2 (2012-06-13) ------------------------------------------------ * Reduce code tree completely to files needed for building pinentry-x2go. Drop a lot of cruft. * Make software buildable with native autotools, for further instructions see the README file. Noteworthy changes in version 0.7.5.1 (2011-10-12) ------------------------------------------------ * Set font size in pinentry dialog to 14. Noteworthy changes in version 0.7.5.0 (2011-03-21) ------------------------------------------------ * Changed version nunmbering scheme, project context is X2go (thus, this is a pinentry fork...) Noteworthy changes in version 0.7.5 (2008-02-15) ------------------------------------------------ * Fix cross compilation for Gtk+-2 pinentry. * New Assuan command GETINFO with subcommands "version" and "pid". Noteworthy changes in version 0.7.4 (2007-11-29) ------------------------------------------------ * Pinentry-gtk-2 and pinentry-qt now support a simple passphrase quality indicator. Noteworthy changes in version 0.7.3 (2007-07-06) ------------------------------------------------ * New command MESSAGE and --one-button compatibility option to CONFIRM. * New Assuan option touch-file to set a file which will be touched after ncurses does not need the display anymore. * New option --colors=FG,BG,SO to set the colors for the curses pinentry. * Pinentry-w32 does now basicaly work. It needs some finishing though. For example the buttons should resize themself according to the size of the text. Noteworthy changes in version 0.7.2 (2005-01-27) ------------------------------------------------ * Remove bug in configure script that would use installed version of Qt even if another path was explicitely specified with QTDIR. * Honor the rpath setting for Qt. * Add GTK+-2 pinentry. * Install a symbolic link under the name "pinentry" that defaults to pinentry-gtk, pinentry-qt, pinentry-gtk-2, or pinentry-curses, in that order. Noteworthy changes in version 0.7.1 (2004-04-21) ------------------------------------------------ * Removed unneeded Assuan cruft. * Fixes for *BSD. Noteworthy changes in version 0.7.0 (2003-12-23) ------------------------------------------------ * Make UTF8 description (prompt, error message, button texts) work. * Make sure that secmem_term is called before program termination. * Make assuan in Gtk and Curses pinentry use secure memory for storage. * Fixed a bug that would occur if a canceled GETPIN was immediately followed by a CONFIRM. * Disabled undo/redo in Qt pinentry. * Print diagnostics for locale problems and return a new error code in that case. Noteworthy changes in version 0.6.8 (2003-02-07) ------------------------------------------------ * Bug fix in pinentry-qt. Noteworthy changes in version 0.6.7 (2002-11-20) ------------------------------------------------ * Workaround for a bug in the curses version which led to an infinite loop. Noteworthy changes in version 0.6.6 (2002-11-09) ------------------------------------------------ * Fixed handling of DISPLAY and --display for the sake of the curses fallback. * UTF-8 conversion does now work for the GTK+ and CURSES version. Noteworthy changes in version 0.6.5 (2002-09-30) ------------------------------------------------ * Handle Assuan options in the qt version. Noteworthy changes in version 0.6.4 (2002-08-19) ------------------------------------------------ * Handle CONFIRM command in the qt version. Noteworthy changes in version 0.6.3 (2002-06-26) ------------------------------------------------ * Minor bug fixes to the qt version. Noteworthy changes in version 0.6.2 (2002-05-13) ------------------------------------------------ * Error texts can now be percent-escaped. * The Curses pinentry supports multi-line error texts. * The GTK+ and Qt pinentry can fall back to curses if no display is available. Noteworthy changes in version 0.6.1 (2002-04-25) ------------------------------------------------ * The Curses pinentry supports user-provided button texts via the new SETOK and SETCANCEL commands. * The Curses pinentry supports setting the desired character set locale with --lc-ctype and correctly translates the UTF-8 strings into that. Noteworthy changes in version 0.6.0 (2002-04-05) ------------------------------------------------ * Merged all pinentry frontends into a single module. * There is now a Curses frontend. * The curses pinentry supports --ttyname and --ttytype options to set the desired input/output terminal and its type. Noteworthy changes in version 0.5.1 (2002-02-18) ------------------------------------------------ * CONFIRM command works Noteworthy changes in version 0.5.0 (2002-01-04) ------------------------------------------------ * Window layout is somewhat nicer * percent escape sequences do now work for SETDESC and SETERROR pinentry-x2go-0.7.5.6/pinentry/Makefile.am0000644000000000000000000000227112070425227015211 0ustar # Pinentry support library Makefile # Copyright (C) 2002 g10 Code GmbH # # This file is part of PINENTRY. # # PINENTRY is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # PINENTRY is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA ## Process this file with automake to produce Makefile.in EXTRA_DIST = Manifest if BUILD_LIBPINENTRY_CURSES pinentry_curses = libpinentry-curses.a else pinentry_curses = endif noinst_LIBRARIES = libpinentry.a $(pinentry_curses) AM_CPPFLAGS = -I$(top_srcdir)/assuan -I$(top_srcdir)/secmem libpinentry_a_SOURCES = pinentry.h pinentry.c libpinentry_curses_a_SOURCES = pinentry-curses.h pinentry-curses.c pinentry-x2go-0.7.5.6/pinentry/pinentry.c0000644000000000000000000006252712070425227015203 0ustar /* pinentry.c - The PIN entry support library Copyright (C) 2002, 2003, 2007, 2008 g10 Code GmbH This file is part of PINENTRY. PINENTRY is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. PINENTRY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #ifdef HAVE_LANGINFO_H #include #endif #include #if defined FALLBACK_CURSES || defined PINENTRY_CURSES || defined PINENTRY_GTK #include #endif #include "assuan.h" #include "memory.h" #include "secmem-util.h" #include "pinentry.h" /* Keep the name of our program here. */ static char this_pgmname[50]; struct pinentry pinentry = { NULL, /* Description. */ NULL, /* Error. */ NULL, /* Prompt. */ NULL, /* Ok button. */ NULL, /* Cancel button. */ NULL, /* PIN. */ 2048, /* PIN length. */ 0, /* Display. */ 0, /* TTY name. */ 0, /* TTY type. */ 0, /* TTY LC_CTYPE. */ 0, /* TTY LC_MESSAGES. */ 0, /* Debug mode. */ 0, /* Enhanced mode. */ 1, /* Global grab. */ 0, /* Parent Window ID. */ NULL, /* Touch file. */ 0, /* Result. */ 0, /* Locale error flag. */ 0, /* One-button flag. */ NULL, /* Quality-Bar flag and description. */ NULL, /* Quality-Bar tooltip. */ PINENTRY_COLOR_DEFAULT, 0, PINENTRY_COLOR_DEFAULT, PINENTRY_COLOR_DEFAULT, 0, NULL /* Assuan context. */ }; #if defined FALLBACK_CURSES || defined PINENTRY_CURSES || defined PINENTRY_GTK char * pinentry_utf8_to_local (char *lc_ctype, char *text) { iconv_t cd; const char *input = text; size_t input_len = strlen (text) + 1; char *output; size_t output_len; char *output_buf; size_t processed; char *old_ctype; char *target_encoding; /* If no locale setting could be determined, simply copy the string. */ if (!lc_ctype) { fprintf (stderr, "%s: no LC_CTYPE known - assuming UTF-8\n", this_pgmname); return strdup (text); } old_ctype = strdup (setlocale (LC_CTYPE, NULL)); if (!old_ctype) return NULL; setlocale (LC_CTYPE, lc_ctype); target_encoding = nl_langinfo (CODESET); if (!target_encoding) target_encoding = "?"; setlocale (LC_CTYPE, old_ctype); free (old_ctype); /* This is overkill, but simplifies the iconv invocation greatly. */ output_len = input_len * MB_LEN_MAX; output_buf = output = malloc (output_len); if (!output) return NULL; cd = iconv_open (target_encoding, "UTF-8"); if (cd == (iconv_t) -1) { fprintf (stderr, "%s: can't convert from UTF-8 to %s: %s\n", this_pgmname, target_encoding, strerror (errno)); free (output_buf); return NULL; } processed = iconv (cd, &input, &input_len, &output, &output_len); iconv_close (cd); if (processed == (size_t) -1 || input_len) { fprintf (stderr, "%s: error converting from UTF-8 to %s: %s\n", this_pgmname, target_encoding, strerror (errno)); free (output_buf); return NULL; } return output_buf; } /* Convert TEXT which is encoded according to LC_CTYPE to UTF-8. With SECURE set to true, use secure memory for the returned buffer. Return NULL on error. */ char * pinentry_local_to_utf8 (char *lc_ctype, char *text, int secure) { char *old_ctype; char *source_encoding; iconv_t cd; const char *input = text; size_t input_len = strlen (text) + 1; char *output; size_t output_len; char *output_buf; size_t processed; /* If no locale setting could be determined, simply copy the string. */ if (!lc_ctype) { fprintf (stderr, "%s: no LC_CTYPE known - assuming UTF-8\n", this_pgmname); output_buf = secure? secmem_malloc (input_len) : malloc (input_len); if (output_buf) strcpy (output_buf, input); return output_buf; } old_ctype = strdup (setlocale (LC_CTYPE, NULL)); if (!old_ctype) return NULL; setlocale (LC_CTYPE, lc_ctype); source_encoding = nl_langinfo (CODESET); setlocale (LC_CTYPE, old_ctype); free (old_ctype); /* This is overkill, but simplifies the iconv invocation greatly. */ output_len = input_len * MB_LEN_MAX; output_buf = output = secure? secmem_malloc (output_len):malloc (output_len); if (!output) return NULL; cd = iconv_open ("UTF-8", source_encoding); if (cd == (iconv_t) -1) { fprintf (stderr, "%s: can't convert from %s to UTF-8: %s\n", this_pgmname, source_encoding? source_encoding : "?", strerror (errno)); if (secure) secmem_free (output_buf); else free (output_buf); return NULL; } processed = iconv (cd, &input, &input_len, &output, &output_len); iconv_close (cd); if (processed == (size_t) -1 || input_len) { fprintf (stderr, "%s: error converting from %s to UTF-8: %s\n", this_pgmname, source_encoding? source_encoding : "?", strerror (errno)); if (secure) secmem_free (output_buf); else free (output_buf); return NULL; } return output_buf; } #endif /* Copy TEXT or TEXTLEN to BUFFER and escape as required. Return a pointer to the end of the new buffer. Note that BUFFER must be large enough to keep the entire text; allocataing it 3 times of TEXTLEN is sufficient. */ static char * copy_and_escape (char *buffer, const void *text, size_t textlen) { int i; const unsigned char *s = (unsigned char *)text; char *p = buffer; for (i=0; i < textlen; i++) { if (s[i] < ' ' || s[i] == '+') { snprintf (p, 4, "%%%02X", s[i]); p += 3; } else if (s[i] == ' ') *p++ = '+'; else *p++ = s[i]; } return p; } /* Run a quality inquiry for PASSPHRASE of LENGTH. (We need LENGTH because not all backends might be able to return a proper C-string.). Returns: A value between -100 and 100 to give an estimate of the passphrase's quality. Negative values are use if the caller won't even accept that passphrase. Note that we expect just one data line which should not be escaped in any represent a numeric signed decimal value. Extra data is currently ignored but should not be send at all. */ int pinentry_inq_quality (pinentry_t pin, const char *passphrase, size_t length) { ASSUAN_CONTEXT ctx = pin->ctx_assuan; const char prefix[] = "INQUIRE QUALITY "; char *command; char *line; size_t linelen; int gotvalue = 0; int value = 0; int rc; if (!ctx) return 0; /* Can't run the callback. */ if (length > 300) length = 300; /* Limit so that it definitely fits into an Assuan line. */ command = secmem_malloc (strlen (prefix) + 3*length + 1); if (!command) return 0; strcpy (command, prefix); copy_and_escape (command + strlen(command), passphrase, length); rc = assuan_write_line (ctx, command); secmem_free (command); if (rc) { fprintf (stderr, "ASSUAN WRITE LINE failed: rc=%d\n", rc); return 0; } for (;;) { do { rc = assuan_read_line (ctx, &line, &linelen); if (rc) { fprintf (stderr, "ASSUAN READ LINE failed: rc=%d\n", rc); return 0; } } while (*line == '#' || !linelen); if (line[0] == 'E' && line[1] == 'N' && line[2] == 'D' && (!line[3] || line[3] == ' ')) break; /* END command received*/ if (line[0] == 'C' && line[1] == 'A' && line[2] == 'N' && (!line[3] || line[3] == ' ')) break; /* CAN command received*/ if (line[0] == 'E' && line[1] == 'R' && line[2] == 'R' && (!line[3] || line[3] == ' ')) break; /* ERR command received*/ if (line[0] != 'D' || line[1] != ' ' || linelen < 3 || gotvalue) continue; gotvalue = 1; value = atoi (line+2); } if (value < -100) value = -100; else if (value > 100) value = 100; return value; } /* Try to make room for at least LEN bytes in the pinentry. Returns new buffer on success and 0 on failure or when the old buffer is sufficient. */ char * pinentry_setbufferlen (pinentry_t pin, int len) { char *newp; if (len < pinentry.pin_len) return NULL; newp = secmem_realloc (pin->pin, 2 * pin->pin_len); if (newp) { pin->pin = newp; pin->pin_len *= 2; } else { secmem_free (pin->pin); pin->pin = 0; pin->pin_len = 0; } return newp; } /* Initialize the secure memory subsystem, drop privileges and return. Must be called early. */ void pinentry_init (const char *pgmname) { /* Store away our name. */ if (strlen (pgmname) > sizeof this_pgmname - 2) abort (); strcpy (this_pgmname, pgmname); /* Initialize secure memory. 1 is too small, so the default size will be used. */ secmem_init (1); secmem_set_flags (SECMEM_WARN); drop_privs (); if (atexit (secmem_term)) /* FIXME: Could not register at-exit function, bail out. */ ; assuan_set_malloc_hooks (secmem_malloc, secmem_realloc, secmem_free); } /* Simple test to check whether DISPLAY is set or the option --display was given. Used to decide whether the GUI or curses should be initialized. */ int pinentry_have_display (int argc, char **argv) { const char *s; s = getenv ("DISPLAY"); if (s && *s) return 1; for (; argc; argc--, argv++) if (!strcmp (*argv, "--display")) return 1; return 0; } static void usage (void) { fprintf (stdout, "Usage: %s [OPTION]...\n" "Ask securely for a secret and print it to stdout.\n" "\n" " --display DISPLAY Set the X display\n" " --ttyname PATH Set the tty terminal node name\n" " --ttytype NAME Set the tty terminal type\n" " --lc-ctype Set the tty LC_CTYPE value\n" " --lc-messages Set the tty LC_MESSAGES value\n" " -e, --enhanced Ask for timeout and insurance, too\n" " -g, --no-global-grab Grab keyboard only while window is focused\n" " --parent-wid Parent window ID (for positioning)\n" " -d, --debug Turn on debugging output\n" " -h, --help Display this help and exit\n" " --version Output version information and exit\n", this_pgmname); } char * parse_color (char *arg, pinentry_color_t *color_p, int *bright_p) { static struct { const char *name; pinentry_color_t color; } colors[] = { { "none", PINENTRY_COLOR_NONE }, { "default", PINENTRY_COLOR_DEFAULT }, { "black", PINENTRY_COLOR_BLACK }, { "red", PINENTRY_COLOR_RED }, { "green", PINENTRY_COLOR_GREEN }, { "yellow", PINENTRY_COLOR_YELLOW }, { "blue", PINENTRY_COLOR_BLUE }, { "magenta", PINENTRY_COLOR_MAGENTA }, { "cyan", PINENTRY_COLOR_CYAN }, { "white", PINENTRY_COLOR_WHITE } }; int i; char *new_arg; pinentry_color_t color = PINENTRY_COLOR_DEFAULT; if (!arg) return NULL; new_arg = strchr (arg, ','); if (new_arg) new_arg++; if (bright_p) { const char *bname[] = { "bright-", "bright", "bold-", "bold" }; *bright_p = 0; for (i = 0; i < sizeof (bname) / sizeof (bname[0]); i++) if (!strncasecmp (arg, bname[i], strlen (bname[i]))) { *bright_p = 1; arg += strlen (bname[i]); } } for (i = 0; i < sizeof (colors) / sizeof (colors[0]); i++) if (!strncasecmp (arg, colors[i].name, strlen (colors[i].name))) color = colors[i].color; *color_p = color; return new_arg; } /* Parse the command line options. Returns 1 if user should print version and exit. Can exit the program if only help output is requested. */ int pinentry_parse_opts (int argc, char *argv[]) { int opt; int opt_help = 0; int opt_version = 0; struct option opts[] = {{ "debug", no_argument, 0, 'd' }, { "display", required_argument, 0, 'D' }, { "ttyname", required_argument, 0, 'T' }, { "ttytype", required_argument, 0, 'N' }, { "lc-ctype", required_argument, 0, 'C' }, { "lc-messages", required_argument, 0, 'M' }, { "enhanced", no_argument, 0, 'e' }, { "no-global-grab", no_argument, 0, 'g' }, { "parent-wid", required_argument, 0, 'W' }, { "colors", required_argument, 0, 'c' }, { "help", no_argument, 0, 'h' }, { "version", no_argument, &opt_version, 1 }, { NULL, 0, NULL, 0 }}; while ((opt = getopt_long (argc, argv, "degh", opts, NULL)) != -1) { switch (opt) { case 0: case '?': break; case 'd': pinentry.debug = 1; break; case 'e': pinentry.enhanced = 1; break; case 'g': pinentry.grab = 0; break; case 'h': opt_help = 1; break; case 'D': /* Note, this is currently not used because the GUI engine has already been initialized when parsing these options. */ pinentry.display = strdup (optarg); if (!pinentry.display) { fprintf (stderr, "%s: %s\n", this_pgmname, strerror (errno)); exit (EXIT_FAILURE); } break; case 'T': pinentry.ttyname = strdup (optarg); if (!pinentry.ttyname) { fprintf (stderr, "%s: %s\n", this_pgmname, strerror (errno)); exit (EXIT_FAILURE); } break; case 'N': pinentry.ttytype = strdup (optarg); if (!pinentry.ttytype) { fprintf (stderr, "%s: %s\n", this_pgmname, strerror (errno)); exit (EXIT_FAILURE); } break; case 'C': pinentry.lc_ctype = strdup (optarg); if (!pinentry.lc_ctype) { fprintf (stderr, "%s: %s\n", this_pgmname, strerror (errno)); exit (EXIT_FAILURE); } break; case 'M': pinentry.lc_messages = strdup (optarg); if (!pinentry.lc_messages) { fprintf (stderr, "%s: %s\n", this_pgmname, strerror (errno)); exit (EXIT_FAILURE); } break; case 'W': pinentry.parent_wid = atoi (optarg); /* FIXME: Add some error handling. Use strtol. */ break; case 'c': optarg = parse_color (optarg, &pinentry.color_fg, &pinentry.color_fg_bright); optarg = parse_color (optarg, &pinentry.color_bg, NULL); optarg = parse_color (optarg, &pinentry.color_so, &pinentry.color_so_bright); break; default: fprintf (stderr, "%s: oops: option not handled\n", this_pgmname); break; } } if (opt_version) return 1; if (opt_help) { usage (); exit (EXIT_SUCCESS); } return 0; } static int option_handler (ASSUAN_CONTEXT ctx, const char *key, const char *value) { if (!strcmp (key, "no-grab") && !*value) pinentry.grab = 0; else if (!strcmp (key, "grab") && !*value) pinentry.grab = 1; else if (!strcmp (key, "debug-wait")) { fprintf (stderr, "%s: waiting for debugger - my pid is %u ...\n", this_pgmname, (unsigned int) getpid()); sleep (*value?atoi (value):5); fprintf (stderr, "%s: ... okay\n", this_pgmname); } else if (!strcmp (key, "display")) { if (pinentry.display) free (pinentry.display); pinentry.display = strdup (value); if (!pinentry.display) return ASSUAN_Out_Of_Core; } else if (!strcmp (key, "ttyname")) { if (pinentry.ttyname) free (pinentry.ttyname); pinentry.ttyname = strdup (value); if (!pinentry.ttyname) return ASSUAN_Out_Of_Core; } else if (!strcmp (key, "ttytype")) { if (pinentry.ttytype) free (pinentry.ttytype); pinentry.ttytype = strdup (value); if (!pinentry.ttytype) return ASSUAN_Out_Of_Core; } else if (!strcmp (key, "lc-ctype")) { if (pinentry.lc_ctype) free (pinentry.lc_ctype); pinentry.lc_ctype = strdup (value); if (!pinentry.lc_ctype) return ASSUAN_Out_Of_Core; } else if (!strcmp (key, "lc-messages")) { if (pinentry.lc_messages) free (pinentry.lc_messages); pinentry.lc_messages = strdup (value); if (!pinentry.lc_messages) return ASSUAN_Out_Of_Core; } else if (!strcmp (key, "parent-wid")) { pinentry.parent_wid = atoi (value); /* FIXME: Use strtol and add some error handling. */ } else if (!strcmp (key, "touch-file")) { if (pinentry.touch_file) free (pinentry.touch_file); pinentry.touch_file = strdup (value); if (!pinentry.touch_file) return ASSUAN_Out_Of_Core; } else return ASSUAN_Invalid_Option; return 0; } /* Note, that it is sufficient to allocate the target string D as long as the source string S, i.e.: strlen(s)+1; */ static void strcpy_escaped (char *d, const unsigned char *s) { while (*s) { if (*s == '%' && s[1] && s[2]) { s++; *d++ = xtoi_2 ( s); s += 2; } else *d++ = *s++; } *d = 0; } static int cmd_setdesc (ASSUAN_CONTEXT ctx, char *line) { char *newd; newd = malloc (strlen (line) + 1); if (!newd) return ASSUAN_Out_Of_Core; strcpy_escaped (newd, line); if (pinentry.description) free (pinentry.description); pinentry.description = newd; return 0; } static int cmd_setprompt (ASSUAN_CONTEXT ctx, char *line) { char *newp; newp = malloc (strlen (line) + 1); if (!newp) return ASSUAN_Out_Of_Core; strcpy_escaped (newp, line); if (pinentry.prompt) free (pinentry.prompt); pinentry.prompt = newp; return 0; } static int cmd_seterror (ASSUAN_CONTEXT ctx, char *line) { char *newe; newe = malloc (strlen (line) + 1); if (!newe) return ASSUAN_Out_Of_Core; strcpy_escaped (newe, line); if (pinentry.error) free (pinentry.error); pinentry.error = newe; return 0; } static int cmd_setok (ASSUAN_CONTEXT ctx, char *line) { char *newo; newo = malloc (strlen (line) + 1); if (!newo) return ASSUAN_Out_Of_Core; strcpy_escaped (newo, line); if (pinentry.ok) free (pinentry.ok); pinentry.ok = newo; return 0; } static int cmd_setcancel (ASSUAN_CONTEXT ctx, char *line) { char *newc; newc = malloc (strlen (line) + 1); if (!newc) return ASSUAN_Out_Of_Core; strcpy_escaped (newc, line); if (pinentry.cancel) free (pinentry.cancel); pinentry.cancel = newc; return 0; } static int cmd_setqualitybar (ASSUAN_CONTEXT ctx, char *line) { char *newval; if (!*line) line = "Quality:"; newval = malloc (strlen (line) + 1); if (!newval) return ASSUAN_Out_Of_Core; strcpy_escaped (newval, line); if (pinentry.quality_bar) free (pinentry.quality_bar); pinentry.quality_bar = newval; return 0; } /* Set the tooltip to be used for a quality bar. */ static int cmd_setqualitybar_tt (ASSUAN_CONTEXT ctx, char *line) { char *newval; if (*line) { newval = malloc (strlen (line) + 1); if (!newval) return ASSUAN_Out_Of_Core; strcpy_escaped (newval, line); } else newval = NULL; if (pinentry.quality_bar_tt) free (pinentry.quality_bar_tt); pinentry.quality_bar_tt = newval; return 0; } static int cmd_getpin (ASSUAN_CONTEXT ctx, char *line) { int result; int set_prompt = 0; pinentry.pin = secmem_malloc (pinentry.pin_len); if (!pinentry.pin) return ASSUAN_Out_Of_Core; if (!pinentry.prompt) { pinentry.prompt = "PIN:"; set_prompt = 1; } pinentry.locale_err = 0; pinentry.one_button = 0; pinentry.ctx_assuan = ctx; result = (*pinentry_cmd_handler) (&pinentry); pinentry.ctx_assuan = NULL; if (pinentry.error) { free (pinentry.error); pinentry.error = NULL; } if (set_prompt) pinentry.prompt = NULL; pinentry.quality_bar = 0; /* Reset it after the command. */ if (result < 0) { if (pinentry.pin) { secmem_free (pinentry.pin); pinentry.pin = NULL; } return pinentry.locale_err? ASSUAN_Locale_Problem: ASSUAN_Canceled; } if (result) { result = assuan_send_data (ctx, pinentry.pin, result); if (!result) result = assuan_send_data (ctx, NULL, 0); } if (pinentry.pin) { secmem_free (pinentry.pin); pinentry.pin = NULL; } return result; } /* Note that the option --one-button is hack to allow the use of old pinentries while the caller is ignoring the result. Given that options have never been used or flagged as an error the new option is an easy way to enable the messsage mode while not requiring to update pinentry or to have the caller test for the message command. New applications which are free to require an updated pinentry should use MESSAGE instead. */ static int cmd_confirm (ASSUAN_CONTEXT ctx, char *line) { int result; pinentry.one_button = !!strstr (line, "--one-button"); pinentry.quality_bar = 0; pinentry.locale_err = 0; result = (*pinentry_cmd_handler) (&pinentry); if (pinentry.error) { free (pinentry.error); pinentry.error = NULL; } return result ? 0 : (pinentry.locale_err? ASSUAN_Locale_Problem : (pinentry.one_button ? 0 : ASSUAN_Not_Confirmed)); } static int cmd_message (ASSUAN_CONTEXT ctx, char *line) { int result; pinentry.one_button = 1; pinentry.quality_bar = 0; pinentry.locale_err = 0; result = (*pinentry_cmd_handler) (&pinentry); if (pinentry.error) { free (pinentry.error); pinentry.error = NULL; } return result ? 0 : (pinentry.locale_err? ASSUAN_Locale_Problem : 0); } /* GETINFO Multipurpose function to return a variety of information. Supported values for WHAT are: version - Return the version of the program. pid - Return the process id of the server. */ static int cmd_getinfo (assuan_context_t ctx, char *line) { int rc; if (!strcmp (line, "version")) { const char *s = VERSION; rc = assuan_send_data (ctx, s, strlen (s)); } else if (!strcmp (line, "pid")) { char numbuf[50]; snprintf (numbuf, sizeof numbuf, "%lu", (unsigned long)getpid ()); rc = assuan_send_data (ctx, numbuf, strlen (numbuf)); } else rc = ASSUAN_Parameter_Error; return rc; } /* Tell the assuan library about our commands. */ static int register_commands (ASSUAN_CONTEXT ctx) { static struct { const char *name; int cmd_id; int (*handler) (ASSUAN_CONTEXT, char *line); } table[] = { { "SETDESC", 0, cmd_setdesc }, { "SETPROMPT", 0, cmd_setprompt }, { "SETERROR", 0, cmd_seterror }, { "SETOK", 0, cmd_setok }, { "SETCANCEL", 0, cmd_setcancel }, { "GETPIN", 0, cmd_getpin }, { "CONFIRM", 0, cmd_confirm }, { "MESSAGE", 0, cmd_message }, { "SETQUALITYBAR", 0, cmd_setqualitybar }, { "SETQUALITYBAR_TT", 0, cmd_setqualitybar_tt }, { "GETINFO", 0, cmd_getinfo }, { NULL } }; int i, j, rc; for (i = j = 0; table[i].name; i++) { rc = assuan_register_command (ctx, table[i].cmd_id ? table[i].cmd_id : (ASSUAN_CMD_USER + j++), table[i].name, table[i].handler); if (rc) return rc; } return 0; } /* Start the pinentry event loop. The program will start to process Assuan commands until it is finished or an error occurs. If an error occurs, -1 is returned. Otherwise, 0 is returned. */ int pinentry_loop (void) { int rc; int filedes[2]; ASSUAN_CONTEXT ctx; /* Extra check to make sure we have dropped privs. */ #ifndef HAVE_DOSISH_SYSTEM if (getuid() != geteuid()) abort (); #endif /* For now we use a simple pipe based server so that we can work from scripts. We will later add options to run as a daemon and wait for requests on a Unix domain socket. */ filedes[0] = 0; filedes[1] = 1; rc = assuan_init_pipe_server (&ctx, filedes); if (rc) { fprintf (stderr, "%s: failed to initialize the server: %s\n", this_pgmname, assuan_strerror(rc)); return -1; } rc = register_commands (ctx); if (rc) { fprintf (stderr, "%s: failed to the register commands with Assuan: %s\n", this_pgmname, assuan_strerror(rc)); return -1; } assuan_register_option_handler (ctx, option_handler); #if 0 assuan_set_log_stream (ctx, stderr); #endif for (;;) { rc = assuan_accept (ctx); if (rc == -1) break; else if (rc) { fprintf (stderr, "%s: Assuan accept problem: %s\n", this_pgmname, assuan_strerror (rc)); break; } rc = assuan_process (ctx); if (rc) { fprintf (stderr, "%s: Assuan processing failed: %s\n", this_pgmname, assuan_strerror (rc)); continue; } } assuan_deinit_server (ctx); return 0; } pinentry-x2go-0.7.5.6/pinentry/pinentry-curses.c0000644000000000000000000004207212070425227016476 0ustar /* pinentry-curses.c - A secure curses dialog for PIN entry, library version Copyright (C) 2002 g10 Code GmbH This file is part of PINENTRY. PINENTRY is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. PINENTRY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_UTIME_H #include #endif /*HAVE_UTIME_H*/ #include #include "pinentry.h" #define STRING_OK "" #define STRING_CANCEL "" #define USE_COLORS (has_colors () && COLOR_PAIRS >= 2) static short pinentry_color[] = { -1, -1, COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_YELLOW, COLOR_BLUE, COLOR_MAGENTA, COLOR_CYAN, COLOR_WHITE }; static int init_screen; typedef enum { DIALOG_POS_NONE, DIALOG_POS_PIN, DIALOG_POS_OK, DIALOG_POS_CANCEL } dialog_pos_t; struct dialog { dialog_pos_t pos; int pin_y; int pin_x; /* Width of the PIN field. */ int pin_size; /* Cursor location in PIN field. */ int pin_loc; char *pin; int pin_max; /* Length of PIN. */ int pin_len; int ok_y; int ok_x; char *ok; int cancel_y; int cancel_x; char *cancel; }; typedef struct dialog *dialog_t; /* Return the next line up to MAXLEN columns wide in START and LEN. The first invocation should have 0 as *LEN. If the line ends with a \n, it is a normal line that will be continued. If it is a '\0' the end of the text is reached after this line. In all other cases there is a forced line break. A full line is returned and will be continued in the next line. */ static void collect_line (int maxlen, char **start_p, int *len_p) { int last_space = 0; int len = *len_p; char *end; /* Skip to next line. */ *start_p += len; /* Skip leading space. */ while (**start_p == ' ') (*start_p)++; end = *start_p; len = 0; while (len < maxlen - 1 && *end && *end != '\n') { len++; end++; if (*end == ' ') last_space = len; } if (*end && *end != '\n' && last_space != 0) { /* We reached the end of the available space, but still have characters to go in this line. We can break the line into two parts at a space. */ len = last_space; (*start_p)[len] = '\n'; } *len_p = len + 1; } static int dialog_create (pinentry_t pinentry, dialog_t dialog) { int err = 0; int size_y; int size_x; int y; int x; int ypos; int xpos; int description_x = 0; int error_x = 0; char *description = NULL; char *error = NULL; char *prompt = NULL; #define COPY_OUT(what) \ do \ if (pinentry->what) \ { \ what = pinentry_utf8_to_local (pinentry->lc_ctype, \ pinentry->what); \ if (!what) \ { \ err = 1; \ goto out; \ } \ } \ while (0) COPY_OUT (description); COPY_OUT (error); COPY_OUT (prompt); #define MAKE_BUTTON(which,default) \ do \ { \ char *new = NULL; \ if (pinentry->which) \ { \ int len = strlen (pinentry->which); \ new = malloc (len + 3); \ if (!new) \ { \ err = 1; \ goto out; \ } \ new[0] = '<'; \ memcpy (&new[1], pinentry->which, len); \ new[len + 1] = '>'; \ new[len + 2] = '\0'; \ } \ dialog->which = pinentry_utf8_to_local (pinentry->lc_ctype, \ new ? new : default); \ if (!dialog->which) \ { \ err = 1; \ goto out; \ } \ } \ while (0) MAKE_BUTTON (ok, STRING_OK); if (!pinentry->one_button) MAKE_BUTTON (cancel, STRING_CANCEL); else dialog->cancel = NULL; getmaxyx (stdscr, size_y, size_x); /* Check if all required lines fit on the screen. */ y = 1; /* Top frame. */ if (description) { char *start = description; int len = 0; do { collect_line (size_x - 4, &start, &len); if (len > description_x) description_x = len; y++; } while (start[len - 1]); y++; } if (pinentry->pin) { if (error) { char *p = error; int err_x = 0; while (*p) { if (*(p++) == '\n') { if (err_x > error_x) error_x = err_x; y++; err_x = 0; } else err_x++; } if (err_x > error_x) error_x = err_x; y += 2; /* Error message. */ } y += 2; /* Pin entry field. */ } y += 2; /* OK/Cancel and bottom frame. */ if (y > size_y) { err = 1; goto out; } /* Check if all required columns fit on the screen. */ x = 0; if (description) { int new_x = description_x; if (new_x > size_x - 4) new_x = size_x - 4; if (new_x > x) x = new_x; } if (pinentry->pin) { #define MIN_PINENTRY_LENGTH 40 int new_x; if (error) { new_x = error_x; if (new_x > size_x - 4) new_x = size_x - 4; if (new_x > x) x = new_x; } new_x = MIN_PINENTRY_LENGTH; if (prompt) new_x += strlen (prompt) + 1; /* One space after prompt. */ if (new_x > size_x - 4) new_x = size_x - 4; if (new_x > x) x = new_x; } /* We position the buttons after the first and second third of the width. Account for rounding. */ if (x < 2 * strlen (dialog->ok)) x = 2 * strlen (dialog->ok); if (dialog->cancel) if (x < 2 * strlen (dialog->cancel)) x = 2 * strlen (dialog->cancel); /* Add the frame. */ x += 4; if (x > size_x) { err = 1; goto out; } dialog->pos = DIALOG_POS_NONE; dialog->pin = pinentry->pin; dialog->pin_max = pinentry->pin_len; dialog->pin_loc = 0; dialog->pin_len = 0; ypos = (size_y - y) / 2; xpos = (size_x - x) / 2; move (ypos, xpos); addch (ACS_ULCORNER); hline (0, x - 2); move (ypos, xpos + x - 1); addch (ACS_URCORNER); move (ypos + 1, xpos + x - 1); vline (0, y - 2); move (ypos + y - 1, xpos); addch (ACS_LLCORNER); hline (0, x - 2); move (ypos + y - 1, xpos + x - 1); addch (ACS_LRCORNER); ypos++; if (description) { char *start = description; int len = 0; do { int i; move (ypos, xpos); addch (ACS_VLINE); addch (' '); collect_line (size_x - 4, &start, &len); for (i = 0; i < len - 1; i++) addch ((unsigned char) start[i]); if (start[len - 1] && start[len - 1] != '\n') addch ((unsigned char) start[len - 1]); ypos++; } while (start[len - 1]); move (ypos, xpos); addch (ACS_VLINE); ypos++; } if (pinentry->pin) { int i; if (error) { char *p = error; i = 0; while (*p) { move (ypos, xpos); addch (ACS_VLINE); addch (' '); if (USE_COLORS && pinentry->color_so != PINENTRY_COLOR_NONE) { attroff (COLOR_PAIR (1) | (pinentry->color_fg_bright ? A_BOLD : 0)); attron (COLOR_PAIR (2) | (pinentry->color_so_bright ? A_BOLD : 0)); } else standout (); for (;*p && *p != '\n'; p++) if (i < x - 4) { i++; addch ((unsigned char) *p); } if (USE_COLORS && pinentry->color_so != PINENTRY_COLOR_NONE) { attroff (COLOR_PAIR (2) | (pinentry->color_so_bright ? A_BOLD : 0)); attron (COLOR_PAIR (1) | (pinentry->color_fg_bright ? A_BOLD : 0)); } else standend (); if (*p == '\n') p++; i = 0; ypos++; } move (ypos, xpos); addch (ACS_VLINE); ypos++; } move (ypos, xpos); addch (ACS_VLINE); addch (' '); dialog->pin_y = ypos; dialog->pin_x = xpos + 2; dialog->pin_size = x - 4; if (prompt) { char *p = prompt; i = strlen (prompt); if (i > x - 4 - MIN_PINENTRY_LENGTH) i = x - 4 - MIN_PINENTRY_LENGTH; dialog->pin_x += i + 1; dialog->pin_size -= i + 1; while (i-- > 0) addch ((unsigned char) *(p++)); addch (' '); } for (i = 0; i < dialog->pin_size; i++) addch ('_'); ypos++; move (ypos, xpos); addch (ACS_VLINE); ypos++; } move (ypos, xpos); addch (ACS_VLINE); if (dialog->cancel) { dialog->ok_y = ypos; /* Calculating the left edge of the left button, rounding down. */ dialog->ok_x = xpos + 2 + ((x - 4) / 2 - strlen (dialog->ok)) / 2; move (dialog->ok_y, dialog->ok_x); addstr (dialog->ok); dialog->cancel_y = ypos; /* Calculating the left edge of the right button, rounding up. */ dialog->cancel_x = xpos + x - 2 - ((x - 4) / 2 + strlen (dialog->cancel)) / 2; move (dialog->cancel_y, dialog->cancel_x); addstr (dialog->cancel); } else { dialog->ok_y = ypos; /* Calculating the left edge of the OK button, rounding down. */ dialog->ok_x = xpos + x / 2 - strlen (dialog->ok) / 2; move (dialog->ok_y, dialog->ok_x); addstr (dialog->ok); } out: if (description) free (description); if (error) free (error); if (prompt) free (prompt); return err; } static void set_cursor_state (int on) { static int normal_state = -1; static int on_last; if (normal_state < 0 && !on) { normal_state = curs_set (0); on_last = on; } else if (on != on_last) { curs_set (on ? normal_state : 0); on_last = on; } } static int dialog_switch_pos (dialog_t diag, dialog_pos_t new_pos) { if (new_pos != diag->pos) { switch (diag->pos) { case DIALOG_POS_OK: move (diag->ok_y, diag->ok_x); addstr (diag->ok); break; case DIALOG_POS_CANCEL: if (diag->cancel) { move (diag->cancel_y, diag->cancel_x); addstr (diag->cancel); } break; default: break; } diag->pos = new_pos; switch (diag->pos) { case DIALOG_POS_PIN: move (diag->pin_y, diag->pin_x + diag->pin_loc); set_cursor_state (1); break; case DIALOG_POS_OK: set_cursor_state (0); move (diag->ok_y, diag->ok_x); standout (); addstr (diag->ok); standend (); move (diag->ok_y, diag->ok_x); break; case DIALOG_POS_CANCEL: if (diag->cancel) { set_cursor_state (0); move (diag->cancel_y, diag->cancel_x); standout (); addstr (diag->cancel); standend (); move (diag->cancel_y, diag->cancel_x); } break; case DIALOG_POS_NONE: set_cursor_state (0); break; } refresh (); } return 0; } /* XXX Assume that field width is at least > 5. */ static void dialog_input (dialog_t diag, int chr) { int old_loc = diag->pin_loc; assert (diag->pin); assert (diag->pos == DIALOG_POS_PIN); switch (chr) { case KEY_BACKSPACE: if (diag->pin_len > 0) { diag->pin_len--; diag->pin_loc--; if (diag->pin_loc == 0 && diag->pin_len > 0) { diag->pin_loc = diag->pin_size - 5; if (diag->pin_loc > diag->pin_len) diag->pin_loc = diag->pin_len; } } break; default: if (chr > 0 && chr < 256 && diag->pin_len < diag->pin_max) { diag->pin[diag->pin_len] = (char) chr; diag->pin_len++; diag->pin_loc++; if (diag->pin_loc == diag->pin_size && diag->pin_len < diag->pin_max) { diag->pin_loc = 5; if (diag->pin_loc < diag->pin_size - (diag->pin_max + 1 - diag->pin_len)) diag->pin_loc = diag->pin_size - (diag->pin_max + 1 - diag->pin_len); } } break; } if (old_loc < diag->pin_loc) { move (diag->pin_y, diag->pin_x + old_loc); while (old_loc++ < diag->pin_loc) addch ('*'); } else if (old_loc > diag->pin_loc) { move (diag->pin_y, diag->pin_x + diag->pin_loc); while (old_loc-- > diag->pin_loc) addch ('_'); } move (diag->pin_y, diag->pin_x + diag->pin_loc); } static int dialog_run (pinentry_t pinentry, const char *tty_name, const char *tty_type) { struct dialog diag; FILE *ttyfi = NULL; FILE *ttyfo = NULL; SCREEN *screen = 0; int done = 0; char *pin_utf8; /* Open the desired terminal if necessary. */ if (tty_name) { ttyfi = fopen (tty_name, "r"); if (!ttyfi) return -1; ttyfo = fopen (tty_name, "w"); if (!ttyfo) { int err = errno; fclose (ttyfi); errno = err; return -1; } screen = newterm (tty_type, ttyfo, ttyfi); set_term (screen); } else { if (!init_screen) { init_screen = 1; initscr (); } else clear (); } keypad (stdscr, TRUE); /* Enable keyboard mapping. */ nonl (); /* Tell curses not to do NL->CR/NL on output. */ cbreak (); /* Take input chars one at a time, no wait for \n. */ noecho (); /* Don't echo input - in color. */ if (has_colors ()) { start_color (); use_default_colors (); if (pinentry->color_so == PINENTRY_COLOR_DEFAULT) { pinentry->color_so = PINENTRY_COLOR_RED; pinentry->color_so_bright = 1; } if (COLOR_PAIRS >= 2) { init_pair (1, pinentry_color[pinentry->color_fg], pinentry_color[pinentry->color_bg]); init_pair (2, pinentry_color[pinentry->color_so], pinentry_color[pinentry->color_bg]); bkgd (COLOR_PAIR (1)); attron (COLOR_PAIR (1) | (pinentry->color_fg_bright ? A_BOLD : 0)); } } refresh (); /* XXX */ if (dialog_create (pinentry, &diag)) return -2; dialog_switch_pos (&diag, diag.pin ? DIALOG_POS_PIN : DIALOG_POS_OK); do { int c; c = getch (); /* Refresh, accept single keystroke of input. */ switch (c) { case KEY_LEFT: case KEY_UP: switch (diag.pos) { case DIALOG_POS_OK: if (diag.pin) dialog_switch_pos (&diag, DIALOG_POS_PIN); break; case DIALOG_POS_CANCEL: dialog_switch_pos (&diag, DIALOG_POS_OK); break; default: break; } break; case KEY_RIGHT: case KEY_DOWN: switch (diag.pos) { case DIALOG_POS_PIN: dialog_switch_pos (&diag, DIALOG_POS_OK); break; case DIALOG_POS_OK: dialog_switch_pos (&diag, DIALOG_POS_CANCEL); break; default: break; } break; case '\t': switch (diag.pos) { case DIALOG_POS_PIN: dialog_switch_pos (&diag, DIALOG_POS_OK); break; case DIALOG_POS_OK: dialog_switch_pos (&diag, DIALOG_POS_CANCEL); break; case DIALOG_POS_CANCEL: if (diag.pin) dialog_switch_pos (&diag, DIALOG_POS_PIN); else dialog_switch_pos (&diag, DIALOG_POS_OK); break; default: break; } break; case '\e': done = -2; break; case '\r': switch (diag.pos) { case DIALOG_POS_PIN: case DIALOG_POS_OK: done = 1; break; case DIALOG_POS_CANCEL: done = -2; break; case DIALOG_POS_NONE: break; } break; default: if (diag.pos == DIALOG_POS_PIN) dialog_input (&diag, c); } } while (!done); set_cursor_state (1); endwin (); if (screen) delscreen (screen); if (ttyfi) fclose (ttyfi); if (ttyfo) fclose (ttyfo); /* XXX Factor out into dialog_release or something. */ free (diag.ok); free (diag.cancel); if (pinentry->pin) { pinentry->locale_err = 1; pin_utf8 = pinentry_local_to_utf8 (pinentry->lc_ctype, pinentry->pin, 1); if (pin_utf8) { pinentry_setbufferlen (pinentry, strlen (pin_utf8) + 1); if (pinentry->pin) strcpy (pinentry->pin, pin_utf8); secmem_free (pin_utf8); pinentry->locale_err = 0; } } return diag.pin ? (done < 0 ? -1 : diag.pin_len) : (done < 0 ? 0 : 1); } /* If a touch has been registered, touch that file. */ static void do_touch_file (pinentry_t pinentry) { #ifdef HAVE_UTIME_H struct stat st; time_t tim; if (!pinentry->touch_file || !*pinentry->touch_file) return; if (stat (pinentry->touch_file, &st)) return; /* Oops. */ /* Make sure that we actually update the mtime. */ while ( (tim = time (NULL)) == st.st_mtime ) sleep (1); /* Update but ignore errors as we can't do anything in that case. Printing error messages may even clubber the display further. */ utime (pinentry->touch_file, NULL); #endif /*HAVE_UTIME_H*/ } int curses_cmd_handler (pinentry_t pinentry) { int rc; rc = dialog_run (pinentry, pinentry->ttyname, pinentry->ttytype); do_touch_file (pinentry); return rc; } pinentry-x2go-0.7.5.6/pinentry/pinentry-curses.h0000644000000000000000000000210112070425227016470 0ustar /* pinentry-curses.h - A secure curses dialog for PIN entry, library version Copyright (C) 2002 g10 Code GmbH This file is part of PINENTRY. PINENTRY is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. PINENTRY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef PINENTRY_CURSES_H #define PINENTRY_CURSES_H #include "pinentry.h" #ifdef __cplusplus extern "C" { #endif int curses_cmd_handler (pinentry_t pinentry); #ifdef __cplusplus } #endif #endif /* PINENTRY_CURSES_H */ pinentry-x2go-0.7.5.6/pinentry/pinentry.h0000644000000000000000000001351512070425227015201 0ustar /* pinentry.h - The interface for the PIN entry support library. Copyright (C) 2002, 2003 g10 Code GmbH This file is part of PINENTRY. PINENTRY is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. PINENTRY is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef PINENTRY_H #define PINENTRY_H #ifdef __cplusplus extern "C" { #if 0 } #endif #endif typedef enum { PINENTRY_COLOR_NONE, PINENTRY_COLOR_DEFAULT, PINENTRY_COLOR_BLACK, PINENTRY_COLOR_RED, PINENTRY_COLOR_GREEN, PINENTRY_COLOR_YELLOW, PINENTRY_COLOR_BLUE, PINENTRY_COLOR_MAGENTA, PINENTRY_COLOR_CYAN, PINENTRY_COLOR_WHITE } pinentry_color_t; struct pinentry { /* The description to display, or NULL. */ char *description; /* The error message to display, or NULL. */ char *error; /* The prompt to display, or NULL. */ char *prompt; /* The OK button text to display, or NULL. */ char *ok; /* The Cancel button text to display, or NULL. */ char *cancel; /* The buffer to store the secret into. */ char *pin; /* The length of the buffer. */ int pin_len; /* The name of the X display to use if X is available and supported. */ char *display; /* The name of the terminal node to open if X not available or supported. */ char *ttyname; /* The type of the terminal. */ char *ttytype; /* The LC_CTYPE value for the terminal. */ char *lc_ctype; /* The LC_MESSAGES value for the terminal. */ char *lc_messages; /* True if debug mode is requested. */ int debug; /* True if enhanced mode is requested. */ int enhanced; /* True if caller should grab the keyboard. */ int grab; /* The window ID of the parent window over which the pinentry window should be displayed. */ int parent_wid; /* The name of an optional file which will be touched after a curses entry has been displayed. */ char *touch_file; /* The user should set this to -1 if the user canceled the request, and to the length of the PIN stored in pin otherwise. */ int result; /* The user should set this to true if an error with the local conversion occured. */ int locale_err; /* The caller should set this to true if only one button is required. This is useful for notification dialogs where only a dismiss button is required. */ int one_button; /* If this is not NULL, a passphrase quality indicator is shown. There will also be an inquiry back to the caller to get an indication of the quality for the passphrase entered so far. The string is used as a labe for the auality bar. */ char *quality_bar; /* The tooltip to be show for the qualitybar. Malloced or NULL. */ char *quality_bar_tt; /* For the curses pinentry, the color of error messages. */ pinentry_color_t color_fg; int color_fg_bright; pinentry_color_t color_bg; pinentry_color_t color_so; int color_so_bright; /* Fo the quality indicator we need to do an inquiry. Thus we need to save the assuan ctx. */ void *ctx_assuan; }; typedef struct pinentry *pinentry_t; /* The pinentry command handler type processes the pinentry request PIN. If PIN->pin is zero, request a confirmation, otherwise a PIN entry. On confirmation, the function should return TRUE if confirmed, and FALSE otherwise. On PIN entry, the function should return -1 if cancelled and the length of the secret otherwise. */ typedef int (*pinentry_cmd_handler_t) (pinentry_t pin); /* Start the pinentry event loop. The program will start to process Assuan commands until it is finished or an error occurs. If an error occurs, -1 is returned and errno indicates the type of an error. Otherwise, 0 is returned. */ int pinentry_loop (void); /* Convert the UTF-8 encoded string TEXT to the encoding given in LC_CTYPE. Return NULL on error. */ char *pinentry_utf8_to_local (char *lc_ctype, char *text); /* Convert TEXT which is encoded according to LC_CTYPE to UTF-8. With SECURE set to true, use secure memory for the returned buffer. Return NULL on error. */ char *pinentry_local_to_utf8 (char *lc_ctype, char *text, int secure); /* Run a quality inquiry for PASSPHRASE of LENGTH. */ int pinentry_inq_quality (pinentry_t pin, const char *passphrase, size_t length); /* Try to make room for at least LEN bytes for the pin in the pinentry PIN. Returns new buffer on success and 0 on failure. */ char *pinentry_setbufferlen (pinentry_t pin, int len); /* Initialize the secure memory subsystem, drop privileges and return. Must be called early. */ void pinentry_init (const char *pgmname); /* Return true if either DISPLAY is set or ARGV contains the string "--display". */ int pinentry_have_display (int argc, char **argv); /* Parse the command line options. Returns 1 if user should print version and exit. Can exit the program if only help output is requested. */ int pinentry_parse_opts (int argc, char *argv[]); /* The caller must define this variable to process assuan commands. */ extern pinentry_cmd_handler_t pinentry_cmd_handler; #ifdef HAVE_W32_SYSTEM /* Windows declares sleep as obsolete, but provides a definition for _sleep but non for the still existing sleep. */ #define sleep(a) _sleep ((a)) #endif /*HAVE_W32_SYSTEM*/ #if 0 { #endif #ifdef __cplusplus } #endif #endif /* PINENTRY_H */ pinentry-x2go-0.7.5.6/pinentry-x2go/icons/button_cancel.png0000644000000000000000000000267412070425227020502 0ustar ‰PNG  IHDR szzôgAMA¯È7ŠétEXtSoftwareAdobe ImageReadyqÉe<NIDATxÚbüÿÿ?Ã@€bÀæ€Çæ ‰OÌ>ì×e°rÙ€˜‘\óOŠ3žg8°_”! Èeb&dy€bÂf9Pp›ª¿<+ÃÎYJ PŒäX4k?¯”€=ÃÌ•ü 9@a.d{%@–?5gøÿuJÚÿÇ·þ“eòÿŽçir î@iRõù‡û¶Rÿÿ•Gþ ÷ÿ¤ ÃÿE¼ e@i˜#ˆ Ýç±i œÆþ ÿ0…U0ð™ò:ó0¬ž"Ã`OlHÀ|.¢&Å/oÔö냰Œƒ’¹ƒ*#CçBn†,XH.ËþüÓ"!E üfú¼N@GL’"ìl–3üþ q„¤4ƒ²¡ƒ*Cç.ˆ#ì iý¬ª –ƒé?ijux¸VOÀí|–Ãh11>!NEF†Z €;àö7Ï/×|~·¸Ãr_Ü?•AÐPƒ×‰“auŸ¦#ˆ±œá×o†;—¯3¼yóý묟 ¥  °/3œÝó!äÑ3Ÿß,mŰL ‘ôŽg4Pãuâ`XÝ+‚p)–?{üñ댟 eKÿ0œêý@Œ \À À©Ý”à@q vdË!Ž‚à'›—2¼¹pïó¾¯ ¡êÌ $˜v’bùŠ? gö=â7s4)0°ƒR;(Áâìè–ƒù@üxÇZ†W|jÿ/ª&ÅGŽå@ü €w(µƒ(ÎAÁŽn9Ãï_8¸ JÿdŒ-ȲˆÿºàŽ¥vP‚Ź´G8†åþo²-Y@Øw(µƒœž¯Œs Õ-€Âå¸#@©Ýèam^Y{ªZ„ÏpGô2ØÛ³3¬Ք啳v¤šå @L„jkFPV¥öÿþâµ2ÿþÿ _ñ[\–ƒ@ ¢K8¿}ëóWß¾ìþÃÙö‡a/И¸@L¤Öj„,gøù›AUB˜A’ŸÇ•‰aY ƒ¾ €˜¨m9ÃOý‡AMˆ—A’›…׆au#3î €˜(±”àî\¾…a9ØA?~3¨q²3H²2‚ÑÀ„Ý„‘H­X@ NJ”‹ìÈ–ƒÙ úû†›¿þ1<ýÇðùChƃȉ €P@N­Jí , @q vtË€–33ÏMFp~ü|ä?Ð GÜäXÍ篫X´@ ç `G·n2@Á€p@pJ‚‘\ËŸBó9(µƒâçê hF³—#쀳Œïy¤ÔÜ<É-á@€”ÚAŽb`àUÿ‹;{_âw@G¸00h8|üÇPñùɆ·7¯’[¼‚KÌú¿ ã”ànâ(Û^ñ >ì')~€;Àù5ÃÂ;¿Jï¼ÄðöÎ-rËv°#þ1/(˜ob±ü6‚-Ò@æ7€‚uL@áuŽó1üe¯ôÿ_¨Åÿ[üÿp3|‰`7¡ÍX†ˆ HŽ¿î{>]gW ÿŸñ> Š÷å1Å  ² €{F`G; eÇxþ_‘ç$Çr¬Ž8‡Ër „Þ9;Øi(;ÈÍð9š…!ƒ ˱:¢™¡Ãr  lµ!´Û$¥?ªR 8Tü ƒ8Î!éDÿ)0ƒ'EÂmNóIEND®B`‚pinentry-x2go-0.7.5.6/pinentry-x2go/icons/button_ok.png0000644000000000000000000000256112070425227017661 0ustar ‰PNG  IHDR szzôgAMA¯È7ŠétEXtSoftwareAdobe ImageReadyqÉe<IDATxÚbüÿÿ?Ã@€bb`@î€p ###Ý-]ÍàÈÌÄÐÀÄÌ`@L, ¡!As—°.bpäXÂpðë†}Ÿ~1Ø}zÈ0 €2ügøÉ°Œ!!¨æÿ¥ºÍsžddh`ú.v…¡•¡›a3@11übxôCÐ) |@ÌL5‹§2(2Ì{q7 ·Ão ŸZÝͰÈz@L@?oeødr12t2Ì£Š#&-ž ´˜™ážP\˜Yƒ§г_341LfØTõˆ_ȇ@°3†7CCŽèZ<b1?œ½CZpÑ«G>{ø•a-C9Päó§ ËAQ@ „ÇÊÐÏðËÖÍ–á/ã_†c;10|fØÀPÇ”ûDTšèZÌ Žã8VvV # csc†¯?0ìÛ¼áÓûO_á\ưŸá,Põ3PÐñO þ@_Ú3˜}gú®*e+ÅÀÆËÆðöÁ[ Ku†ƒ ; ±ö‡Å ® À4´œ™Y_ÆT†AÛ[›Wž—áù«ç ‡Vbøþúû=†• ¥ '.¡Y6 €˜Á ™Ÿßº-eø'ö‰—‰áûýï æ@GÆâˆV ÅÎ • ÿV0²3Úó™ó1ˆû‰3°(²0|fùÌðæå†›Ën2üyÿçÃl††Û@±ü-(% ™@¼Ÿ´HœáK, £*€©˰‡a=àå¡> E @ˆ”nÆ  tŸ)ƒ>4Ù°(ƒü|Aèk •A@¾*Ôé‘ðy ÞŽá= Óyé3ÃchVû€Ër (ýŸá;0;>cÈdx äñ#©ÐbA fb¨Ø/4S¶ñe ~´|ÐrH{NL. äòŸ»¿¼€,]òþVp±ÊÀp˜™7ƒ ˜W@ü‚Ø, @¨…!0"þX-x±aP­±êóÛ@Ë·2¬ƒúú8ÕY§ ûÐÿIÑ#ˆÑ(¯â×àôÑϰnùK¨Óþ€„ÊÀ$ÄÌ”ÂÐt€Ëç+ÀÖ}e8 Œ´c û –¿"Õr ÔÑ`Lþ¦Þ{Є†ŽAeØrp®þÊp X´^­O ÁN²å @èM²ÀàÝÌñ˜–ƒró" ~ ôé åW€$¤€ùü;9–ƒ@¡;à?01|D*4Ax-8]ßcØl¸\úb9J¹N lÍ0V†h µ ’Nˆñ!pº¾Ç°X´¾­È¥E €Â^çk³# 03‚Œ?Ä_™m°òÁ´œb@Øšåÿ€~:.Hƒ}0ø €–ßCªT¨b9ö~ÁW`åÃöÀÒ V´>¡¶å @Œx¢FˆÅ Uè+¢[G$€bÄ#Î ­‚@ÙëMšë@@ŒÝ; ï{•¥+°IEND®B`‚pinentry-x2go-0.7.5.6/pinentry-x2go/main.cpp0000644000000000000000000001430612070425227015464 0ustar /* main.cpp - Secure KDE dialog for PIN entry. Copyright (C) 2002 Klarälvdalens Datakonsult AB Copyright (C) 2003 g10 Code GmbH Copyright (C) 2007-2012 X2Go Project Written by Steffen Hansen . Modified by Marcus Brinkmann . Modified for X2Go by Oleksandr Shneyder and Mike Gabriel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ //#ifdef HAVE_CONFIG_H #include "config.h" //#endif #include #include #include #include #include #include #include #include #include #include #include #include "pinentrydialog.h" #include "pinentry.h" bool pin_is_known; QString default_pin; /* Hack for creating a QWidget with a "foreign" window ID */ class ForeignWidget : public QWidget { public: ForeignWidget( WId wid ) : QWidget( 0 ) { QWidget::destroy(); create( wid, false, false ); } ~ForeignWidget() { destroy( false, false ); } }; static int qt_cmd_handler (pinentry_t pe) { QWidget *parent = 0; int want_pass = !!pe->pin; if (want_pass) { char *pin; if(!pin_is_known) { /* FIXME: Add parent window ID to pinentry and GTK. */ if (pe->parent_wid) parent = new ForeignWidget (pe->parent_wid); PinEntryDialog pinentry (parent, 0, true); pinentry.setPrompt (QString::fromUtf8 (pe->prompt)); pinentry.setDescription (QString::fromUtf8 (pe->description)); if (pe->ok) pinentry.setOkText (QString::fromUtf8 (pe->ok)); if (pe->cancel) pinentry.setCancelText (QString::fromUtf8 (pe->cancel)); if (pe->error) pinentry.setError (QString::fromUtf8 (pe->error)); bool ret = pinentry.exec (); if (!ret) return -1; pin = (char *) pinentry.text().toUtf8().data(); } else pin=(char *)default_pin.toUtf8().data(); if (!pin) return -1; int len = strlen (pin); if (len >= 0) { pinentry_setbufferlen (pe, len + 1); if (pe->pin) { strcpy (pe->pin, pin); // ::secmem_free (pin); return len; } } // ::secmem_free (pin); return -1; } else { bool ret = QMessageBox::information (parent, "", pe->description, pe->ok ? pe->ok : "OK", pe->cancel ? pe->cancel : "Cancel"); return !ret; } } pinentry_cmd_handler_t pinentry_cmd_handler = qt_cmd_handler; int main (int argc, char *argv[]) { pin_is_known=false; pinentry_init ("pinentry-x2go"); QString gpghome=getenv("GNUPGHOME"); QString cardid=getenv("CARDAPPID"); if(QFile::exists(gpghome+"/pins")) { QFile file(gpghome+"/pins"); if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { QTextStream in(&file); while(!in.atEnd()) { QString line = in.readLine(); if(line.length()>0) { QStringList lst=line.split(" "); if(lst[0]==cardid) { default_pin=lst[1]; pin_is_known=true; break; } } } } } /* Qt does only understand -display but not --display; thus we are fixing that here. The code is pretty simply and may get confused if an argument is called "--display". */ char **new_argv, *p; size_t n; int i, done; for (n=0,i=0; i < argc; i++) n += strlen (argv[i])+1; n++; new_argv = (char**)calloc (argc+1, sizeof *new_argv); if (new_argv) *new_argv = (char*)malloc (n); if (!new_argv || !*new_argv) { fprintf (stderr, "pinentry-x2go: can't fixup argument list: %s\n", strerror (errno)); exit (EXIT_FAILURE); } for (done=0,p=*new_argv,i=0; i < argc; i++) if (!done && !strcmp (argv[i], "--display")) { new_argv[i] = "-display"; done = 1; } else { new_argv[i] = strcpy (p, argv[i]); p += strlen (argv[i]) + 1; } /* We use a modal dialog window, so we don't need the application window anymore. */ i = argc; QApplication* app=new QApplication (i, new_argv); QTranslator pinTranslator; QString filename=QString(":/pinentry-x2go_%1").arg(QLocale::system().name()); filename=filename.toLower(); if(!pinTranslator.load(filename)) { qDebug("Can't load translator (%s) !\n",filename.toLocal8Bit().data()); } else app->installTranslator(&pinTranslator); QTranslator qtTranslator; filename=QString(":/qt_%1").arg(QLocale::system().name()); if(!qtTranslator.load(filename)) { qDebug("Can't load translator (%s) !\n",filename.toLocal8Bit().data()); } else app->installTranslator(&qtTranslator); app->setStyle(new QPlastiqueStyle()); /* Consumes all arguments. */ if (pinentry_parse_opts (argc, argv)) { printf ("pinentry-x2go (pinentry) " VERSION "\n"); exit (EXIT_SUCCESS); } if (pinentry_loop ()) return 1; return 0; } pinentry-x2go-0.7.5.6/pinentry-x2go/pinentrydialog.cpp0000644000000000000000000001435312070425227017572 0ustar /* pinentrydialog.cpp - A secure KDE dialog for PIN entry. Copyright (C) 2002 Klarälvdalens Datakonsult AB Copyright (C) 2007-2012 X2Go Project Written by Steffen Hansen . Modified for X2Go by Oleksandr Shneyder and Mike Gabriel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include #include #include #include #include #include "pinlineedit.h" #include #include "pinentrydialog.h" #include PinEntryDialog::PinEntryDialog( QWidget* parent, const char* , bool ) : QDialog( parent ), _grabbed( false ) { setWindowTitle(tr("X2GO Pinpad")); _icon = new QLabel( this ); _icon->setPixmap( QMessageBox::standardIcon( QMessageBox::Information ) ); _error = new QLabel( this ); _desc = new QLabel( this ); _edit = new PinLineEdit( this ); _edit->setMaxLength( 256 ); _edit->setEchoMode( QLineEdit::Password ); _ok = new QPushButton( QIcon(":/icons/button_ok.png"), "",this ); _cancel = new QPushButton(QIcon(":/icons/button_cancel.png"),"" , this ); _bs= new QPushButton(QString(8592), this ); QFont f=_bs->font(); f.setPointSize(20); _bs->setFont(f); _icon->hide(); _error->hide(); QGridLayout* butLay=new QGridLayout(); butLay->addWidget(_cancel,3,2); butLay->addWidget(_ok,3,0); QHBoxLayout* bhlay=new QHBoxLayout(); bhlay->addLayout(butLay); bhlay->addStretch(); QButtonGroup* numGroup=new QButtonGroup(this); for(uint i=0;i<10;++i) { if(i<9) { _num[i]=new QPushButton(QString::number(i+1),this); butLay->addWidget(_num[i],i/3,i%3); } else { _num[i]=new QPushButton("0",this); butLay->addWidget(_num[i],3,1); } _num[i]->setFont(f); _num[i]->setFixedSize(QSize(_num[i]->sizeHint()).height(),QSize(_num[i]->sizeHint()).height()); _num[i]->setFocusPolicy(Qt::NoFocus); numGroup->addButton(_num[i],i); } connect(numGroup,SIGNAL(buttonClicked(int)),this,SLOT(slot_numButClicked( int ))); connect(_bs,SIGNAL(clicked()),this,SLOT(slot_bs())); _ok->setFixedSize(QSize(_num[0]->sizeHint()).height(),QSize(_num[0]->sizeHint()).height()); _cancel->setFixedSize(QSize(_num[0]->sizeHint()).height(),QSize(_num[0]->sizeHint()).height()); _bs->setFixedSize(QSize(_num[0]->sizeHint()).height(),QSize(_num[0]->sizeHint()).height()); _bs->setFocusPolicy(Qt::NoFocus); _edit->setFixedHeight(_num[0]->sizeHint().height()); _ok->setDefault(true); QVBoxLayout* mlay=new QVBoxLayout(this); _edit->setFixedWidth(_num[0]->width()*3+mlay->spacing()*2); QHBoxLayout* icLay=new QHBoxLayout(); icLay->addWidget(_icon); icLay->addWidget(_error); icLay->addStretch(); mlay->addLayout(icLay); mlay->addWidget(_desc); QHBoxLayout* edLay=new QHBoxLayout(); // edLay->addWidget(_prompt); edLay->addWidget(_edit); edLay->addWidget(_bs); edLay->addStretch(); mlay->addLayout(edLay); mlay->addLayout(bhlay); mlay->addStretch(); connect( _ok, SIGNAL( clicked() ), this, SIGNAL( accepted() ) ); connect( _cancel, SIGNAL( clicked() ), this, SIGNAL( rejected() ) ); connect (this, SIGNAL (accepted ()), this, SLOT (accept ())); connect (this, SIGNAL (rejected ()), this, SLOT (reject ())); connect (_edit,SIGNAL(bs_pressed()),this,SLOT(slot_bs())); connect (_edit,SIGNAL(cancel_pressed()),this,SLOT(reject())); f.setPointSize(14); _edit->setFont(f); _edit->setFocus(); } void PinEntryDialog::paintEvent( QPaintEvent* ev ) { // Grab keyboard when widget is mapped to screen // It might be a little weird to do it here, but it works! if( !_grabbed ) { _edit->grabKeyboard(); _grabbed = true; } QDialog::paintEvent( ev ); } void PinEntryDialog::hideEvent( QHideEvent* ev ) { _edit->releaseKeyboard(); _grabbed = false; QDialog::hideEvent( ev ); } void PinEntryDialog::keyPressEvent( QKeyEvent* e ) { if ( e->key() == Qt::Key_Escape ) { emit rejected(); return; } QDialog::keyPressEvent( e ); } void PinEntryDialog::setDescription( const QString& ) { _desc->setText(tr("Please, enter your PIN")); // _desc->setText(txt); _icon->setPixmap( QMessageBox::standardIcon( QMessageBox::Information ) ); setError( QString::null ); } QString PinEntryDialog::description() const { return _desc->text(); } void PinEntryDialog::setError( const QString& txt ) { if( !txt.isNull() ) _icon->setPixmap( QMessageBox::standardIcon( QMessageBox::Critical ) ); _error->setText( txt ); } QString PinEntryDialog::error() const { return _error->text(); } void PinEntryDialog::setText( const QString& txt ) { _edit->setText( txt ); } QString PinEntryDialog::text() const { return _edit->text(); } void PinEntryDialog::setPrompt( const QString& ) { // _prompt->setText( txt ); } QString PinEntryDialog::prompt() const { return "PIN"; // return _prompt->text(); } void PinEntryDialog::setOkText( const QString& txt ) { _ok->setText( txt ); } void PinEntryDialog::setCancelText( const QString& txt ) { _cancel->setText( txt ); } void PinEntryDialog::slot_numButClicked(int id) { int num=id+1; if(num==10) num=0; _edit->setText(_edit->text()+QString::number(num)); } void PinEntryDialog::slot_bs() { _edit->backspace(); } pinentry-x2go-0.7.5.6/pinentry-x2go/pinentrydialog.h0000644000000000000000000000503712070425227017236 0ustar /* pinentrydialog.h - A secure KDE dialog for PIN entry. Copyright (C) 2002 Klarälvdalens Datakonsult AB Copyright (C) 2007-2012 X2Go Project Written by Steffen Hansen . Modified for X2Go by Oleksandr Shneyder and Mike Gabriel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef __PINENTRYDIALOG_H__ #define __PINENTRYDIALOG_H__ #include //#include "templatedlg.h" class QLabel; class QPushButton; class PinLineEdit; class QString; class QKeyEvent; class PinEntryDialog : public QDialog { Q_OBJECT Q_PROPERTY( QString description READ description WRITE setDescription ) Q_PROPERTY( QString error READ error WRITE setError ) // Q_PROPERTY( SecQString text READ text WRITE setText ) Q_PROPERTY( QString prompt READ prompt WRITE setPrompt ) public: friend class PinEntryController; // TODO: remove when assuan lets me use Qt eventloop. PinEntryDialog( QWidget* parent = 0, const char* name = 0, bool modal = false ); void setDescription( const QString& ); QString description() const; void setError( const QString& ); QString error() const; void setText( const QString& ); QString text() const; void setPrompt( const QString& ); QString prompt() const; void setOkText( const QString& ); void setCancelText( const QString& ); signals: void accepted(); void rejected(); protected: virtual void keyPressEvent( QKeyEvent *e ); virtual void hideEvent( QHideEvent* ); virtual void paintEvent( QPaintEvent* ); private: QLabel* _icon; QLabel* _desc; QLabel* _error; PinLineEdit* _edit; QPushButton* _ok; QPushButton* _cancel; QPushButton* _bs; QPushButton* _num[10]; bool _grabbed; private slots: void slot_numButClicked(int id); void slot_bs(); }; #endif // __PINENTRYDIALOG_H__ pinentry-x2go-0.7.5.6/pinentry-x2go/pinentry-x2go_de.qm0000644000000000000000000000065412070425227017571 0ustar <¸dÊÍ!¿`¡½ÝB ú‡.iC8Geben Sie bitte Ihre PIN ein ú‡./B—PinEntryDialogpinentry-x2go-0.7.5.6/pinentry-x2go/pinentry-x2go_de.ts0000644000000000000000000000135612070425227017602 0ustar PinEntryDialog X2GO Pinpad Please, enter your PIN Geben Sie bitte Ihre PIN ein TemplateDialog Dialog pinentry-x2go-0.7.5.6/pinentry-x2go/pinentry-x2go.pro0000644000000000000000000000117412070425227017302 0ustar ###################################################################### # Automatically generated by qmake (2.01a) Fr Aug 3 07:44:35 2007 ###################################################################### INSTALLS += target target.path = $${PREFIX}/bin TRANSLATIONS += pinentry-x2go_de.ts TEMPLATE = app TARGET = DEPENDPATH += . INCLUDEPATH += . # Input HEADERS += pinentrydialog.h pinlineedit.h FORMS += templatedlg.ui SOURCES += main.cpp pinentrydialog.cpp pinlineedit.cpp INCLUDEPATH += . .. ../pinentry ../assuan LIBS += ../pinentry/libpinentry.a ../assuan/libassuan.a ../secmem/libsecmem.a -lcap RESOURCES += resources.rcc pinentry-x2go-0.7.5.6/pinentry-x2go/pinlineedit.cpp0000644000000000000000000000125412070425227017042 0ustar // // C++ Implementation: pinlineedit // // Description: // // // Author: Oleksandr Shneyder , (C) 2007-2012 // // Copyright: See COPYING file that comes with this distribution // // #include "pinlineedit.h" #include #include PinLineEdit::PinLineEdit(QWidget* parent): QLineEdit (parent) {} PinLineEdit::~PinLineEdit() {} void PinLineEdit::keyPressEvent( QKeyEvent *e ) { //for Cherry keyboard switch(e->key()) { case Qt::Key_Minus: emit bs_pressed(); break; case Qt::Key_Plus: emit cancel_pressed(); break; default: QLineEdit::keyPressEvent( e ); } } pinentry-x2go-0.7.5.6/pinentry-x2go/pinlineedit.h0000644000000000000000000000113412070425227016504 0ustar // // C++ Interface: pinlineedit // // Description: // // // Author: Oleksandr Shneyder , (C) 2007-2012 // // Copyright: See COPYING file that comes with this distribution // // #ifndef PINLINEEDIT_H #define PINLINEEDIT_H #include /** @author Oleksandr Shneyder */ class PinLineEdit : public QLineEdit { Q_OBJECT public: PinLineEdit(QWidget* parent = 0 ); ~PinLineEdit(); protected: virtual void keyPressEvent( QKeyEvent *e ); signals: void bs_pressed(); void cancel_pressed(); }; #endif pinentry-x2go-0.7.5.6/pinentry-x2go/qt_de.qm0000644000000000000000000010303512070425227015465 0ustar <¸dÊÍ!¿`¡½ÝBè*+];;4;L;g;†; ;»MÅOÏOëÀù}m¯(5!+;/+;L+OX+OyH4‰H•J¼¡K¯LDËL“ÙPSåZrõ[`\Ý_Ã_Ã71ºA¿ÃU¿Ãr‡›~‡›¡‡›Ã˜,Õ§Ôå§Ô§ÔB¨¥b«Œr¶Þ€Ð%’Ð%³Ð%ÓÓãì0ùì0ì0>ì0^ö5n D|+Ô‚,£’º÷žD¾‚´J¾œûP¿¾€¿Eå¬À‚´ÌÄ{ŽøÊ8AþÛAß[ylâL´”ó‚¤šó‚¤¯ó‚¤Æó‚¤Ûó‚¤ñó‚¤ õðMöE”(öE”swµwà!Ïeú)Õ **/e H5”Œ \;„ bB‹y!O«!BZõf!H`à!˜cÖƒ!žu(µ!¸‡lÉ!¾“” !įÉ$!ʯÉ$!ò°‚µ"¾ÿÄ"VÃ( "tÎ^"’Öˆ7#ã n#ä,Ô#"ëÕÿ#(ñ;y#.öŠÂ#Vº#r&H„#x/¥Ä#~IxS#„YMá#ÜYMá$h^$QiïÓ$essc%wÞ%€»Ñ%Œ‡%oŽÛŠ%u–´N%‡–»]%“˜I¼%¡˜I¼%ʘI¼%÷˜I¼&˜I¼&H˜I¼&u˜I¼&˜I¼&ƘI¼&ò™n•' ŸI'ŸY'(Ÿi'@Ÿy'XŸ‰'pŸ™'ˆŸ©' Ÿ¹'¸Ÿé'Пù'èŸI(Ÿ‰(Ÿ™(0Ÿ©(HŸ¹(`Ÿù(x¡uD(¡uD(í¦oÃ)A¬,¥)G¬,¥)k¬,¥)¬,¥)¯¬,¥)̹Êå)àɘe)úÌ5$* ÑfR*,èNÀ*Té•*jõ¬c*’öû+"ù^þ+LûPq+RþV…+žœ”+¸œ”+Þœ”, ×ä,©,¼‚,L%CÉ,R?"£,nKN,tMî,zR¿ò,”]¿ž,š]¿ž,±k¶Þ,·yô^,Õ€{y,ÛŒ¼Ž-˜G%-šÇ¥--›ˆ˜-Gœ+¤-Y¦±t-q¦±t-ž§{y-º¯rÉ-ä°ˆÁ. °ª½.µÞ%.$½C-.*Â5Ë.bƨ¥.’ƨ¥.Â˾ä.âÒz.èÕ§?/çf•/<~b/˜oÓ/¸!ë¿/ö+ï3/ü/ô…06Ï 0&G¾ñ0VLAU0¬Uô0²Uô0êZËÑ1ZËÒ1*ZËÓ1@ZËÔ1V]k*1l^ãn1†e‘1ìižä2ižä2IrgŠ2oy;Ç2™}u2Ÿ}w2¿}w2üŠê‚3*Õä3d—ßt3˜›ƒt3ž «.3¸ «.3Í¥Pè3ÓµD„4·Ýt4c·Ýt4§·Ýt4áÀ_ 5ÉF±5)Ê¢ä5/Ê¢ä5DÊçd5JÊçd5_Êçd5vÊçd5‹Ì595‘ÌÖ£5—ä‡5ì»U5Íþ¯B65w®6c …‘6i2ì6o6’Ñ6‘DØ6éKÕ7GU|7karÅ7p³ª7“t‰7­}wZ7Å}š$7ã}š$8$Z’8V´K<8jÅ8ŒÆü÷8æÎû 8ìÕ/9ë»E9Lî@59ju9¨›T9ìi~:É:Ž5kE:¾XU :îbD;gŸA;8iê$;€x1 ;†z*2;¨‚¨d;¾ŠU€;ÄŽ÷5;Ö•z;ܩ҉;òºm;ø¼ìn<½ŒÈ<6ÄO~ äÑ> }$>$ qe>* Ú¤>Z íE>Ä íE>Û Ac>á Ac?0 3š5?n K!??È bb?Î b¾`@ iä3@> laô@ä ‚|Å@ø ŒtÓAZ ŒtÓA ŽíA³ Ÿ¥ÞAË ¢³ÄB¥ §²C ­>óC5 ­‚µC; ¸æÉCQ ¸æÉCh ÜKçCn ÝÕCt ñ%'CÀ ö ®D ÷»¼D¨ ü®D )µžDÈ */åDÎ 7uóDæ =äE BÇéE< Tþ^EŒ ]‘žEž `±Eè `±Eÿ c(åF dÐÍF eœÇF% eœÇFF fŽ1FV g½ÔF” gînFÞ kŸ,G* rD"GN xšÄG– ~ó”Gœ …éÓG¢ ‡Î9H ˜IœH@ ˜IœHg šÉ;H œ¬H¥ œ¬H¼ ¨JÉH ¬%pHÖ ¬,…Hú ¬,…I! °ÌÕI7 Ë”IQ ÐP¸Is ÔàÄI‘ ÔàÄIÒ Þ68J è¼:JR ëf Jd ëf J› ÷4JÁ ý‡sJÇ ý‡sJø AAK ˜ÄK` m,Kf #-tK¤ 0†NL EÔ9L† EÔ9LÑ LöM Mc\M# SÐMA V×MG ]â$M¯ f)Mµ f)Mð io>N mû`N€ wÇN† Œ5TNž ŒHN¾ ŒHNë ‘$þO ’.@O “þ’O! — iOy £Ü O¡ £Ü OÔ £Ü P ¯ÙJP* ¯ÙJPY ¿t.Pw ÂkÔP} ÃÓ‡Pƒ ÈÇP‰ ̺óPŸ Ô-DP³ âkÔPÙ èU)Q ðË<QE õ0ËQK  „Q{  „Q° öQÜ xHR .ÉãR> 7F´R\ >ÏòRÀ >ÏòRó >ÏòS+ >ÏòSh >ÏòSœ >ÏòSÔ D€TSþ IëËT0 RVŽT6 RV®TN S.ŸTf SÀT– YåTœ [•›Tº j7oTì p¡ÃUn ŒÁ.U¨ ŒÑBU® ŽèU´ ½TUð ½TV ½TV ½TV2 ’›¢V8 “èÄV> –‚™VD )dV˜ ©‰W ¬Á.W\ ¬Á.Wq ¬Á.Wˆ ¬Á.WŸ ¸aW¥ » yWÝ ë¬åWã úùWé tX5 :bXi ÊœX« DX±  rX· +>ºYS 0ÒEYq ;ɾYõ PtµYû ^+dZ fèeZS g­Zo iFCZ½ iØÄZÕ u®Zë w®[ w®[H w}¤[x w}¤[· ƒÈô[ç ƒÈô\ —Ã^\D ªôR\J ¾o²\„ ÜX\Š êD\¼ ðt5\ô ø¾] ø)¤]6 ú¾]zT]€gT]†pS]ò*‡«]þ/ÇE^IÌ_^^XRu^²[Ÿ ^þa.Å_lvÉ…_ry$_Š€~¹_²†š`´÷S`ÇB¤`VÊæÂ`®Î`ÞÝ–þa"ò[ya( íÒaP íÒa“"#aÅ$ÚUaË%º4aû-v›b0i)b30’ÀbM1cb]2wTb•D¢Ãb«HúùcwJdcµL$.cíaØÎdKc5d¯yƒCdÍ{~ae[•`ée…¯·e«¯·eؾNeìÐkyf®âJfÖéPéfþøt2g$û¾gfû¾g}û¾g–igœ*+AMOK Q3TabDialogOK QAxSelectOK QColorDialogOKQDialogButtonBoxOK QMessageBoxOK QPrintDialogOKPMNein QShortcutNeinHochampmÿÿÿÿ%1 %&OK Q3FileDialog&OK N&ein Q3FileDialog N&einAltF%1EntfVerzeichnisEndeEsc EinfgTab AnfangXIMJa QShortcutJaFehler:&Ja Q3FileDialog&Ja Zurück Q3FileDialog Zurück QFileDialog Zurück Anruf&Ausschneiden Q3TextEdit&Ausschneiden QLineEdit&Ausschneiden DatumStrg Runter Datei Q3FileDialog Datei QFileDialog DateiUmdrehen Hilfe Q3TabDialog HilfeQDialogButtonBox Hilfe QMessageBox HilfePos1ÿÿÿÿ LinksÿÿÿÿMenüMetaÿÿÿÿNamePPDOptionsModelName Q3FileDialogName Öffnen Q3FileDialog Öffnen QComboBox ÖffnenQDialogButtonBox Öffnen QFileDialog ÖffnenQMenu Öffnen QPushButton ÖffnenBild aufwärts Wiederherstellen QUndoGroup WiederherstellenSpeichernQDialogButtonBoxSpeichern QFileDialogSpeichern Größe Q3FileDialog GrößeSortieren Q3FileDialogSortierenAbbrechenWahr Q3DataTableWahrTypRückgängig QUndoGroupRückgängig"A6 (105 x 148 mm)&Kopieren Q3TextEdit&Kopieren QLineEdit&Kopieren&Schriftart &HilfeVer&schieben&Öffnen Q3FileDialog&Öffnen &Rot:"Wieder&herstellen Q3TextEdit"Wieder&herstellen QLineEdit"Wieder&herstellen &Sat:S&peichern Q3FileDialogS&peichern &Größe QFontDialog&Größe ändern&Rückgängig Q3TextEdit&Rückgängig QLineEdit&Rückgängig &Val:FLegal (8,5 x 14 Zoll, 216 x 356 mm)AbbrechenAnwenden Q3TabDialogAnwendenÿÿÿÿ QCheckBoxÿÿÿÿLöschenSchließen Q3TitleBarSchließenQDialogButtonBoxSchließenQMenuSchließenLaufwerk Enter Falsch Q3DataTable Falsch FehlerFarb&ton:Minimieren Q3TitleBarMinimieren@Konnte nicht geöffnet werden: %1Alles drucken Öffnen Q3FileDialog Öffnen PauseSonstigesÿÿÿÿ Druck QPrintDialog DruckÿÿÿÿWiederholen RechtsUmschaltÿÿÿÿLeertastefDas Zeitlimit für die Operation wurde überschrittenÿÿÿÿXDer entfernte Rechner schloss die VerbindungDirekthilfeQDialogDirekthilfepDas Protokoll `%1' unterstützt nicht das Laden von FilespInhalt des Verzeichnises kann nicht angezeigt werden: %1ÿÿÿÿ\Konnte Datei oder Verzeichnis nicht löschen %1ÿÿÿÿSchreiben: %1Aufzeichnen"B6 (125 x 176 mm)ÿÿÿÿ QDB2Driverÿÿÿÿ QIBaseDriverÿÿÿÿ QIBaseResultÿÿÿÿ QMYSQLDriverÿÿÿÿ QODBCDriverÿÿÿÿQSQLite2DriverÿÿÿÿHRechner konnte nicht gefunden werdenQAbstractSocketHRechner konnte nicht gefunden werden8Ungültiger Socket-Deskriptor$Bildschirm drucken8Eigene Farben &definieren >>Papierquelle:B8 (62 x 88 mm)ÿÿÿÿ~nicht-analysierte Entity-Referenz im falschen Kontext verwendetA8 (52 x 74 mm)ÿÿÿÿB9 (44 x 62 mm)HDas Protokoll wird nicht unterstütztÿÿÿÿA9 (37 x 52 mm)*Nach &Größe sortieren Q3FileDialog*Nach &Größe sortieren&B0 (1000 x 1414 mm)*Nach &Datum sortieren Q3FileDialog*Nach &Datum sortieren(Nach &Name sortieren Q3FileDialog(Nach &Name sortierenVErstellen des Verzeichnises schlug fehl: %1JKonnte Verzeichnis nicht erstellen %1ÿÿÿÿ&Neues Verzeichnis 1ÿÿÿÿDAktiviert das Programmhauptfensterÿÿÿÿ"A5 (148 x 210 mm),Tabloid (279 x 432 mm)HRLE Start of right-to-left embedding.Im &Vordergrund bleibenJDiese Meldungen noch einmal an&zeigen8falsche Syntax für Lookaheadhexterne Entity-Referenz ist nicht erlaubt in der DTD B10 (31 x 44 mm),Windows-EingabemethodeÿÿÿÿÿÿÿÿÿÿÿÿXfalscher Wert für die Standalone-Deklaration&Dekrementieren Keine VerbindungHöhen -ÿÿÿÿ\Verbindung für die Daten Verbindung verweigert$XIM-Eingabemethode²fehlende Encoding-Deklaration oder Standalone-Deklaration beim Parsen der XML-Deklaration"B2 (500 x 707 mm)das Verzeichnisÿÿÿÿ QDB2ResultÿÿÿÿDatei&typ:Datei&name:vDie Datei oder das Verzeichnis konnte nicht gefunden werdenSchl&ießenÿÿÿÿ2Anmeldung schlug fehl: %1Einf&ügen Q3TextEditEinf&ügen QLineEditEinf&ügenÿÿÿÿÿÿÿÿÿÿÿÿ*Rollen-Feststelltaste&Nach unten scrollenHier scrollen&Nach links scrollenÿÿÿÿ%1 löschenNHerunterladen der Datei schlug fehl: %1"A3 (297 x 420 mm)ÿÿÿÿÿÿÿÿ QDB2Resultÿÿÿÿ QMYSQLResultÿÿÿÿ QOCIResultÿÿÿÿ QODBCResultÿÿÿÿQSQLite2Resultÿÿÿÿ%1 - [%2]<Verbindung mit Rechner bestehtQFtp<Verbindung mit Rechner bestehtAusrichten Q3MainWindowAusrichten*ZWSP Zero width spaceLautstärke -Ton ausÿÿÿÿ²Es wurde versucht einen IPv6-Socket auf einem System ohne IPv6-Unterstützung zu verwenden"B4 (250 x 353 mm)ÿÿÿÿJDiese Plattform unterstützt kein IPv6ÿÿÿÿVorherigerÿÿÿÿÿÿÿÿÿÿÿÿkein FehlerQRegExpkein FehlerBFehler beim Parsen einer ReferenzPapierformatLautstärke +~fehlende Standalone-Deklaration beim Parsen der XML Deklarationÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ"A1 (594 x 841 mm)FarbauswahlÿÿÿÿÿÿÿÿÿÿÿÿRZu benutzerdefinierten Farben &hinzufügen0Verbunden mit Rechner %1QFtp0Verbunden mit Rechner %1Mehr...¦Das Protokoll `%1' unterstützt nicht das Umbenennen von Dateien oder VerzeichnissenÿÿÿÿÿÿÿÿLVerbindung mit Rechner schlug fehl: %1ÿÿÿÿ Bla&u:LTREndeAbbrechen Q3FileDialogAbbrechenQ3ProgressDialogAbbrechen Q3TabDialogAbbrechen QColorDialogAbbrechenQDialogButtonBoxAbbrechen QFileDialogAbbrechen QPrintDialogAbbrechenQProgressDialogAbbrechenÿÿÿÿStart (6)Start (7)Start (8)Start (9)Start (2)Start (3)Start (4)Start (5)Start (0)Start (1)Start (F)Start (B)Start (C)Start (D)Start (E)Start (A)NRechner %1 konnte nicht gefunden werdenQFtpNRechner %1 konnte nicht gefunden werdenÿÿÿÿLöschen Q3DataTableLöschen QLineEditLöschen QShortcutLöschenQSqlLöschenQuerformat EscapeErne&ut laden"Neues VerzeichnisAuflegen"ElternverzeichnisŠDas Protokoll `%1' unterstützt nicht das Auflisten von Verzeichnissen$B1 (707 x 1000 mm)ÿÿÿÿFHochladen der Datei schlug fehl: %1IgnorierenEinfügen Q3DataTableEinfügen QShortcutEinfügenÿÿÿÿ(Folio (210 x 330 mm)ÿÿÿÿ(unbekannt)ÿÿÿÿÿÿÿÿBass Boostÿÿÿÿÿÿÿÿ QIBaseDriverÿÿÿÿBild abwärtsÿÿÿÿ$DLE (110 x 220 mm) ReturnBeispiel&Aufrollen SuchenAuswählen&Unsortiert Q3FileDialog&Unsortiert$C5E (163 x 229 mm)"B5 (176 x 250 mm) SysReqÿÿÿÿÿÿÿÿ2fehlende linke Begrenzung*Zahlen-FeststelltasteAktualisieren Q3DataTableAktualisierenÿÿÿÿSu&chen in:2Diesen Datensatz löschen?VDie Nachricht konnte nicht empfangen werdenMein Computer8Voransicht des Datei-InhaltsÿÿÿÿÿÿÿÿBereich drucken*Rollen-FeststelltastePÄndern des Verzeichnises schlug fehl: %1ÿÿÿÿ$Zugriff verweigert QIODevice$Zugriff verweigertKontext1Kontext2Kontext3Kontext4Suchen in:`ungültiger Namer für eine Processing-Instruktion(Neues Verzeichnis %1 Rechner gefundenQFtp Rechner gefunden$Anzahl der Kopien:ÿÿÿÿBild aufwärts(Eine Seite nach oben QScrollBar(Eine Seite nach oben4Konsument löste Fehler aus.Mac OS X-EingabemethodeÿÿÿÿHochformatÿÿÿÿ QScrollBarÿÿÿÿBfalsche Syntax für Zeichen KlasseBFehler beim Parsen eines Elements*Verbindung verweigertQAbstractSocket*Verbindung verweigertQHttp*Verbindung verweigertÖffne URLÿÿÿÿÿÿÿÿ QDB2Resultÿÿÿÿÿÿÿÿ QDB2Resultÿÿÿÿ QMYSQLResultÿÿÿÿ QOCIResultÿÿÿÿÿÿÿÿÿÿÿÿ*Änderungen speichern?bDer Schreibvorgang konnte nicht ausgeführt werden(unerwartetes ZeichenÿÿÿÿÿÿÿÿDebug Ausgabe:RLöschen des Verzeichnises schlug fehl: %1XElement-Tags sind nicht richtig geschachteltLesen/SchreibenFeststelltasteÿÿÿÿDateiname:Nur LesenSeitengröße:,Eine Seite nach rechts QScrollBar,Eine Seite nach rechtsDruckerN&ein zu allemTnicht aktivierte Eigenschaft wurde benutztÿÿÿÿ$A0 (841 x 1189 mm)0HTTP Anfrage schlug fehlSchrifts&til8Farbig drucken falls möglich>Datei kopieren oder verschieben direkt verbundenv<qt>Sind Sie sicher, dass Sie %1 "%2" löschen möchten?</qt>*Ledger (432 x 279 mm)*ungültiger Oktal-Wert"Dateien des Typs:System RequestBKonnte Verzeichnis nicht lesen %1ÿÿÿÿFeststelltasteRück-Tabÿÿÿÿ Bass +ÿÿÿÿWarnung:ÿÿÿÿ&SchriftsystemAnpassen...Aktualisierenÿÿÿÿÿÿÿÿ"Wieder&herstellenZFehler beim Parsen des Inhalts eines ElementsFFehler beim Parsen eines Kommentars€interne allgeimeine Entity-Referenz ist nicht erlaubt in der DTDMaximierenÿÿÿÿ$Verzeichnis suchenAttributeÿÿÿÿÿÿÿÿ*Unbekannter AdresstypdEin anderer Socket hört bereits auf denselben Portÿÿÿÿ QMYSQLResultÿÿÿÿ8&Versteckte Dateien anzeigen Q3FileDialog8&Versteckte Dateien anzeigenTDie Nachricht konnte nicht gesendet werdenÿÿÿÿ@Unicode-Kontrollzeichen einfügen$Nach oben scrollen Das Protokoll `%1' unterstützt nicht das Löschen von Dateien oder VerzeichnissenÜber Qt\Die angegebene Adresse ist bereits in GebrauchSpeichern unter Q3FileDialogSpeichern unterAlias: %1Ô%1 Das Verzeichnis konnte nicht gefunden werden. Stellen Sie sicher, dass der Verzeichnisname richtig ist.hDas Zeitlimit für die Verbindung wurde überschrittenNetzwerkfehlerÿÿÿÿGesperrtÿÿÿÿ QIBaseResultÿÿÿÿÿÿÿÿFLRO Start of left-to-right overrideHLRE Start of left-to-right embedding”%1 Datei konnte nicht gefunden werden. Überprüfen Sie Pfad und Dateinamen.Start MailÿÿÿÿÿÿÿÿRücktaste"rekursive Enitity(Schriftart auswählenJUS Common #10 Envelope (105 x 241 mm) Bass -DNichtunterstütztes Socket-Kommandoÿÿÿÿ QIBaseDriverÿÿÿÿÿÿÿÿBestätigen Liste Q3FileDialog Liste8Verbindung mit %1 verweigertDNichtunterstütztes Socket-KommandoFmehr als eine DokumenttypdefinitionSpezialattributBOperation von Benutzer angehaltenÿÿÿÿÿÿÿÿxDas Protokoll `%1' unterstützt nicht das Speichern von FilesNur Schreiben&AbbrechenQ3Wizard&Abbrechendie Verknüpfungÿÿÿÿ QMYSQLResultÿÿÿÿStandby&Inkrementieren&Löschen Q3FileDialog&LöschenAktivieren&UnterstrichenAb&schließen2Verbindung mit %1 beendetQFtp2Verbindung mit %1 beendetBfalsche Syntax für Wiederholungen &Grün: Alle Dateien (*) Q3FileDialog Alle Dateien (*)ÿÿÿÿVerzeichnisse Q3FileDialogVerzeichnisseBLöschen der Datei schlug fehl: %1ÿÿÿÿ8Verknüpfung mit SpezialdateilDer Broadcast-Socket konnte nicht initialisiert werdenjApplikation '%1' benötigt Qt %2, aber Qt %3 gefunden.4Wählen Sie ein Verzeichnis Q3FileDialog4Wählen Sie ein Verzeichnis&Weiter >Ja zu &allemÿÿÿÿbKein freier Speicherplatz auf dem Gerät vorhandenÿÿÿÿ$Alle Dateien (*.*) Q3FileDialog$Alle Dateien (*.*)`fehlende Version beim Parsen der XML-DeklarationÿÿÿÿLesen: %1Erne&ut laden&Umbenennen Q3FileDialog&UmbenennenÿÿÿÿHöhen +RKonnte nicht umbenannt werden: %1 nach %2"A4 (210 x 297 mm)Alles auswählen Q3TextEditAlles auswählen QLineEditAlles auswählenVerzeichnis: Q3FileDialogVerzeichnis:ÿÿÿÿÿÿÿÿÿÿÿÿDefaultsEffekte Durch&gestrichen(Nach rechts scrollen8Ungültiger HTTP Chunked-Bodyÿÿÿÿ*Zahlen-Feststelltaste&Rechner %1 gefundenQFtp&Rechner %1 gefunden*Zahlen-Feststelltaste,Falsche Content-LengthGrundfar&ben^ein Buchstabe ist an dieser Stelle erforderlich$Unbekannter FehlerQFtp$Unbekannter Fehler QHostInfo$Unbekannter FehlerQHostInfoAgent$Unbekannter FehlerQHttp$Unbekannter Fehler QIODevice$Unbekannter Fehler,%1, %2 nicht definiertÿÿÿÿUnbekanntunbekannt*Änderungen verwerfen?ÿÿÿÿ&Herabrollen,RLM Right-to-left mark|Die Datei %1 existiert bereits. Soll sie überschreiben werden?4&Benutzerdefinierte Farbenÿÿÿÿÿÿÿÿ6unerwartetes Ende der Dateiÿÿÿÿ QDB2Driverÿÿÿÿ QMYSQLDriverÿÿÿÿ QODBCDriverÿÿÿÿÿÿÿÿÿÿÿÿNExecutive (7,5 x 10 Zoll, 191 x 254 mm)|Der nichtblockierende Socket konnte nicht initialisiert werden<PDF Pop directional formattingÿÿÿÿ QDB2Driverÿÿÿÿ QIBaseDriverÿÿÿÿ QMYSQLDriverÿÿÿÿ2Die Adresse ist geschütztÿÿÿÿÿÿÿÿFKonnte nicht geschrieben werden: %1.internes Limit erreicht<Ungültiger HTTP Antwort-Headerÿÿÿÿÿÿÿÿ–Die Socks5-Verbindung zu einen Socks-Server hat das Zeitlimit überschrittenA&lphakanal:~externe Entity-Referenz is nicht erlaubt in einem Attribut-WertÿÿÿÿM&inimieren6Letzte Seite zuerst druckenLinke SeiteHLetter (8,5 x 11 Zoll, 216 x 279 mm)FavoritenVorwärtsBild abwärts*Eine Seite nach unten QScrollBar*Eine Seite nach unten*Eine Seite nach links QScrollBar*Eine Seite nach links$Verbindung beendetQFtp$Verbindung beendetÿÿÿÿ4ZWNJ Zero width non-joinerÿÿÿÿ,Ein Verzeichnis zurück2Voransicht der Datei-InfoMa&ximieren Wiederherstellen>Mehrdeutige %1 nicht gehandhabtÿÿÿÿÿÿÿÿfDas Zeitlimit für die Operation wurde überschrittenTyp< &ZurückBDas Netzwerk ist nicht erreichbarNKein Rechner gesetzt für die VerbindungFRLO Start of right-to-left overridehFehler in der Text-Deklaration einer externen Entityÿÿÿÿdie Datei"unerwartetes Ende`Server hat die Verbindung unerwartet geschlossenÿÿÿÿ2Zu viele Dateien geöffnetRDas Protokoll `%1' wird nicht unterstützt*ZWJ Zero width joiner>Die Adresse ist nicht verfügbarÿÿÿÿ"B3 (353 x 500 mm),Neuen Ordner erstellen Q3FileDialog,Neuen Ordner erstellenÿÿÿÿ*Verknüpfung mit Dateiÿÿÿÿ,LRM Left-to-right markWiedergabe Stopp2Keine Resourcen verfügbarNächsterÆ Das Protokoll `%1' unterstützt nicht das Kopieren oder Verschieben von Dateien oder Verzeichnissen8Verknüpfung mit Verzeichnies2Anfrage wurde abgebrochenXFehler beim Parsen der Dokumenttypdefinition^<p>Dieses Programm verwendet Qt Version %1.</p>Rechte SeiteˆDas Protokoll `%1' unterstützt nicht das Anlegen neuer Verzeichnisse$Start Media Player A7 (74 x 105 mm)Ausführlich Q3FileDialogDetails¼%1 Die Datei konnte nicht gefunden werden. Stellen Sie sicher, dass der Dateiname richtig ist."A2 (420 x 594 mm)"Druckausrichtung: B7 (88 x 125 mm)<Qt Bibliothek ist inkompatibelÿÿÿÿ QMYSQLDriverÿÿÿÿQSQLite2Driverÿÿÿÿ/z÷ "(/8=CFKR\ahu{‚ˆŽ”›ª±·ÇÌÓàæòøÿ $,9AHORenw…Œ•œ«³¸ÄÕÝáèîôû '-39@ QProgressBarQDialog QDB2Driver QCheckBox QUndoStackQXml Q3TitleBar QMYSQLResultQDialogButtonBoxQ3Accel Q3TextEditQFtpQLibrary QFontDialogQMultiInputContextQRegExp QODBCResultQMultiInputContextPlugin QDB2Result QODBCDriver QDirModel QTcpServer QTDSDriver Q3FileDialog QSQLiteResultQSQLite2Result QToolButton QScrollBarQNativeSocketEngine Q3LocalFsQSlider QTextControl QPSQLDriver QColorDialog QIODevice QMYSQLDriver QAxSelect QWorkspace QApplication QOCIResult QShortcutQAbstractSpinBox QErrorMessage QSQLiteDriverQHostInfoAgent QUdpSocket QRadioButton QDateTimeEdit QMessageBox Q3TabDialogQSqlQTabBar QFileDialogQ3ProgressDialogQProgressDialogPPDOptionsModelQ3NetworkProtocolQMenu Q3MainWindowQWhatsThisAction QPrintDialogQUnicodeControlCharacterMenuQSQLite2DriverQObjectQPrintPropertiesDialog QComboBoxQ3Wizard Q3UrlOperator QInputContextQHttp QIBaseDriver Q3ToolBar QHostInfo QIBaseResultQWidget QLineEdit Q3DataTableQAbstractSocket QPSQLResultQSocks5SocketEngine QUndoModel QOCIDriver QUndoGroup QPushButtonQSpinBoxpinentry-x2go-0.7.5.6/pinentry-x2go/resources.rcc0000644000000000000000000000030412070425227016530 0ustar icons/button_ok.png icons/button_cancel.png pinentry-x2go_de.qm qt_de.qm pinentry-x2go-0.7.5.6/pinentry-x2go/templatedlg.ui0000644000000000000000000000271012070425227016671 0ustar TemplateDialog 0 0 400 302 Dialog 30 240 361 32 Qt::Horizontal QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok buttonBox accepted() TemplateDialog accept() 248 254 157 274 buttonBox rejected() TemplateDialog reject() 316 260 286 274 pinentry-x2go-0.7.5.6/README0000644000000000000000000000070312070425227012163 0ustar PIN Entry (X2Go) ---------------- This is a pinentry add-on for the X2Go Client application. The add-on has been derived from the GnuPG pinentry project: http://www.gnupg.org/related_software/pinentry/index.en.html The tool utilizes the Assuan protocol as described by the aegypten project; see http://www.gnupg.org/aegypten/ for details. Build HowTo ----------- $ aclocal $ autoheader $ autoreconf --install $ ./configure $ make && make install pinentry-x2go-0.7.5.6/secmem/Makefile.am0000644000000000000000000000173512070425227014616 0ustar # Secure Memory Makefile # Copyright (C) 2002 g10 Code GmbH # # This file is part of PINENTRY. # # PINENTRY is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # PINENTRY is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA ## Process this file with automake to produce Makefile.in EXTRA_DIST = Manifest noinst_LIBRARIES = libsecmem.a libsecmem_a_SOURCES = \ memory.h \ secmem-util.h \ util.h \ secmem.c \ util.c pinentry-x2go-0.7.5.6/secmem/memory.h0000644000000000000000000000260112070425227014234 0ustar /* Quintuple Agent secure memory allocation * Copyright (C) 1998,1999 Free Software Foundation, Inc. * Copyright (C) 1999,2000 Robert Bihlmeyer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _MEMORY_H #define _MEMORY_H #include /* values for flags, hardcoded in secmem.c */ #define SECMEM_WARN 0 #define SECMEM_DONT_WARN 1 #define SECMEM_SUSPEND_WARN 2 void secmem_init( size_t npool ); void secmem_term( void ); void *secmem_malloc( size_t size ); void *secmem_realloc( void *a, size_t newsize ); void secmem_free( void *a ); int m_is_secure( const void *p ); void secmem_dump_stats(void); void secmem_set_flags( unsigned flags ); unsigned secmem_get_flags(void); #endif /* _MEMORY_H */ pinentry-x2go-0.7.5.6/secmem/secmem.c0000644000000000000000000002162212070425227014174 0ustar /* secmem.c - memory allocation from a secure heap * Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc. * * This file is part of GnuPG. * * GnuPG is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * GnuPG is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include #include #include #include #include #include #if defined(HAVE_MLOCK) || defined(HAVE_MMAP) # include # include # include # ifdef USE_CAPABILITIES # include # endif #endif #include #include "memory.h" #ifdef ORIGINAL_GPG_VERSION #include "types.h" #include "util.h" #else /* ORIGINAL_GPG_VERSION */ #include "util.h" typedef union { int a; short b; char c[1]; long d; #ifdef HAVE_U64_TYPEDEF u64 e; #endif float f; double g; } PROPERLY_ALIGNED_TYPE; #define log_error log_info #define log_bug log_fatal void log_info(char *template, ...) { va_list args; va_start(args, template); vfprintf(stderr, template, args); va_end(args); } void log_fatal(char *template, ...) { va_list args; va_start(args, template); vfprintf(stderr, template, args); va_end(args); exit(EXIT_FAILURE); } #endif /* ORIGINAL_GPG_VERSION */ #if defined(MAP_ANON) && !defined(MAP_ANONYMOUS) # define MAP_ANONYMOUS MAP_ANON #endif #define DEFAULT_POOLSIZE 16384 typedef struct memblock_struct MEMBLOCK; struct memblock_struct { unsigned size; union { MEMBLOCK *next; PROPERLY_ALIGNED_TYPE aligned; } u; }; static void *pool; static volatile int pool_okay; /* may be checked in an atexit function */ static int pool_is_mmapped; static size_t poolsize; /* allocated length */ static size_t poollen; /* used length */ static MEMBLOCK *unused_blocks; static unsigned max_alloced; static unsigned cur_alloced; static unsigned max_blocks; static unsigned cur_blocks; static int disable_secmem; static int show_warning; static int no_warning; static int suspend_warning; static void print_warn(void) { if( !no_warning ) log_info("Warning: using insecure memory!\n"); } static void lock_pool( void *p, size_t n ) { #if defined(USE_CAPABILITIES) && defined(HAVE_MLOCK) int err; cap_set_proc( cap_from_text("cap_ipc_lock+ep") ); err = mlock( p, n ); if( err && errno ) err = errno; cap_set_proc( cap_from_text("cap_ipc_lock+p") ); if( err ) { if( errno != EPERM #ifdef EAGAIN /* OpenBSD returns this */ && errno != EAGAIN #endif ) log_error("can´t lock memory: %s\n", strerror(err)); show_warning = 1; } #elif defined(HAVE_MLOCK) uid_t uid; int err; uid = getuid(); #ifdef HAVE_BROKEN_MLOCK if( uid ) { errno = EPERM; err = errno; } else { err = mlock( p, n ); if( err && errno ) err = errno; } #else err = mlock( p, n ); if( err && errno ) err = errno; #endif if( uid && !geteuid() ) { if( setuid( uid ) || getuid() != geteuid() ) log_fatal("failed to reset uid: %s\n", strerror(errno)); } if( err ) { if( errno != EPERM #ifdef EAGAIN /* OpenBSD returns this */ && errno != EAGAIN #endif ) log_error("can´t lock memory: %s\n", strerror(err)); show_warning = 1; } #else log_info("Please note that you don't have secure memory on this system\n"); #endif } static void init_pool( size_t n) { size_t pgsize; poolsize = n; if( disable_secmem ) log_bug("secure memory is disabled"); #ifdef HAVE_GETPAGESIZE pgsize = getpagesize(); #else pgsize = 4096; #endif #if HAVE_MMAP poolsize = (poolsize + pgsize -1 ) & ~(pgsize-1); # ifdef MAP_ANONYMOUS pool = mmap( 0, poolsize, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); # else /* map /dev/zero instead */ { int fd; fd = open("/dev/zero", O_RDWR); if( fd == -1 ) { log_error("can't open /dev/zero: %s\n", strerror(errno) ); pool = (void*)-1; } else { pool = mmap( 0, poolsize, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); close (fd); } } # endif if( pool == (void*)-1 ) log_info("can't mmap pool of %u bytes: %s - using malloc\n", (unsigned)poolsize, strerror(errno)); else { pool_is_mmapped = 1; pool_okay = 1; } #endif if( !pool_okay ) { pool = malloc( poolsize ); if( !pool ) log_fatal("can't allocate memory pool of %u bytes\n", (unsigned)poolsize); else pool_okay = 1; } lock_pool( pool, poolsize ); poollen = 0; } /* concatenate unused blocks */ static void compress_pool(void) { /* fixme: we really should do this */ } void secmem_set_flags( unsigned flags ) { int was_susp = suspend_warning; no_warning = flags & 1; suspend_warning = flags & 2; /* and now issue the warning if it is not longer suspended */ if( was_susp && !suspend_warning && show_warning ) { show_warning = 0; print_warn(); } } unsigned secmem_get_flags(void) { unsigned flags; flags = no_warning ? 1:0; flags |= suspend_warning ? 2:0; return flags; } void secmem_init( size_t n ) { if( !n ) { #ifdef USE_CAPABILITIES /* drop all capabilities */ cap_set_proc( cap_from_text("all-eip") ); #elif !defined(HAVE_DOSISH_SYSTEM) uid_t uid; disable_secmem=1; uid = getuid(); if( uid != geteuid() ) { if( setuid( uid ) || getuid() != geteuid() ) log_fatal("failed to drop setuid\n" ); } #endif } else { if( n < DEFAULT_POOLSIZE ) n = DEFAULT_POOLSIZE; if( !pool_okay ) init_pool(n); else log_error("Oops, secure memory pool already initialized\n"); } } void * secmem_malloc( size_t size ) { MEMBLOCK *mb, *mb2; int compressed=0; if( !pool_okay ) { log_info( "operation is not possible without initialized secure memory\n"); log_info("(you may have used the wrong program for this task)\n"); exit(2); } if( show_warning && !suspend_warning ) { show_warning = 0; print_warn(); } /* blocks are always a multiple of 32 */ size += sizeof(MEMBLOCK); size = ((size + 31) / 32) * 32; retry: /* try to get it from the used blocks */ for(mb = unused_blocks,mb2=NULL; mb; mb2=mb, mb = mb->u.next ) if( mb->size >= size ) { if( mb2 ) mb2->u.next = mb->u.next; else unused_blocks = mb->u.next; goto leave; } /* allocate a new block */ if( (poollen + size <= poolsize) ) { mb = (void*)((char*)pool + poollen); poollen += size; mb->size = size; } else if( !compressed ) { compressed=1; compress_pool(); goto retry; } else return NULL; leave: cur_alloced += mb->size; cur_blocks++; if( cur_alloced > max_alloced ) max_alloced = cur_alloced; if( cur_blocks > max_blocks ) max_blocks = cur_blocks; return &mb->u.aligned.c; } void * secmem_realloc( void *p, size_t newsize ) { MEMBLOCK *mb; size_t size; void *a; mb = (MEMBLOCK*)((char*)p - ((size_t) &((MEMBLOCK*)0)->u.aligned.c)); size = mb->size; if( newsize < size ) return p; /* it is easier not to shrink the memory */ a = secmem_malloc( newsize ); memcpy(a, p, size); memset((char*)a+size, 0, newsize-size); secmem_free(p); return a; } void secmem_free( void *a ) { MEMBLOCK *mb; size_t size; if( !a ) return; mb = (MEMBLOCK*)((char*)a - ((size_t) &((MEMBLOCK*)0)->u.aligned.c)); size = mb->size; /* This does not make much sense: probably this memory is held in the * cache. We do it anyway: */ wipememory2(mb, 0xff, size ); wipememory2(mb, 0xaa, size ); wipememory2(mb, 0x55, size ); wipememory2(mb, 0x00, size ); mb->size = size; mb->u.next = unused_blocks; unused_blocks = mb; cur_blocks--; cur_alloced -= size; } int m_is_secure( const void *p ) { return p >= pool && p < (void*)((char*)pool+poolsize); } void secmem_term() { if( !pool_okay ) return; wipememory2( pool, 0xff, poolsize); wipememory2( pool, 0xaa, poolsize); wipememory2( pool, 0x55, poolsize); wipememory2( pool, 0x00, poolsize); #if HAVE_MMAP if( pool_is_mmapped ) munmap( pool, poolsize ); #endif pool = NULL; pool_okay = 0; poolsize=0; poollen=0; unused_blocks=NULL; } void secmem_dump_stats() { if( disable_secmem ) return; fprintf(stderr, "secmem usage: %u/%u bytes in %u/%u blocks of pool %lu/%lu\n", cur_alloced, max_alloced, cur_blocks, max_blocks, (ulong)poollen, (ulong)poolsize ); } pinentry-x2go-0.7.5.6/secmem/secmem-util.h0000644000000000000000000000020712070425227015150 0ustar /* This file exists because "util.h" is such a generic name that it is likely to clash with other such files. */ #include "util.h" pinentry-x2go-0.7.5.6/secmem/util.c0000644000000000000000000000634012070425227013700 0ustar /* Quintuple Agent * Copyright (C) 1999 Robert Bihlmeyer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define _GNU_SOURCE 1 #include #include #include #include #include #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "util.h" #ifndef TEMP_FAILURE_RETRY #define TEMP_FAILURE_RETRY(expression) \ (__extension__ \ ({ long int __result; \ do __result = (long int) (expression); \ while (__result == -1L && errno == EINTR); \ __result; })) #endif #ifndef HAVE_DOSISH_SYSTEM static int uid_set = 0; static uid_t real_uid, file_uid; #endif /*!HAVE_DOSISH_SYSTEM*/ /* write DATA of size BYTES to FD, until all is written or an error occurs */ ssize_t xwrite(int fd, const void *data, size_t bytes) { char *ptr; size_t todo; ssize_t written = 0; for (ptr = (char *)data, todo = bytes; todo; ptr += written, todo -= written) if ((written = TEMP_FAILURE_RETRY(write(fd, ptr, todo))) < 0) break; return written; } #if 0 extern int debug; int debugmsg(const char *fmt, ...) { va_list va; int ret; if (debug) { va_start(va, fmt); fprintf(stderr, "\e[4m"); ret = vfprintf(stderr, fmt, va); fprintf(stderr, "\e[24m"); va_end(va); return ret; } else return 0; } #endif /* initialize uid variables */ #ifndef HAVE_DOSISH_SYSTEM static void init_uids(void) { real_uid = getuid(); file_uid = geteuid(); uid_set = 1; } #endif #if 0 /* Not used. */ /* lower privileges to the real user's */ void lower_privs() { if (!uid_set) init_uids(); if (real_uid != file_uid) { #ifdef HAVE_SETEUID if (seteuid(real_uid) < 0) { perror("lowering privileges failed"); exit(EXIT_FAILURE); } #else fprintf(stderr, _("Warning: running q-agent setuid on this system is dangerous\n")); #endif /* HAVE_SETEUID */ } } #endif /* if 0 */ #if 0 /* Not used. */ /* raise privileges to the effective user's */ void raise_privs() { assert(real_uid >= 0); /* lower_privs() must be called before this */ #ifdef HAVE_SETEUID if (real_uid != file_uid && seteuid(file_uid) < 0) { perror("Warning: raising privileges failed"); } #endif /* HAVE_SETEUID */ } #endif /* if 0 */ /* drop all additional privileges */ void drop_privs() { #ifndef HAVE_DOSISH_SYSTEM if (!uid_set) init_uids(); if (real_uid != file_uid) { if (setuid(real_uid) < 0) { perror("dropping privileges failed"); exit(EXIT_FAILURE); } file_uid = real_uid; } #endif } pinentry-x2go-0.7.5.6/secmem/util.h0000644000000000000000000000405712070425227013710 0ustar /* Quintuple Agent utilities * Copyright (C) 1999 Robert Bihlmeyer * Copyright (C) 2003 g10 Code GmbH * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _UTIL_H #define _UTIL_H #include #ifndef HAVE_BYTE_TYPEDEF # undef byte # ifdef __riscos__ /* Norcroft treats char == unsigned char but char* != unsigned char* */ typedef char byte; # else typedef unsigned char byte; # endif # define HAVE_BYTE_TYPEDEF #endif #ifndef HAVE_ULONG_TYPEDEF # undef ulong typedef unsigned long ulong; # define HAVE_ULONG_TYPEDEF #endif ssize_t xwrite(int, const void *, size_t); /* write until finished */ int debugmsg(const char *, ...); /* output a debug message if debugging==on */ void drop_privs(void); /* finally drop privileges */ /* To avoid that a compiler optimizes certain memset calls away, these macros may be used instead. */ #define wipememory2(_ptr,_set,_len) do { \ volatile char *_vptr=(volatile char *)(_ptr); \ size_t _vlen=(_len); \ while(_vlen) { *_vptr=(_set); _vptr++; _vlen--; } \ } while(0) #define wipememory(_ptr,_len) wipememory2(_ptr,0,_len) #define wipe(_ptr,_len) wipememory2(_ptr,0,_len) #define xtoi_1(p) (*(p) <= '9'? (*(p)- '0'): \ *(p) <= 'F'? (*(p)-'A'+10):(*(p)-'a'+10)) #define xtoi_2(p) ((xtoi_1(p) * 16) + xtoi_1((p)+1)) #endif pinentry-x2go-0.7.5.6/THANKS0000644000000000000000000000107512070425227012221 0ustar # The X2Go developers say thanks to Robert Bihlmeyer Werner Koch, g10 Code GmbH Steffen Hansen, Klar�lvdalens Datakonsult AB Marcus Brinkmann, g10 Code GmbH Timo Schulz, g10 Code GmbH # The pinentry developers say thanks to: Alon Bar-Lev alon.barlev@gmail.com Albrecht Dress albrecht.dress@arcor.de Alexander Zangerl az at snafu.priv.at Michael Nottebrock michaelnottebrock at gmx.net Peter Eisentraut peter_e@gmx.net Tobias Koenig tokoe@kde.org pinentry-x2go-0.7.5.6/VERSION0000644000000000000000000000001112070425227012343 0ustar 0.7.5.6