# Makefile.am for gpgme/lang.
# Copyright (C) 2003, 2006 g10 Code GmbH
-#
+#
# This file is part of GPGME.
-#
+#
# GPGME is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of the
# License, or (at your option) any later version.
-#
+#
# GPGME 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 Lesser General
# Public License for more details.
-#
+#
# You should have received a copy of the GNU Lesser 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
NOWAIT in POSIX systems just means the caller already did the
waitpid for this child. */
if (! nowait)
- return _gpgme_ath_waitpid (pid, status, options);
+ return _gpgme_ath_waitpid (pid, status, options);
#endif
return 0;
}
Copyright (C) 2002, 2003, 2004 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
return select (nfd, rset, wset, eset, timeout);
}
-
+
ssize_t
ath_waitpid (pid_t pid, int *status, int options)
{
Copyright (C) 2002, 2003, 2004 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
#endif
}
-
+
ssize_t
ath_waitpid (pid_t pid, int *status, int options)
{
Copyright (C) 2002, 2003, 2004 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2010 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
/* data-compat.c - Compatibility interfaces for data objects.
Copyright (C) 2002, 2003, 2004, 2007 g10 Code GmbH
-
+
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
/* data-fd.c - A file descripor based data object.
Copyright (C) 2002, 2004 g10 Code GmbH
-
+
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
/* data-mem.c - A memory based data object.
Copyright (C) 2002, 2003, 2004, 2007 g10 Code GmbH
-
+
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
return -1;
memcpy (new_buffer, dh->data.mem.orig_buffer, dh->data.mem.length);
- dh->data.mem.buffer = new_buffer;
+ dh->data.mem.buffer = new_buffer;
dh->data.mem.size = new_size;
}
break;
case SEEK_CUR:
if ((offset > 0 && dh->data.mem.length - dh->data.mem.offset < offset)
- || (offset < 0 && dh->data.mem.offset < -offset))
+ || (offset < 0 && dh->data.mem.offset < -offset))
{
gpg_err_set_errno (EINVAL);
return -1;
}
else
(*r_dh)->data.mem.orig_buffer = buffer;
-
+
(*r_dh)->data.mem.size = size;
(*r_dh)->data.mem.length = size;
return TRACE_SUC1 ("dh=%p", *r_dh);
/* data-stream.c - A stream based data object.
Copyright (C) 2002, 2004 g10 Code GmbH
-
+
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
/* data-user.c - A user callback based data object.
Copyright (C) 2002, 2004 g10 Code GmbH
-
+
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
Copyright (C) 2002, 2003, 2004, 2005, 2007 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
/* data.h - Internal data object abstraction interface.
Copyright (C) 2002, 2004, 2005 g10 Code GmbH
-
+
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
/* debug.c - helpful output in desperate situations
Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2009 g10 Code GmbH
-
+
This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA. */
#if HAVE_CONFIG_H
saved_errno = errno;
if (debug_level < level)
return;
-
+
va_start (arg_ptr, format);
LOCK (debug_lock);
{
#else
struct tm *tp;
time_t atime = time (NULL);
-
+
tp = localtime (&atime);
fprintf (errfp, "GPGME %04d-%02d-%02d %02d:%02d:%02d <0x%04llx> ",
1900+tp->tm_year, tp->tm_mon+1, tp->tm_mday,
char str[51];
char *strp = str;
char *strp2 = &str[34];
-
+
for (j = 0; j < 16; j++)
{
unsigned char val;
/* debug.h - interface to debugging functions
Copyright (C) 2002, 2004, 2005, 2007 g10 Code GmbH
-
+
This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
#define TRACE_SEQ(hlp,fmt) \
_gpgme_debug_begin (&(hlp), _gpgme_trace_level, \
"%s: check: %s=%p, " fmt, _gpgme_trace_func, \
- _gpgme_trace_tagname, _gpgme_trace_tag)
+ _gpgme_trace_tagname, _gpgme_trace_tag)
#define TRACE_ADD0(hlp,fmt) \
_gpgme_debug_add (&(hlp), fmt)
#define TRACE_ADD1(hlp,fmt,a) \
Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
_gpgme_engine_set_status_handler (ctx->engine,
decrypt_verify_status_handler, ctx);
-
+
return _gpgme_engine_op_decrypt_verify (ctx->engine, cipher, plain);
}
if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
-
+
err = decrypt_verify_start (ctx, 0, cipher, plain);
return TRACE_ERR (err);
}
if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
-
+
err = decrypt_verify_start (ctx, 1, cipher, plain);
if (!err)
err = _gpgme_wait_one (ctx);
if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
-
+
err = decrypt_start (ctx, 0, cipher, plain);
return TRACE_ERR (err);
}
if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
-
+
err = decrypt_start (ctx, 1, cipher, plain);
if (!err)
err = _gpgme_wait_one (ctx);
Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
TRACE_BEG3 (DEBUG_CTX, "gpgme_op_delete", ctx,
"key=%p (%s), allow_secret=%i", key,
- (key->subkeys && key->subkeys->fpr) ?
+ (key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", allow_secret);
if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
-
+
err = delete_start (ctx, 0, key, allow_secret);
return TRACE_ERR (err);
}
TRACE_BEG3 (DEBUG_CTX, "gpgme_op_delete", ctx,
"key=%p (%s), allow_secret=%i", key,
- (key->subkeys && key->subkeys->fpr) ?
+ (key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", allow_secret);
if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
-
+
err = delete_start (ctx, 1, key, allow_secret);
if (!err)
err = _gpgme_wait_one (ctx);
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
- *
+ *
* GPGME 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
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
DEFINE_STATIC_LOCK (dirinfo_lock);
/* Constants used internally to select the data. */
-enum
+enum
{
WANT_HOMEDIR,
WANT_AGENT_SOCKET
return;
if (!*value)
return;
-
+
if (!strcmp (line, "homedir") && !dirinfo.homedir)
dirinfo.homedir = strdup (value);
else if (!strcmp (line, "agent-socket") && !dirinfo.agent_socket)
/* Read the directory information from gpgconf. This function expects
that DIRINFO_LOCK is held by the caller. */
static void
-read_gpgconf_dirs (void)
+read_gpgconf_dirs (void)
{
const char *pgmname;
char linebuf[1024] = {0};
do
{
- nread = _gpgme_io_read (rp[0],
- linebuf + linelen,
+ nread = _gpgme_io_read (rp[0],
+ linebuf + linelen,
sizeof linebuf - linelen - 1);
if (nread > 0)
{
}
}
while (nread > 0 && linelen < sizeof linebuf - 1);
-
+
_gpgme_io_close (rp[0]);
}
Copyright (C) 2002, 2003, 2004 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
TRACE_BEG5 (DEBUG_CTX, "gpgme_op_edit_start", ctx,
"key=%p (%s), fnc=%p fnc_value=%p, out=%p", key,
- (key->subkeys && key->subkeys->fpr) ?
+ (key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", fnc, fnc_value, out);
if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
-
+
err = edit_start (ctx, 0, 0, key, fnc, fnc_value, out);
return err;
}
TRACE_BEG5 (DEBUG_CTX, "gpgme_op_edit", ctx,
"key=%p (%s), fnc=%p fnc_value=%p, out=%p", key,
- (key->subkeys && key->subkeys->fpr) ?
+ (key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", fnc, fnc_value, out);
if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
-
+
err = edit_start (ctx, 1, 0, key, fnc, fnc_value, out);
if (!err)
TRACE_BEG5 (DEBUG_CTX, "gpgme_op_card_edit_start", ctx,
"key=%p (%s), fnc=%p fnc_value=%p, out=%p", key,
- (key->subkeys && key->subkeys->fpr) ?
+ (key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", fnc, fnc_value, out);
if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
-
+
err = edit_start (ctx, 0, 1, key, fnc, fnc_value, out);
return err;
}
TRACE_BEG5 (DEBUG_CTX, "gpgme_op_card_edit", ctx,
"key=%p (%s), fnc=%p fnc_value=%p, out=%p", key,
- (key->subkeys && key->subkeys->fpr) ?
+ (key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", fnc, fnc_value, out);
if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
-
+
err = edit_start (ctx, 1, 1, key, fnc, fnc_value, out);
if (!err)
err = _gpgme_wait_one (ctx);
/* encrypt-sign.c - encrypt and verify functions
Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
-
+
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
_gpgme_engine_set_status_handler (ctx->engine,
encrypt_sign_status_handler, ctx);
-
+
return _gpgme_engine_op_encrypt_sign (ctx->engine, recp, flags, plain,
cipher, ctx->use_armor,
ctx /* FIXME */);
if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
-
+
if (_gpgme_debug_trace () && recp)
{
int i = 0;
while (recp[i])
{
TRACE_LOG3 ("recipient[%i] = %p (%s)", i, recp[i],
- (recp[i]->subkeys && recp[i]->subkeys->fpr) ?
+ (recp[i]->subkeys && recp[i]->subkeys->fpr) ?
recp[i]->subkeys->fpr : "invalid");
i++;
}
if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
-
+
if (_gpgme_debug_trace () && recp)
{
int i = 0;
while (recp[i])
{
TRACE_LOG3 ("recipient[%i] = %p (%s)", i, recp[i],
- (recp[i]->subkeys && recp[i]->subkeys->fpr) ?
+ (recp[i]->subkeys && recp[i]->subkeys->fpr) ?
recp[i]->subkeys->fpr : "invalid");
i++;
}
Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
i++;
}
}
-
+
TRACE_SUC1 ("result=%p", &opd->result);
return &opd->result;
}
if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
-
+
if (_gpgme_debug_trace () && recp)
{
int i = 0;
while (recp[i])
{
TRACE_LOG3 ("recipient[%i] = %p (%s)", i, recp[i],
- (recp[i]->subkeys && recp[i]->subkeys->fpr) ?
+ (recp[i]->subkeys && recp[i]->subkeys->fpr) ?
recp[i]->subkeys->fpr : "invalid");
i++;
}
while (recp[i])
{
TRACE_LOG3 ("recipient[%i] = %p (%s)", i, recp[i],
- (recp[i]->subkeys && recp[i]->subkeys->fpr) ?
+ (recp[i]->subkeys && recp[i]->subkeys->fpr) ?
recp[i]->subkeys->fpr : "invalid");
i++;
}
/* Create a new instance. If HOME_DIR is NULL standard options for use
- with gpg-agent are issued. */
+ with gpg-agent are issued. */
static gpgme_error_t
llass_new (void **engine, const char *file_name, const char *home_dir)
{
/* Very simple parser only working for the one option we support. */
/* Note that wk promised to write a regression test if this
parser will be extended. */
- if (!strncmp (home_dir, "GPG_AGENT", 9)
+ if (!strncmp (home_dir, "GPG_AGENT", 9)
&& (!home_dir[9] || home_dir[9] == ' '))
llass->opt.gpg_agent = 1;
}
goto leave;
}
free (dft_ttytype);
-
+
err = assuan_transact (llass->assuan_ctx, optstr, NULL, NULL,
NULL, NULL, NULL, NULL);
free (optstr);
err = 0;
continue;
}
-
+
TRACE2 (DEBUG_CTX, "gpgme:llass_status_handler", llass,
"fd 0x%x: error reading assuan line: %s",
fd, gpg_strerror (err));
args++;
err = inquire_cb (llass, src, args);
- if (!err)
+ if (!err)
{
/* Flush and send END. */
err = assuan_send_data (llass->assuan_ctx, NULL, 0);
/* engine-backend.h - A crypto backend for the engine interface.
Copyright (C) 2002, 2003, 2004, 2009 g10 Code GmbH
-
+
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
gpgme_data_t signed_text, gpgme_data_t plaintext);
gpgme_error_t (*getauditlog) (void *engine, gpgme_data_t output,
unsigned int flags);
- gpgme_error_t (*opassuan_transact) (void *engine,
+ gpgme_error_t (*opassuan_transact) (void *engine,
const char *command,
gpgme_assuan_data_cb_t data_cb,
void *data_cb_value,
/* engine-g13.c - G13 engine.
Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2009 g10 Code GmbH
-
+
This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
typedef struct engine_g13 *engine_g13_t;
-static void g13_io_event (void *engine,
+static void g13_io_event (void *engine,
gpgme_event_io_t type, void *type_data);
return gpg_error (GPG_ERR_INV_VALUE);
/* FIXME: Reset value to default. */
- if (!value)
+ if (!value)
return 0;
if (asprintf (&optstr, "OPTION %s=%s", catstr, value) < 0)
TRACE2 (DEBUG_CTX, "gpgme:status_handler", g13,
"fd 0x%x: ERR line: %s",
fd, err ? gpg_strerror (err) : "ok");
-
+
/* Command execution errors are not fatal, as we use
a session based protocol. */
data->op_err = err;
src = line + 2;
while (*src == ' ')
src++;
-
+
args = strchr (line + 2, ' ');
if (!args)
args = line + linelen; /* set to an empty string */
else if (linelen >= 7
&& line[0] == 'I' && line[1] == 'N' && line[2] == 'Q'
&& line[3] == 'U' && line[4] == 'I' && line[5] == 'R'
- && line[6] == 'E'
+ && line[6] == 'E'
&& (line[7] == '\0' || line[7] == ' '))
{
char *src;
char *args;
-
+
for (src=line+7; *src == ' '; src++)
;
args++;
err = default_inq_cb (g13, src, args);
- if (!err)
+ if (!err)
{
/* Flush and send END. */
err = assuan_send_data (g13->assuan_ctx, NULL, 0);
}
}
while (!err && assuan_pending_line (g13->assuan_ctx));
-
+
return err;
}
-
+
static gpgme_error_t
add_io_cb (engine_g13_t g13, iocb_data_t *iocbd, gpgme_io_cb_t handler)
Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2009, 2010, 2012 g10 Code GmbH
-
+
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
struct
{
- int fd[2];
+ int fd[2];
int arg_loc;
size_t bufsize;
char *buffer;
/* This is a kludge - see the comment at colon_line_handler. */
struct
{
- int fd[2];
+ int fd[2];
int arg_loc;
size_t bufsize;
char *buffer;
colon_preprocessor_t preprocess_fnc;
} colon;
- char **argv;
+ char **argv;
struct fd_data_map_s *fd_data_map;
/* stuff needed for interactive (command) mode */
int idx; /* Index in fd_data_map */
gpgme_status_code_t code; /* last code */
char *keyword; /* what has been requested (malloced) */
- engine_command_handler_t fnc;
+ engine_command_handler_t fnc;
void *fnc_value;
/* The kludges never end. This is used to couple command handlers
with output data in edit key mode. */
rc = _gpgme_getenv ("TERM", &dft_ttytype);
if (rc)
goto leave;
-
+
if (dft_ttytype)
{
rc = add_arg (gpg, "--ttytype");
if (!gpg->colon.buffer)
return gpg_error_from_errno (errno);
- if (_gpgme_io_pipe (gpg->colon.fd, 1) == -1)
+ if (_gpgme_io_pipe (gpg->colon.fd, 1) == -1)
{
int saved_errno = errno;
free (gpg->colon.buffer);
gpgme_error_t err;
struct arg_and_data_s *a;
struct fd_data_map_s *fd_data_map;
- size_t datac=0, argc=0;
+ size_t datac=0, argc=0;
char **argv;
int need_special = 0;
int use_agent = 0;
fd_data_map[datac].inbound = a->inbound;
/* Create a pipe. */
- {
+ {
int fds[2];
-
+
if (_gpgme_io_pipe (fds, fd_data_map[datac].inbound ? 1 : 0)
== -1)
{
{
char *p;
int nread;
- size_t bufsize = gpg->status.bufsize;
+ size_t bufsize = gpg->status.bufsize;
char *buffer = gpg->status.buffer;
- size_t readpos = gpg->status.readpos;
+ size_t readpos = gpg->status.readpos;
assert (buffer);
if (bufsize - readpos < 256)
- {
+ {
/* Need more room for the read. */
bufsize += 1024;
buffer = realloc (buffer, bufsize);
rest = p; /* Set to an empty string. */
else
*rest++ = 0;
-
+
r = _gpgme_parse_status (buffer + 9);
if (r >= 0)
{
else if (gpg->status.fnc)
{
gpgme_error_t err;
- err = gpg->status.fnc (gpg->status.fnc_value,
+ err = gpg->status.fnc (gpg->status.fnc_value,
r, rest);
if (err)
return err;
}
-
+
if (r == GPGME_STATUS_END_STREAM)
{
if (gpg->cmd.used)
else
readpos++;
}
- }
+ }
/* Update the gpg object. */
gpg->status.bufsize = bufsize;
{
char *p;
int nread;
- size_t bufsize = gpg->colon.bufsize;
+ size_t bufsize = gpg->colon.bufsize;
char *buffer = gpg->colon.buffer;
- size_t readpos = gpg->colon.readpos;
+ size_t readpos = gpg->colon.readpos;
assert (buffer);
if (bufsize - readpos < 256)
- {
+ {
/* Need more room for the read. */
bufsize += 1024;
buffer = realloc (buffer, bufsize);
- if (!buffer)
+ if (!buffer)
return gpg_error_from_errno (errno);
}
if (line)
free (line);
}
-
+
/* To reuse the buffer for the next line we have to
shift the remaining data to the buffer start and
restart the loop Hmmm: We can optimize this function
else
readpos++;
}
- }
+ }
/* Update the gpg object. */
gpg->colon.bufsize = bufsize;
/* status_fd, colon_fd and end of list. */
n = 3;
- for (i = 0; gpg->fd_data_map[i].data; i++)
+ for (i = 0; gpg->fd_data_map[i].data; i++)
n++;
fd_list = calloc (n, sizeof *fd_list);
if (! fd_list)
n++;
if (gpg->colon.fnc)
{
- fd_list[n].fd = gpg->colon.fd[1];
+ fd_list[n].fd = gpg->colon.fd[1];
fd_list[n].dup_to = 1;
n++;
}
? _gpgme_data_inbound_handler
: _gpgme_data_outbound_handler,
gpg->fd_data_map[i].data, &gpg->fd_data_map[i].tag);
-
+
if (rc)
/* FIXME: kill the child */
return rc;
}
gpg_io_event (gpg, GPGME_EVENT_START, NULL);
-
+
/* fixme: check what data we can release here */
return 0;
}
if (err)
break;
i++;
- }
+ }
return err;
}
Note that we use a delimiter and thus a trailing delimiter is not
required. DELIM may not be changed after the first call. */
static const char *
-string_from_data (gpgme_data_t data, int delim,
+string_from_data (gpgme_data_t data, int delim,
void **helpptr, gpgme_error_t *r_err)
{
#define MYBUFLEN 2000 /* Fixme: We don't support URLs longer than that. */
return NULL;
}
- nread = gpgme_data_read (data, self->buf + self->buflen,
+ nread = gpgme_data_read (data, self->buf + self->buflen,
MYBUFLEN - self->buflen);
if (nread < 0)
{
rectype = RT_PUB;
else if (!strcmp (field[0], "uid"))
rectype = RT_UID;
- else
+ else
rectype = RT_NONE;
switch (rectype)
pub:<keyid>:<algo>:<keylen>:<creationdate>:<expirationdate>:<flags>
as defined in 5.2. Machine Readable Indexes of the OpenPGP
- HTTP Keyserver Protocol (draft).
+ HTTP Keyserver Protocol (draft).
We want:
pub:o<flags>:<keylen>:<algo>:<keyid>:<creatdate>:<expdate>::::::::
uid:<escaped uid string>:<creationdate>:<expirationdate>:<flags>
as defined in 5.2. Machine Readable Indexes of the OpenPGP
- HTTP Keyserver Protocol (draft).
+ HTTP Keyserver Protocol (draft).
We want:
uid:o<flags>::::<creatdate>:<expdate>:::<c-coded uid>:
}
if (!err)
err = add_arg (gpg, "--");
-
+
return err;
}
-
+
static gpgme_error_t
gpg_keylist (void *engine, const char *pattern, int secret_only,
err = add_arg (gpg, "--with-colons");
if (!err)
err = add_arg (gpg, "--list-trust-path");
-
+
/* Tell the gpg object about the data. */
if (!err)
err = add_arg (gpg, "--");
{
/* Static functions. */
_gpgme_get_gpg_path,
- NULL,
+ NULL,
gpg_get_version,
gpg_get_req_version,
gpg_new,
Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2009,
2010 g10 Code GmbH
-
+
This file is part of GPGME.
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
int linelen;
} attic;
int any; /* any data line seen */
- } colon;
+ } colon;
gpgme_data_t inline_data; /* Used to collect D lines. */
typedef struct engine_gpgsm *engine_gpgsm_t;
-static void gpgsm_io_event (void *engine,
+static void gpgsm_io_event (void *engine,
gpgme_event_io_t type, void *type_data);
return gpg_error (GPG_ERR_INV_VALUE);
/* FIXME: Reset value to default. */
- if (!value)
+ if (!value)
return 0;
if (asprintf (&optstr, "OPTION %s=%s", catstr, value) < 0)
snprintf (line, COMMANDLINELEN, "%s FD", which);
#else
if (opt)
- snprintf (line, COMMANDLINELEN, "%s FD=%s %s",
+ snprintf (line, COMMANDLINELEN, "%s FD=%s %s",
which, iocb_data->server_fd_str, opt);
else
- snprintf (line, COMMANDLINELEN, "%s FD=%s",
+ snprintf (line, COMMANDLINELEN, "%s FD=%s",
which, iocb_data->server_fd_str);
#endif
if (gpgsm->status.fnc)
err = gpgsm->status.fnc (gpgsm->status.fnc_value,
GPGME_STATUS_EOF, "");
-
+
if (!err && gpgsm->colon.fnc && gpgsm->colon.any)
{
/* We must tell a colon function about the EOF. We do
*dst = *src++;
(*alinelen)++;
}
-
+
if (*dst == '\n')
{
/* Terminate the pending line, pass it to the colon
handler and reset it. */
-
+
gpgsm->colon.any = 1;
if (*alinelen > 1 && *(dst - 1) == '\r')
dst--;
}
else
*dst++ = *src++;
-
+
linelen++;
}
-
+
src = line + 2;
while (linelen > 0)
{
{
char *rest;
gpgme_status_code_t r;
-
+
rest = strchr (line + 2, ' ');
if (!rest)
rest = line + linelen; /* set to an empty string */
else if (linelen >= 7
&& line[0] == 'I' && line[1] == 'N' && line[2] == 'Q'
&& line[3] == 'U' && line[4] == 'I' && line[5] == 'R'
- && line[6] == 'E'
+ && line[6] == 'E'
&& (line[7] == '\0' || line[7] == ' '))
{
char *keyword = line+7;
}
while (!err && assuan_pending_line (gpgsm->assuan_ctx));
-
+
return err;
}
if (!gpgsm)
return gpg_error (GPG_ERR_INV_VALUE);
-
+
if (mode)
return gpg_error (GPG_ERR_NOT_SUPPORTED);
/* Fist check whether the engine already features the
--re-import option. */
- err = gpgsm_assuan_simple_command
- (gpgsm->assuan_ctx,
+ err = gpgsm_assuan_simple_command
+ (gpgsm->assuan_ctx,
"GETINFO cmd_has_option IMPORT re-import", NULL, NULL);
if (err)
return gpg_error (GPG_ERR_NOT_SUPPORTED);
{
if (keyarray[idx]->protocol == GPGME_PROTOCOL_CMS
&& keyarray[idx]->subkeys
- && keyarray[idx]->subkeys->fpr
+ && keyarray[idx]->subkeys->fpr
&& *keyarray[idx]->subkeys->fpr)
buflen += strlen (keyarray[idx]->subkeys->fpr) + 1;
}
{
if (keyarray[idx]->protocol == GPGME_PROTOCOL_CMS
&& keyarray[idx]->subkeys
- && keyarray[idx]->subkeys->fpr
+ && keyarray[idx]->subkeys->fpr
&& *keyarray[idx]->subkeys->fpr)
p = stpcpy (stpcpy (p, keyarray[idx]->subkeys->fpr), "\n");
}
-
+
err = gpgme_data_new_from_mem (&gpgsm->input_helper_data,
buffer, buflen, 0);
if (err)
/* Use the validation mode if requested. We don't check for an error
yet because this is a pretty fresh gpgsm features. */
- gpgsm_assuan_simple_command (gpgsm->assuan_ctx,
+ gpgsm_assuan_simple_command (gpgsm->assuan_ctx,
(mode & GPGME_KEYLIST_MODE_VALIDATE)?
"OPTION with-validation=1":
"OPTION with-validation=0" ,
NULL, NULL);
/* Include the ephemeral keys if requested. We don't check for an error
yet because this is a pretty fresh gpgsm features. */
- gpgsm_assuan_simple_command (gpgsm->assuan_ctx,
+ gpgsm_assuan_simple_command (gpgsm->assuan_ctx,
(mode & GPGME_KEYLIST_MODE_EPHEMERAL)?
"OPTION with-ephemeral-keys=1":
"OPTION with-ephemeral-keys=0" ,
/* Always send key validation because RESET does not reset it. */
/* Use the validation mode if required. We don't check for an error
yet because this is a pretty fresh gpgsm features. */
- gpgsm_assuan_simple_command (gpgsm->assuan_ctx,
+ gpgsm_assuan_simple_command (gpgsm->assuan_ctx,
(mode & GPGME_KEYLIST_MODE_VALIDATE)?
"OPTION with-validation=1":
"OPTION with-validation=0" ,
else
err = gpg_error (GPG_ERR_INV_VALUE);
gpgme_key_unref (key);
- if (err)
+ if (err)
return err;
}
static void
gpgsm_set_status_handler (void *engine, engine_status_handler_t fnc,
- void *fnc_value)
+ void *fnc_value)
{
engine_gpgsm_t gpgsm = engine;
static gpgme_error_t
gpgsm_set_colon_line_handler (void *engine, engine_colon_line_handler_t fnc,
- void *fnc_value)
+ void *fnc_value)
{
engine_gpgsm_t gpgsm = engine;
if (asprintf (&line, "PASSWD -- %s", key->subkeys->fpr) < 0)
return gpg_error_from_syserror ();
-
+
gpgsm_clear_fd (gpgsm, OUTPUT_FD);
gpgsm_clear_fd (gpgsm, INPUT_FD);
gpgsm_clear_fd (gpgsm, MESSAGE_FD);
/* engine.c - GPGME engine support.
Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2006, 2009, 2010 g10 Code GmbH
-
+
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
return (*engine->ops->set_protocol) (engine->engine, protocol);
}
-
+
gpgme_error_t
_gpgme_engine_op_decrypt (engine_t engine, gpgme_data_t ciph,
gpgme_error_t
-_gpgme_engine_op_assuan_transact (engine_t engine,
+_gpgme_engine_op_assuan_transact (engine_t engine,
const char *command,
gpgme_assuan_data_cb_t data_cb,
void *data_cb_value,
if (!engine->ops->opassuan_transact)
return gpg_error (GPG_ERR_NOT_IMPLEMENTED);
- return (*engine->ops->opassuan_transact) (engine->engine,
+ return (*engine->ops->opassuan_transact) (engine->engine,
command,
data_cb, data_cb_value,
inq_cb, inq_cb_value,
/* engine.h - GPGME engine interface.
Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2010 g10 Code GmbH
-
+
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
#define ENGINE_H
#include "gpgme.h"
-
+
struct engine;
typedef struct engine *engine_t;
gpgme_error_t _gpgme_engine_op_getauditlog (engine_t engine,
gpgme_data_t output,
unsigned int flags);
-gpgme_error_t _gpgme_engine_op_assuan_transact
- (engine_t engine,
+gpgme_error_t _gpgme_engine_op_assuan_transact
+ (engine_t engine,
const char *command,
gpgme_assuan_data_cb_t data_cb,
void *data_cb_value,
Copyright (C) 2003, 2004 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
return gpg_strsource (err);
}
-
+
/* Retrieve the error code for the system error ERR. This returns
GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report
this). */
gpg_err_set_errno (err);
}
-
+
/* Return an error value with the error source SOURCE and the system
error ERR. */
gpgme_error_t
Copyright (C) 2001, 2002, 2003, 2004, 2010 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
|GPGME_EXPORT_MODE_MINIMAL)))
return gpg_error (GPG_ERR_INV_VALUE); /* Invalid flags in MODE. */
-
+
if ((mode & GPGME_EXPORT_MODE_EXTERN))
{
if (keydata)
nkeys++;
if (!nkeys)
return gpg_error (GPG_ERR_NO_DATA);
-
+
pattern = calloc (nkeys+1, sizeof *pattern);
if (!pattern)
return gpg_error_from_syserror ();
if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
-
+
if (_gpgme_debug_trace () && keys)
{
int i = 0;
while (keys[i])
{
TRACE_LOG3 ("keys[%i] = %p (%s)", i, keys[i],
- (keys[i]->subkeys && keys[i]->subkeys->fpr) ?
+ (keys[i]->subkeys && keys[i]->subkeys->fpr) ?
keys[i]->subkeys->fpr : "invalid");
i++;
}
if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
-
+
if (_gpgme_debug_trace () && keys)
{
int i = 0;
while (keys[i])
{
TRACE_LOG3 ("keys[%i] = %p (%s)", i, keys[i],
- (keys[i]->subkeys && keys[i]->subkeys->fpr) ?
+ (keys[i]->subkeys && keys[i]->subkeys->fpr) ?
keys[i]->subkeys->fpr : "invalid");
i++;
}
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
release_op_data (void *hook)
{
op_data_t opd = (op_data_t) hook;
-
+
if (opd->result.fpr)
free (opd->result.fpr);
if (opd->key_parameter)
err = _gpgme_op_reset (ctx, synchronous);
if (err)
return err;
-
+
err = _gpgme_op_data_lookup (ctx, OPDATA_GENKEY, &hook,
sizeof (*opd), release_op_data);
opd = hook;
Copyright (C) 2003, 2004 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
Copyright (C) 2007 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
if (err)
return err;
- _gpgme_engine_set_status_handler (ctx->engine,
+ _gpgme_engine_set_status_handler (ctx->engine,
getauditlog_status_handler, ctx);
return _gpgme_engine_op_getauditlog (ctx->engine, output, flags);
available GPG_ERR_NO_DATA is returned. This is the asynchronous
variant. */
gpgme_error_t
-gpgme_op_getauditlog_start (gpgme_ctx_t ctx,
+gpgme_op_getauditlog_start (gpgme_ctx_t ctx,
gpgme_data_t output, unsigned int flags)
{
gpg_error_t err;
Copyright (C) 2007 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
Copyright (C) 2009, 2010 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "gpgme.h"
/* GCC attributes. */
-#if __GNUC__ >= 4
+#if __GNUC__ >= 4
# define GT_GCC_A_SENTINEL(a) __attribute__ ((sentinel(a)))
#else
-# define GT_GCC_A_SENTINEL(a)
+# define GT_GCC_A_SENTINEL(a)
#endif
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5 )
| ARGP_HELP_DOC | ARGP_HELP_BUG_ADDR)
-void argp_error (const struct argp_state *state,
+void argp_error (const struct argp_state *state,
const char *fmt, ...) GT_GCC_A_PRINTF(2, 3);
-
+
char *
*arg = '\0';
arg++;
}
-
+
if (state.argv[idx][1] != '-')
key = state.argv[idx][1];
-
+
while (! found && opt->key)
{
if (key == opt->key
rc = argp->parser (ARGP_KEY_FINI, NULL, &state);
if (rc && rc != ARGP_ERR_UNKNOWN)
goto argperror;
-
+
rc = 0;
argp->parser (ARGP_KEY_SUCCESS, NULL, &state);
#define spacep(p) (*(p) == ' ' || *(p) == '\t')
-void log_error (int status, gpg_error_t errnum,
+void log_error (int status, gpg_error_t errnum,
const char *fmt, ...) GT_GCC_A_PRINTF(3,4);
while (*s)
{
if (*s == '%' && s[1] && s[2])
- {
+ {
s++;
*d++ = xtoi_2 (s);
s += 2;
else
*d++ = *s++;
}
- *d = 0;
+ *d = 0;
}
state->had_data[state->next_tag] = 0;
state->indent += 2;
state->next_tag++;
-
+
while (1)
{
attr = va_arg (ap, char *);
gpg_error_t
result_add_error (struct result_xml_state *state, char *name, gpg_error_t err)
-{
+{
char code[20];
char msg[1024];
snprintf (code, sizeof (code) - 1, "0x%x", err);
gpg_error_t
result_add_pubkey_algo (struct result_xml_state *state,
char *name, gpgme_pubkey_algo_t algo)
-{
+{
char code[20];
char msg[80];
snprintf (code, sizeof (code) - 1, "0x%x", algo);
gpg_error_t
result_add_hash_algo (struct result_xml_state *state,
char *name, gpgme_hash_algo_t algo)
-{
+{
char code[20];
char msg[80];
snprintf (code, sizeof (code) - 1, "0x%x", algo);
gpg_error_t
result_add_keyid (struct result_xml_state *state, char *name, char *keyid)
-{
+{
result_xml_tag_start (state, name, NULL);
result_xml_tag_data (state, keyid);
result_xml_tag_end (state);
gpg_error_t
result_add_fpr (struct result_xml_state *state, char *name, char *fpr)
-{
+{
result_xml_tag_start (state, name, NULL);
result_xml_tag_data (state, fpr);
result_xml_tag_end (state);
gpg_error_t
result_add_sig_mode (struct result_xml_state *state, char *name,
gpgme_sig_mode_t sig_mode)
-{
+{
char *mode;
char code[20];
gpg_error_t
result_add_value (struct result_xml_state *state,
char *name, unsigned int val)
-{
+{
char code[20];
snprintf (code, sizeof (code) - 1, "0x%x", val);
gpg_error_t
result_add_string (struct result_xml_state *state,
char *name, char *str)
-{
+{
result_xml_tag_start (state, name, NULL);
result_xml_tag_data (state, str);
result_xml_tag_end (state);
if (inv_recp)
{
result_xml_tag_start (&state, "invalid-recipients", NULL);
-
+
while (inv_recp)
{
result_xml_tag_start (&state, "invalid-key", NULL);
result_xml_tag_end (&state);
}
result_xml_tag_end (&state);
-
+
return 0;
}
result_xml_tag_end (&state);
}
result_xml_tag_end (&state);
-
+
return 0;
}
if (inv_key)
{
result_xml_tag_start (&state, "invalid-signers", NULL);
-
+
while (inv_key)
{
result_xml_tag_start (&state, "invalid-key", NULL);
}
result_xml_tag_end (&state);
-
+
return 0;
}
while (sig)
{
result_xml_tag_start (&state, "signature", NULL);
-
+
/* FIXME: Could be done better. */
result_add_value (&state, "summary", sig->summary);
if (sig->fpr)
result_add_hash_algo (&state, "hash-algo", sig->hash_algo);
if (sig->pka_address)
result_add_string (&state, "pka_address", sig->pka_address);
-
+
result_xml_tag_end (&state);
sig = sig->next;
}
}
result_xml_tag_end (&state);
-
+
return 0;
}
if (stat)
{
result_xml_tag_start (&state, "imports", NULL);
-
+
while (stat)
{
result_xml_tag_start (&state, "import-status", NULL);
}
result_xml_tag_end (&state);
-
+
return 0;
}
result_add_fpr (&state, "fpr", res->fpr);
result_xml_tag_end (&state);
-
+
return 0;
}
result_add_value (&state, "truncated", res->truncated);
result_xml_tag_end (&state);
-
+
return 0;
}
result_add_string (&state, "mount-dir", res->mount_dir);
result_xml_tag_end (&state);
-
+
return 0;
}
/* Forward declaration. */
-void gt_write_status (gpgme_tool_t gt,
+void gt_write_status (gpgme_tool_t gt,
status_t status, ...) GT_GCC_A_SENTINEL(0);
void
if (!gt || !r_key || !pattern)
return gpg_error (GPG_ERR_INV_VALUE);
-
+
ctx = gt->ctx;
err = gpgme_new (&listctx);
}
}
gpgme_release (listctx);
-
+
if (! err)
- gt_write_status (gt, STATUS_RECIPIENT,
- ((*r_key)->subkeys && (*r_key)->subkeys->fpr) ?
+ gt_write_status (gt, STATUS_RECIPIENT,
+ ((*r_key)->subkeys && (*r_key)->subkeys->fpr) ?
(*r_key)->subkeys->fpr : "invalid", NULL);
return err;
}
{
gpg_error_t err;
gpgme_ctx_t ctx;
-
+
err = _gt_gpgme_new (gt, &ctx);
if (err)
return err;
return GPGME_PROTOCOL_UNKNOWN;
}
-
+
gpg_error_t
gt_set_protocol (gpgme_tool_t gt, gpgme_protocol_t proto)
{
const char *modes[NR_KEYLIST_MODES + 1];
int idx = 0;
gpgme_keylist_mode_t mode = gpgme_get_keylist_mode (gt->ctx);
-
+
if (mode & GPGME_KEYLIST_MODE_LOCAL)
modes[idx++] = "local";
if (mode & GPGME_KEYLIST_MODE_EXTERN)
int cnt;
int idx;
gpgme_key_t *keys;
-
+
cnt = 0;
while (fpr[cnt])
cnt++;
-
+
if (! cnt)
return gpg_error (GPG_ERR_INV_VALUE);
keys = malloc ((cnt + 1) * sizeof (gpgme_key_t));
if (! keys)
return gpg_error_from_syserror ();
-
+
for (idx = 0; idx < cnt; idx++)
{
err = gpgme_get_key (gt->ctx, fpr[idx], &keys[idx], 0);
keys[cnt] = NULL;
err = gpgme_op_import_keys (gt->ctx, keys);
}
-
+
/* Rollback. */
while (--idx >= 0)
gpgme_key_unref (keys[idx]);
}
-static const char hlp_passwd[] =
+static const char hlp_passwd[] =
"PASSWD <user-id>\n"
"\n"
"Ask the backend to change the passphrase for the key\n"
else
return assuan_command_parse_fd (ctx, line, rfd);
}
-
+
static gpgme_data_encoding_t
server_data_encoding (const char *line)
}
-static const char hlp_version[] =
+static const char hlp_version[] =
"VERSION [<string>]\n"
"\n"
"Call the function gpgme_check_version.";
}
-static const char hlp_protocol[] =
+static const char hlp_protocol[] =
"PROTOCOL [<name>]\n"
"\n"
"With NAME, set the protocol. Without, return the current\n"
if (line && *line)
{
int flag = 0;
-
+
if (! strcasecmp (line, "true") || ! strcasecmp (line, "yes")
|| line[0] == '1')
flag = 1;
-
+
return gt_set_armor (server->gt, flag);
}
else
if (! strcasecmp (line, "true") || ! strcasecmp (line, "yes")
|| line[0] == '1')
flag = 1;
-
+
return gt_set_textmode (server->gt, flag);
}
else
if (line && *line)
{
int include_certs = 0;
-
+
if (! strcasecmp (line, "default"))
include_certs = GPGME_INCLUDE_CERTS_DEFAULT;
else
include_certs = atoi (line);
-
+
return gt_set_include_certs (server->gt, include_certs);
}
else
if (line && *line)
{
gpgme_keylist_mode_t mode = 0;
-
+
if (strstr (line, "local"))
mode |= GPGME_KEYLIST_MODE_LOCAL;
if (strstr (line, "extern"))
mode |= GPGME_KEYLIST_MODE_EPHEMERAL;
if (strstr (line, "validate"))
mode |= GPGME_KEYLIST_MODE_VALIDATE;
-
+
return gt_set_keylist_mode (server->gt, mode);
}
else
out_fn = server->output_filename;
if (out_fd == ASSUAN_INVALID_FD && !out_fn)
return GPG_ERR_ASS_NO_OUTPUT;
-
+
err = server_data_obj (inp_fd, inp_fn, 0, server->input_enc, &inp_data,
&server->input_stream);
if (err)
return err;
}
- err = gt_decrypt_verify (server->gt, inp_data, out_data, verify);
+ err = gt_decrypt_verify (server->gt, inp_data, out_data, verify);
gpgme_data_release (inp_data);
gpgme_data_release (out_data);
flags |= GPGME_ENCRYPT_PREPARE;
if (strstr (line, "--expect-sign"))
flags |= GPGME_ENCRYPT_EXPECT_SIGN;
-
+
inp_fd = assuan_get_input_fd (ctx);
inp_fn = server->input_filename;
out_fd = assuan_get_output_fd (ctx);
}
}
- err = gt_sign_encrypt (server->gt, flags, inp_data, out_data, sign);
+ err = gt_sign_encrypt (server->gt, flags, inp_data, out_data, sign);
gpgme_data_release (inp_data);
gpgme_data_release (out_data);
out_fn = server->output_filename;
if (out_fd == ASSUAN_INVALID_FD && !out_fn)
return GPG_ERR_ASS_NO_OUTPUT;
-
+
err = server_data_obj (inp_fd, inp_fn, 0, server->input_enc, &inp_data,
&server->input_stream);
if (err)
cmd_import (assuan_context_t ctx, char *line)
{
struct server *server = assuan_get_pointer (ctx);
-
+
if (line && *line)
{
char *fprs[2] = { line, NULL };
assuan_fd_t inp_fd;
char *inp_fn;
gpgme_data_t inp_data;
-
+
inp_fd = assuan_get_input_fd (ctx);
inp_fn = server->input_filename;
if (inp_fd == ASSUAN_INVALID_FD && !inp_fn)
&server->input_stream);
if (err)
return err;
-
- err = gt_import (server->gt, inp_data);
-
+
+ err = gt_import (server->gt, inp_data);
+
gpgme_data_release (inp_data);
server_reset_fds (server);
}
-static const char hlp_export[] =
+static const char hlp_export[] =
"EXPORT [--extern] [--minimal] [<pattern>]\n"
"\n"
"Export the keys described by PATTERN. Write the\n"
return GPG_ERR_ASS_NO_INPUT;
out_fd = assuan_get_output_fd (ctx);
out_fn = server->output_filename;
-
+
err = server_data_obj (inp_fd, inp_fn, 0, server->input_enc, &inp_data,
&server->input_stream);
if (err)
if (parms_data)
gpgme_data_release (parms_data);
- return err;
+ return err;
}
}
-static const char hlp_keylist[] =
+static const char hlp_keylist[] =
"KEYLIST [--secret-only] [<patterns>]\n"
"\n"
"List all certificates or only those specified by PATTERNS. Each\n"
gpgme_key_unref (key);
}
}
-
+
server_reset_fds (server);
return err;
}
-static const char hlp_getauditlog[] =
+static const char hlp_getauditlog[] =
"GETAUDITLOG [--html] [--with-help]\n"
"\n"
"Call the function gpgme_op_getauditlog with the given flags. Write\n"
table[idx].help);
if (err)
return err;
- }
+ }
return 0;
}
log_error (0, err, "assuan accept problem");
break;
}
-
+
err = assuan_process (server.assuan_ctx);
if (err)
log_error (0, err, "assuan processing failed");
Copyright (C) 2008 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
int n = 0;
char *buf;
char *p;
-
+
/* We have to quote some things because under Windows the program
parses the commandline and does some unquoting. We enclose the
whole argument in double-quotes, and escape literal double-quotes
memset (&sec_attr, 0, sizeof sec_attr);
sec_attr.nLength = sizeof sec_attr;
sec_attr.bInheritHandle = FALSE;
-
+
arg_string = build_commandline (argv);
if (!arg_string)
return -1;
fprintf (stderr, PGM":dup 0x%x to stderr\n", fd_list[i].peer_name);
}
}
-
+
if (!duped_stdin || !duped_stdout || !duped_stderr)
{
SECURITY_ATTRIBUTES sa;
-
+
memset (&sa, 0, sizeof sa);
sa.nLength = sizeof sa;
sa.bInheritHandle = TRUE;
if (!duped_stderr)
si.hStdError = hnul;
}
-
- cr_flags |= CREATE_SUSPENDED;
+
+ cr_flags |= CREATE_SUSPENDED;
cr_flags |= DETACHED_PROCESS;
if (!CreateProcessA (argv[0],
arg_string,
/* Close the /dev/nul handle if used. */
if (hnul != INVALID_HANDLE_VALUE)
CloseHandle (hnul);
-
+
for (i = 0; fd_list[i].handle != -1; i++)
CloseHandle ((HANDLE) fd_list[i].handle);
static int initialized;
static BOOL (WINAPI * func)(DWORD);
void *handle;
-
+
if (!initialized)
{
/* Available since W2000; thus we dynload it. */
FreeLibrary (handle);
}
}
-
+
if (func)
{
int rc = func (pi.dwProcessId);
(int)pi.dwProcessId, rc);
}
}
-
+
ResumeThread (pi.hThread);
CloseHandle (pi.hThread);
CloseHandle (pi.hProcess);
#define MAX_TRANS 10
int
-translate_get_from_file (const char *trans_file,
- struct spawn_fd_item_s *fd_list,
+translate_get_from_file (const char *trans_file,
+ struct spawn_fd_item_s *fd_list,
unsigned int *r_flags)
{
/* Hold roughly MAX_TRANS triplets of 64 bit numbers in hex
if (tail == NULL || ! (*tail == '\0' || isspace (*tail)))
break;
linep = tail;
-
+
while (isspace (*((unsigned char *)linep)))
linep++;
if (*linep == '\0')
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
return TRACE_ERR (gpg_error_from_errno (errno));
INIT_LOCK (ctx->lock);
-
+
_gpgme_engine_info_copy (&ctx->engine_info);
if (!ctx->engine_info)
{
if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
-
+
/* Shut down the engine when changing engine info. */
if (ctx->engine)
{
"name=%s, value=%s, flags=0x%x",
name ? name : "(null)", value ? value : "(null)",
flags);
-
+
if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
return ctx->sig_notations;
}
-
+
\f
const char *
gpgme_pubkey_algo_name (gpgme_pubkey_algo_t algo)
Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
return NULL;
}
-
+
if (_gpgme_debug_trace ())
{
gpgme_import_status_t impstat;
\f
static gpgme_error_t
-_gpgme_op_import_keys_start (gpgme_ctx_t ctx, int synchronous,
+_gpgme_op_import_keys_start (gpgme_ctx_t ctx, int synchronous,
gpgme_key_t *keys)
{
gpgme_error_t err;
while (keys[i])
{
TRACE_LOG3 ("keys[%i] = %p (%s)", i, keys[i],
- (keys[i]->subkeys && keys[i]->subkeys->fpr) ?
+ (keys[i]->subkeys && keys[i]->subkeys->fpr) ?
keys[i]->subkeys->fpr : "invalid");
i++;
}
while (keys[i])
{
TRACE_LOG3 ("keys[%i] = %p (%s)", i, keys[i],
- (keys[i]->subkeys && keys[i]->subkeys->fpr) ?
+ (keys[i]->subkeys && keys[i]->subkeys->fpr) ?
keys[i]->subkeys->fpr : "invalid");
i++;
}
Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
static char *
set_user_id_part (char *tail, const char *buf, size_t len)
{
- while (len && (buf[len - 1] == ' ' || buf[len - 1] == '\t'))
+ while (len && (buf[len - 1] == ' ' || buf[len - 1] == '\t'))
len--;
for (; len; len--)
*tail++ = *buf++;
{
in_name = 1;
start = src;
- }
+ }
src++;
}
-
+
if (in_name)
{
if (!*name)
tail = set_user_id_part (tail, start, src - start);
}
}
-
+
/* Let unused parts point to an EOS. */
tail--;
if (!*name)
{
if (*src == '<' && src[strlen (src) - 1] == '>')
*email = src;
-
+
/* Let unused parts point to an EOS. */
tail--;
if (!*name)
free (uid);
uid = next_uid;
}
-
+
if (key->issuer_serial)
free (key->issuer_serial);
if (key->issuer_name)
case GPGME_ATTR_FPR:
return subkey ? subkey->fpr : NULL;
- case GPGME_ATTR_ALGO:
+ case GPGME_ATTR_ALGO:
return subkey ? gpgme_pubkey_algo_name (subkey->pubkey_algo) : NULL;
case GPGME_ATTR_TYPE:
case GPGME_ATTR_OTRUST:
return otrust_to_string (key->owner_trust);
- case GPGME_ATTR_USERID:
+ case GPGME_ATTR_USERID:
return uid ? uid->uid : NULL;
- case GPGME_ATTR_NAME:
+ case GPGME_ATTR_NAME:
return uid ? uid->name : NULL;
case GPGME_ATTR_EMAIL:
case GPGME_ATTR_VALIDITY:
return uid ? validity_to_string (uid->validity) : NULL;
- case GPGME_ATTR_KEY_CAPS:
+ case GPGME_ATTR_KEY_CAPS:
return subkey ? capabilities_to_string (subkey) : NULL;
case GPGME_ATTR_SERIAL:
return (subkey && subkey->timestamp >= 0)
? (unsigned long) subkey->timestamp : 0;
- case GPGME_ATTR_EXPIRE:
+ case GPGME_ATTR_EXPIRE:
return (subkey && subkey->expires >= 0)
? (unsigned long) subkey->expires : 0;
case GPGME_ATTR_KEYID:
return certsig->keyid;
- case GPGME_ATTR_ALGO:
+ case GPGME_ATTR_ALGO:
return gpgme_pubkey_algo_name (certsig->pubkey_algo);
case GPGME_ATTR_USERID:
return certsig->uid;
- case GPGME_ATTR_NAME:
+ case GPGME_ATTR_NAME:
return certsig->name;
case GPGME_ATTR_EMAIL:
case GPGME_ATTR_COMMENT:
return certsig->comment;
-
+
default:
return NULL;
}
switch (what)
{
- case GPGME_ATTR_ALGO:
+ case GPGME_ATTR_ALGO:
return (unsigned long) certsig->pubkey_algo;
- case GPGME_ATTR_CREATED:
+ case GPGME_ATTR_CREATED:
return certsig->timestamp < 0 ? 0L : (unsigned long) certsig->timestamp;
- case GPGME_ATTR_EXPIRE:
+ case GPGME_ATTR_EXPIRE:
return certsig->expires < 0 ? 0L : (unsigned long) certsig->expires;
case GPGME_ATTR_KEY_REVOKED:
2008, 2009 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
case 'r':
uid->revoked = 1;
break;
-
+
case 'i':
uid->invalid = 1;
break;
rectype = RT_CRT;
else if (!strcmp (field[0], "crs"))
rectype = RT_CRS;
- else if (!strcmp (field[0], "fpr") && key)
+ else if (!strcmp (field[0], "fpr") && key)
rectype = RT_FPR;
else if (!strcmp (field[0], "uid") && key)
rectype = RT_UID;
else if (!strcmp (field[0], "sub") && key)
- rectype = RT_SUB;
+ rectype = RT_SUB;
else if (!strcmp (field[0], "ssb") && key)
rectype = RT_SSB;
else if (!strcmp (field[0], "spk") && key)
rectype = RT_SPK;
- else
+ else
rectype = RT_NONE;
/* Only look at signatures immediately following a user ID. For
int i = atoi (field[2]);
/* Ignore invalid values. */
if (i > 1)
- subkey->length = i;
+ subkey->length = i;
}
/* Field 4 has the public key algorithm. */
if (!key->issuer_serial)
return gpg_error_from_errno (errno);
}
-
+
/* Field 9 has the ownertrust. */
if (fields >= 9)
set_ownertrust (key, field[8]);
/* Field 8 is reserved (LID). */
/* Field 9 has the ownertrust. */
/* Field 10, the user ID, is n/a for a subkey. */
-
+
/* Field 11 has the signature class. */
/* Field 12 has the capabilities. */
if (i >= 1 && i < 128)
keysig->pubkey_algo = i;
}
-
+
/* Field 5 has the long keyid. */
if (fields >= 5 && strlen (field[4]) == DIM(keysig->_keyid) - 1)
strcpy (keysig->_keyid, field[4]);
-
+
/* Field 6 has the timestamp (seconds). */
if (fields >= 6)
keysig->timestamp = _gpgme_parse_timestamp (field[5], NULL);
keysig->_last_notation = notation;
}
}
-
+
case RT_NONE:
/* Unknown record. */
break;
if (!opd->key_cond)
return TRACE_ERR (gpg_error (GPG_ERR_EOF));
- opd->key_cond = 0;
+ opd->key_cond = 0;
assert (opd->key_queue);
}
queue_item = opd->key_queue;
opd->key_queue = queue_item->next;
if (!opd->key_queue)
opd->key_cond = 0;
-
+
*r_key = queue_item->key;
free (queue_item);
return TRACE_SUC2 ("key=%p (%s)", *r_key,
- ((*r_key)->subkeys && (*r_key)->subkeys->fpr) ?
+ ((*r_key)->subkeys && (*r_key)->subkeys->fpr) ?
(*r_key)->subkeys->fpr : "invalid");
}
gpgme_op_keylist_end (gpgme_ctx_t ctx)
{
TRACE (DEBUG_CTX, "gpgme_op_keylist_end", ctx);
-
+
if (!ctx)
return gpg_error (GPG_ERR_INV_VALUE);
if (!ctx || !r_key || !fpr)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
-
+
if (strlen (fpr) < 8) /* We have at least a key ID. */
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
if (! err)
{
TRACE_LOG2 ("key=%p (%s)", *r_key,
- ((*r_key)->subkeys && (*r_key)->subkeys->fpr) ?
+ ((*r_key)->subkeys && (*r_key)->subkeys->fpr) ?
(*r_key)->subkeys->fpr : "invalid");
}
return TRACE_ERR (err);
Copyright (C) 2002, 2003, 2004, 2007 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
/* type is: 0: asynchronous operation (use global or user event loop).
1: synchronous operation (always use private event loop).
2: asynchronous private operation (use private or user
- event loop).
+ event loop).
256: Modification flag to suppress the engine reset.
*/
gpgme_error_t
Copyright (C) 2009 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
/* XXXX. This is the asynchronous variant. */
gpgme_error_t
-gpgme_op_assuan_transact_start (gpgme_ctx_t ctx,
+gpgme_op_assuan_transact_start (gpgme_ctx_t ctx,
const char *command,
gpgme_assuan_data_cb_t data_cb,
void *data_cb_value,
if (!ctx)
return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
- err = opassuan_start (ctx, 1, command,
+ err = opassuan_start (ctx, 1, command,
data_cb, data_cb_value,
inq_cb, inq_cb_value,
status_cb, status_cb_value);
}
if (op_err_p)
*op_err_p = op_err;
-
+
out:
return TRACE_ERR (err);
}
/* ops.h - Internal operation support.
Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH
-
+
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
/* passphrase.c - Passphrase callback.
Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH
-
+
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
if (err)
return err;
- if (code == GPGME_STATUS_GET_HIDDEN
+ if (code == GPGME_STATUS_GET_HIDDEN
&& (!strcmp (key, "passphrase.enter")
|| !strcmp (key, "passphrase.pin.ask")))
{
Copyright (C) 2010 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
if (where)
*where = '\0';
- where = args;
+ where = args;
}
else
return gpg_error (GPG_ERR_INV_ENGINE);
case GPGME_STATUS_SUCCESS:
opd->success_seen = 1;
break;
-
+
case GPGME_STATUS_EOF:
/* In case the OpenPGP engine does not properly implement the
passwd command we won't get a success status back and thus we
/* Change the passphrase for KEY. FLAGS is reserved for future use
and must be passed as 0. The engine is expected to present a user
interface to enter the old and the new passphrase. This is the
- asynchronous variant.
+ asynchronous variant.
Note that if ever the need arises to supply a passphrase we can do
this with a flag value and the passphrase callback feature. */
Copyright (C) 2001, 2002, 2004, 2005, 2007, 2010 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
handler (fd, handler_value);
}
- /* Then do the close. */
+ /* Then do the close. */
res = close (fd);
return TRACE_SYSRES (res);
}
"close_handler=%p/%p", handler, value);
assert (fd != -1);
-
+
LOCK (notify_table_lock);
for (idx=0; idx < notify_table_size; idx++)
if (notify_table[idx].fd == -1)
notify_table[idx].fd = fd;
notify_table[idx].handler = handler;
notify_table[idx].value = value;
-
+
leave:
UNLOCK (notify_table_lock);
TRACE_LOG3 ("fd[%i] = 0x%x -> 0x%x", i, fd_list[i].fd, fd_list[i].dup_to);
pid = fork ();
- if (pid == -1)
+ if (pid == -1)
return TRACE_SYSRES (-1);
if (!pid)
close (fd_list[i].fd);
}
-
+
if (! seen_stdin || ! seen_stderr)
{
fd = open ("/dev/null", O_RDWR);
if (fd != 0 && fd != 2)
close (fd);
}
-
+
execv (path, (char *const *) argv);
/* Hmm: in that case we could write a special status code to the
status-pipe. */
any = 0;
for (i = 0; i < nfds; i++)
{
- if (fds[i].fd == -1)
+ if (fds[i].fd == -1)
continue;
if (fds[i].for_read)
{
}
fds[i].signaled = 0;
}
- TRACE_END (dbg_help, "]");
+ TRACE_END (dbg_help, "]");
if (!any)
return TRACE_SYSRES (0);
}
TRACE_END (dbg_help, "]");
}
-
+
/* The variable N is used to optimize it a little bit. */
for (n = count, i = 0; i < nfds && n; i++)
{
nread += iov->iov_len;
iov++;
}
-
+
TRACE_LOG1 ("about to receive %d bytes", nread);
do
-/* posix-sema.c
+/* posix-sema.c
Copyright (C) 2001 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2004, 2007 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
Copyright (C) 2001, 2002, 2004 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
return 0;
}
-void
+void
_gpgme_allow_set_foreground_window (pid_t pid)
{
(void)pid;
Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
/* progress.c - status handler for progress status
Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
-
+
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
}
}
}
- }
+ }
if (type != 'X')
ctx->progress_cb (ctx->progress_cb_value, args_cpy, type, current, total);
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
Copyright (C) 2001, 2003, 2004, 2007 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
} \
while (0)
#define DESTROY_LOCK(name) _gpgme_sema_cs_destroy (&(name))
-
+
#define LOCK(name) \
do \
Copyright (C) 2005 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
/* We copy the flags into individual bits to make them easier
accessible individually for the user. */
notation->human_readable = flags & GPGME_SIG_NOTATION_HUMAN_READABLE ? 1 : 0;
- notation->critical = flags & GPGME_SIG_NOTATION_CRITICAL ? 1 : 0;
+ notation->critical = flags & GPGME_SIG_NOTATION_CRITICAL ? 1 : 0;
notation->flags = flags;
}
Copyright (C) 2001, 2002, 2003, 2004, 2007 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
case GPGME_STATUS_INV_RECP:
if (opd->inv_sgnr_seen && opd->ignore_inv_recp)
- break;
+ break;
/* FALLTROUGH */
case GPGME_STATUS_INV_SGNR:
if (code == GPGME_STATUS_INV_SGNR)
/* signers.c - Maintain signer sets.
Copyright (C) 2001 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
-
+
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
gpgme_signers_add (gpgme_ctx_t ctx, const gpgme_key_t key)
{
TRACE_BEG2 (DEBUG_CTX, "gpgme_signers_add", ctx,
- "key=%p (%s)", key, (key->subkeys && key->subkeys->fpr) ?
+ "key=%p (%s)", key, (key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid");
if (!ctx || !key)
Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
val = item->keyid;
break;
- case GPGME_ATTR_OTRUST:
+ case GPGME_ATTR_OTRUST:
val = item->owner_trust;
break;
val = item->validity;
break;
- case GPGME_ATTR_USERID:
+ case GPGME_ATTR_USERID:
val = item->name;
break;
switch (what)
{
- case GPGME_ATTR_LEVEL:
+ case GPGME_ATTR_LEVEL:
val = item->level;
break;
- case GPGME_ATTR_TYPE:
+ case GPGME_ATTR_TYPE:
val = item->type;
break;
Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
{
field++;
pend = strchr (p, ':');
- if (pend)
+ if (pend)
*pend++ = 0;
switch (field)
return TRACE_ERR (err);
if (!opd->trust_cond)
return TRACE_ERR (gpg_error (GPG_ERR_EOF));
- opd->trust_cond = 0;
+ opd->trust_cond = 0;
assert (opd->trust_queue);
}
q = opd->trust_queue;
#define va_copy(d, s) (*(d) = *(s))
#elif defined (MUST_COPY_VA_BYVAL)
#define va_copy(d, s) ((d) = (s))
-#else
+#else
#define va_copy(d, s) memcpy ((d), (s), sizeof (va_list))
-#endif
-#endif
+#endif
+#endif
#ifdef TEST
/* version.c - Version check routines.
Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008 g10 Code GmbH
-
+
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
/* We need to make sure that the sockets are initialized. */
{
WSADATA wsadat;
-
+
WSAStartup (0x202, &wsadat);
}
#endif
if (my_major > rq_major
|| (my_major == rq_major && my_minor > rq_minor)
- || (my_major == rq_major && my_minor == rq_minor
+ || (my_major == rq_major && my_minor == rq_minor
&& my_micro > rq_micro)
|| (my_major == rq_major && my_minor == rq_minor
&& my_micro == rq_micro && strcmp (my_plvl, rq_plvl) >= 0))
TRACE2 (DEBUG_INIT, "gpgme_check_version", 0,
"req_version=%s, VERSION=%s",
req_version? req_version:"(null)", VERSION);
-
+
result = _gpgme_compare_versions (VERSION, req_version) ? VERSION : NULL;
if (result != NULL)
_gpgme_selftest = 0;
/* Extract the version string of a program from STRING. The version
number is expected to be in GNU style format:
-
+
foo 1.2.3
foo (bar system) 1.2.3
foo 1.2.3 cruft
Copyright (C) 2009 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
#if 0
/* XXXX. This is the asynchronous variant. */
static gpgme_error_t
-gpgme_op_vfs_transact_start (gpgme_ctx_t ctx,
+gpgme_op_vfs_transact_start (gpgme_ctx_t ctx,
const char *command,
gpgme_assuan_data_cb_t data_cb,
void *data_cb_value,
if (!ctx)
return gpg_error (GPG_ERR_INV_VALUE);
-
+
err = vfs_start (ctx, 1, command, data_cb, data_cb_value,
inq_cb, inq_cb_value, status_cb, status_cb_value);
if (!err)
free (container_file_esc);
return err;
}
-
+
err = gpgme_op_vfs_transact (ctx, cmd, NULL, NULL, NULL, NULL,
NULL, NULL, op_err);
free (cmd);
return err;
}
free (container_file_esc);
-
+
err = gpgme_op_vfs_transact (ctx, cmd, NULL, NULL, NULL, NULL,
NULL, NULL, op_err);
free (cmd);
if (_gpgme_debug_trace () && recp)
{
int i = 0;
-
+
while (recp[i])
{
TRACE_LOG3 ("recipient[%i] = %p (%s)", i, recp[i],
- (recp[i]->subkeys && recp[i]->subkeys->fpr) ?
+ (recp[i]->subkeys && recp[i]->subkeys->fpr) ?
recp[i]->subkeys->fpr : "invalid");
i++;
}
Copyright (C) 2009 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
#if 0
/* XXXX. This is the asynchronous variant. */
static gpgme_error_t
-gpgme_op_vfs_transact_start (gpgme_ctx_t ctx,
+gpgme_op_vfs_transact_start (gpgme_ctx_t ctx,
const char *command,
gpgme_assuan_data_cb_t data_cb,
void *data_cb_value,
if (!ctx)
return gpg_error (GPG_ERR_INV_VALUE);
-
+
err = vfs_start (ctx, 1, command, data_cb, data_cb_value,
inq_cb, inq_cb_value, status_cb, status_cb_value);
if (!err)
if (asprintf (&cmd, "MOUNT") < 0)
return gpg_error_from_syserror ();
}
-
+
err = gpgme_op_vfs_transact (ctx, cmd, NULL, NULL, NULL, NULL,
_gpgme_vfs_mount_status_handler, ctx, op_err);
free (cmd);
-/* w32-ce.h
+/* w32-ce.h
Copyright (C) 2010 g10 Code GmbH
Copyright (C) 1991,92,97,2000,02 Free Software Foundation, Inc.
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
but that header also redefines some Windows functions which we need
to avoid unless having included shlobj.h. */
#include <winsock2.h>
-#include <ws2tcpip.h>
+#include <ws2tcpip.h>
#include <windows.h>
#include <shlobj.h>
}
nbytes = (size_t)(n+1) * sizeof(*result);
- if (nbytes / sizeof(*result) != (n+1))
+ if (nbytes / sizeof(*result) != (n+1))
{
gpg_err_set_errno (ENOMEM);
return NULL;
free (name);
return ERROR_NOT_ENOUGH_MEMORY;
}
-
+
err = RegQueryValueExW (hKey, name, lpReserved, &type, data, &data_len);
if (lpType)
*lpType = type;
/* This is valid since we allocated one more above. */
((char*)data)[data_len] = '\0';
((char*)data)[data_len + 1] = '\0';
-
+
data_c = wchar_to_utf8 ((wchar_t*) data);
if (!data_c)
return GetLastError();
path_c = wchar_to_utf8 (path);
if (! path_c)
return 0;
-
+
strncpy (lpszPath, path_c, MAX_PATH);
free (path_c);
lpszPath[MAX_PATH - 1] = '\0';
/* Replacement for the access function. Note that we can't use fopen
here because wince might now allow to have a shared read for an
executable; it is better to to read the file attributes.
-
+
Limitation: Only F_OK is supported.
*/
int
/* Perform a binary search for KEY in BASE which has NMEMB elements
- of SIZE bytes each. The comparisons are done by (*COMPAR)().
+ of SIZE bytes each. The comparisons are done by (*COMPAR)().
Code taken from glibc-2.6. */
void *
_gpgme_wince_bsearch (const void *key, const void *base,
-/* w32-ce.h
+/* w32-ce.h
Copyright (C) 2010 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
void *_gpgme_wince_bsearch (const void *key, const void *base,
size_t nmemb, size_t size,
int (*compar) (const void *, const void *));
-#define bsearch(a,b,c,d,e) _gpgme_wince_bsearch ((a),(b),(c),(d),(e))
+#define bsearch(a,b,c,d,e) _gpgme_wince_bsearch ((a),(b),(c),(d),(e))
#if defined(_MSC_VER)
/* Remove the redefined __leave keyword. It is defined by MSC for
Copyright (C) 2001, 2002, 2004, 2005 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
\f
#define MAX_SLAFD 256
-static struct
+static struct
{
int used;
_gpgme_io_fd2str (char *buf, int buflen, int fd)
{
HANDLE hndl;
-
+
TRACE_BEG1 (DEBUG_SYSIO, "_gpgme_io_fd2str", fd, "fd=%d", fd);
if (giochannel_table[fd].fd != -1)
hndl = (HANDLE) _get_osfhandle (giochannel_table[fd].fd);
hndl = (HANDLE) giochannel_table[fd].socket;
TRACE_SUC1 ("syshd=%p", hndl);
-
+
return snprintf (buf, buflen, "%d", (int) hndl);
}
nread = -1;
saved_errno = EIO;
}
-
+
if (nread != 0 && nread != -1)
TRACE_LOGBUF (buffer, nread);
if (filedes[inherit_idx] < 0)
{
int saved_errno = errno;
-
+
_close (fds[0]);
_close (fds[1]);
errno = saved_errno;
if (filedes[1 - inherit_idx] < 0)
{
int saved_errno = errno;
-
+
_gpgme_io_close (fds[inherit_idx]);
_close (fds[1 - inherit_idx]);
errno = saved_errno;
return TRACE_SYSRES (-1);
}
-
+
return TRACE_SUC5 ("read=0x%x/%p, write=0x%x/%p, channel=%p",
filedes[0],
(HANDLE) _get_osfhandle (giochannel_table[filedes[0]].fd),
{
if (giochannel_table[fd].primary)
g_io_channel_shutdown (giochannel_table[fd].chan, 1, NULL);
-
+
g_io_channel_unref (giochannel_table[fd].chan);
}
else
assert (giochannel_table[fd].fd != -1);
_close (giochannel_table[fd].fd);
}
-
+
giochannel_table[fd].used = 0;
giochannel_table[fd].fd = -1;
giochannel_table[fd].socket = INVALID_SOCKET;
{
GIOChannel *chan;
GIOStatus status;
-
+
TRACE_BEG (DEBUG_SYSIO, "_gpgme_io_set_nonblocking", fd);
chan = find_channel (fd);
int n = 0;
char *buf;
char *p;
-
+
/* We have to quote some things because under Windows the program
parses the commandline and does some unquoting. We enclose the
whole argument in double-quotes, and escape literal double-quotes
TRACE_LOG2 ("argv[%2i] = %s", i, argv[i]);
i++;
}
-
+
/* We do not inherit any handles by default, and just insert those
handles we want the child to have afterwards. But some handle
values occur on the command line, and we need to move
memset (&sec_attr, 0, sizeof sec_attr);
sec_attr.nLength = sizeof sec_attr;
sec_attr.bInheritHandle = FALSE;
-
+
arg_string = build_commandline (args);
free (args);
if (!arg_string)
}
free (arg_string);
-
+
if (flags & IOSPAWN_FLAG_ALLOW_SET_FG)
_gpgme_allow_set_foreground_window ((pid_t)pi.dwProcessId);
{
/* Strip the newline. */
len = strlen (line) - 1;
-
+
/* Format is: Local name, stdin/stdout/stderr, peer name, argv idx. */
snprintf (&line[len], BUFFER_MAX - len, "0x%x %d 0x%x %d \n",
fd_list[i].fd, fd_list[i].dup_to,
close (tmp_fd);
/* The temporary file is deleted by the gpgme-w32spawn process
(hopefully). */
-
+
TRACE_LOG4 ("CreateProcess ready: hProcess=%p, hThread=%p, "
"dwProcessID=%d, dwThreadId=%d",
- pi.hProcess, pi.hThread,
+ pi.hProcess, pi.hThread,
(int) pi.dwProcessId, (int) pi.dwThreadId);
-
+
if (r_pid)
*r_pid = (pid_t)pi.dwProcessId;
if (ResumeThread (pi.hThread) < 0)
TRACE_LOG1 ("ResumeThread failed: ec=%d", (int) GetLastError ());
-
+
if (!CloseHandle (pi.hThread))
TRACE_LOG1 ("CloseHandle of thread failed: ec=%d",
(int) GetLastError ());
{
int npollfds;
GPollFD *pollfds;
- int *pollfds_map;
+ int *pollfds_map;
int i;
int j;
int any;
{
GIOChannel *chan = NULL;
- if (fds[i].fd == -1)
+ if (fds[i].fd == -1)
continue;
if ((fds[i].for_read || fds[i].for_write)
&& !(chan = find_channel (fds[i].fd)))
{
TRACE_ADD1 (dbg_help, "[BAD0x%x ", fds[i].fd);
- TRACE_END (dbg_help, "]");
+ TRACE_END (dbg_help, "]");
assert (!"see log file");
}
else if (fds[i].for_read )
}
fds[i].signaled = 0;
}
- TRACE_END (dbg_help, "]");
+ TRACE_END (dbg_help, "]");
if (!any)
{
count = 0;
}
TRACE_END (dbg_help, "]");
}
-
+
/* COUNT is used to stop the lop as soon as possible. */
for (n = count, i = 0; i < npollfds && n; i++)
{
errno = EIO;
return TRACE_SYSRES (-1);
}
-
+
chan = giochannel_table[fd].chan;
g_io_channel_ref (chan);
giochannel_table[newfd].used = 1;
}
TRACE_SUC2 ("fd=%i, socket=0x%x", fd, res);
-
+
return fd;
}
int
_gpgme_io_connect (int fd, struct sockaddr *addr, int addrlen)
{
- GIOChannel *chan;
+ GIOChannel *chan;
int sockfd;
int res;
GIOFlags flags;
Copyright (C) 2001, 2002, 2003, 2004, 2007, 2010 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
want to close something. Using the same handle for these
duplicates works just fine. */
int dup_from;
-} fd_table[MAX_SLAFD];
+} fd_table[MAX_SLAFD];
/* Returns the FD or -1 on resource limit. */
{
HANDLE file_hd;
int file_sock;
- HANDLE thread_hd;
+ HANDLE thread_hd;
int refcount;
DECLARE_LOCK (mutex);
int eof_shortcut;
int error;
int error_code;
-
+
/* This is manually reset. */
HANDLE have_data_ev;
/* This is automatically reset. */
{
HANDLE file_hd;
int file_sock;
- HANDLE thread_hd;
+ HANDLE thread_hd;
int refcount;
DECLARE_LOCK (mutex);
-
+
int stop_me;
int error;
int error_code;
HANDLE have_data;
HANDLE is_empty;
HANDLE stopped;
- size_t nbytes;
+ size_t nbytes;
char buffer[WRITEBUF_SIZE];
};
}
-static DWORD CALLBACK
+static DWORD CALLBACK
reader (void *arg)
{
struct reader_context_s *ctx = arg;
/* Leave a 1 byte gap so that we can see whether it is empty or
full. */
if ((ctx->writepos + 1) % READBUF_SIZE == ctx->readpos)
- {
+ {
/* Wait for space. */
if (!ResetEvent (ctx->have_space_ev))
TRACE_LOG1 ("ResetEvent failed: ec=%d", (int) GetLastError ());
if (nbytes > READBUF_SIZE - ctx->writepos)
nbytes = READBUF_SIZE - ctx->writepos;
UNLOCK (ctx->mutex);
-
+
TRACE_LOG2 ("%s %d bytes", sock? "receiving":"reading", nbytes);
if (sock)
break;
}
TRACE_LOG1 ("got %u bytes", nread);
-
+
ctx->writepos = (ctx->writepos + nread) % READBUF_SIZE;
if (!SetEvent (ctx->have_data_ev))
TRACE_LOG2 ("SetEvent (0x%x) failed: ec=%d", ctx->have_data_ev,
TRACE_LOG2 ("SetEvent (0x%x) failed: ec=%d", ctx->have_data_ev,
(int) GetLastError ());
SetEvent (ctx->stopped);
-
+
return TRACE_SUC ();
}
memset (&sec_attr, 0, sizeof sec_attr);
sec_attr.nLength = sizeof sec_attr;
sec_attr.bInheritHandle = FALSE;
-
+
ctx = calloc (1, sizeof *ctx);
if (!ctx)
{
free (ctx);
TRACE_SYSERR (EIO);
return NULL;
- }
+ }
else
{
/* We set the priority of the thread higher because we know that
return;
}
ctx->stop_me = 1;
- if (ctx->have_space_ev)
+ if (ctx->have_space_ev)
SetEvent (ctx->have_space_ev);
UNLOCK (ctx->mutex);
WaitForSingleObject (ctx->stopped, INFINITE);
TRACE1 (DEBUG_SYSIO, "gpgme:destroy_reader", ctx->file_hd,
"thread %p has terminated", ctx->thread_hd);
-
+
if (ctx->stopped)
CloseHandle (ctx->stopped);
if (ctx->have_data_ev)
struct reader_context_s *ctx;
TRACE_BEG2 (DEBUG_SYSIO, "_gpgme_io_read", fd,
"buffer=%p, count=%u", buffer, count);
-
+
ctx = find_reader (fd, 1);
if (!ctx)
{
TRACE_LOG1 ("data from thread %p available", ctx->thread_hd);
LOCK (ctx->mutex);
}
-
+
if (ctx->readpos == ctx->writepos || ctx->error)
{
UNLOCK (ctx->mutex);
gpg_err_set_errno (ctx->error_code);
return TRACE_SYSRES (-1);
}
-
+
nread = ctx->readpos < ctx->writepos
? ctx->writepos - ctx->readpos
: READBUF_SIZE - ctx->readpos;
return TRACE_SYSRES (-1);
}
UNLOCK (ctx->mutex);
-
+
TRACE_LOGBUF (buffer, nread);
return TRACE_SYSRES (nread);
}
/* The writer does use a simple buffering strategy so that we are
informed about write errors as soon as possible (i. e. with the the
next call to the write function. */
-static DWORD CALLBACK
+static DWORD CALLBACK
writer (void *arg)
{
struct writer_context_s *ctx = arg;
break;
}
if (!ctx->nbytes)
- {
+ {
if (!SetEvent (ctx->is_empty))
TRACE_LOG1 ("SetEvent failed: ec=%d", (int) GetLastError ());
if (!ResetEvent (ctx->have_data))
break;
}
UNLOCK (ctx->mutex);
-
+
TRACE_LOG2 ("%s %d bytes", sock?"sending":"writing", ctx->nbytes);
/* Note that CTX->nbytes is not zero at this point, because
}
}
TRACE_LOG1 ("wrote %d bytes", (int) nwritten);
-
+
LOCK (ctx->mutex);
ctx->nbytes -= nwritten;
UNLOCK (ctx->mutex);
TRACE_SYSERR (errno);
return NULL;
}
-
+
if (fd < 0 || fd >= MAX_SLAFD || !fd_table[fd].used)
{
TRACE_SYSERR (EIO);
free (ctx);
TRACE_SYSERR (EIO);
return NULL;
- }
+ }
else
{
/* We set the priority of the thread higher because we know
return;
}
ctx->stop_me = 1;
- if (ctx->have_data)
+ if (ctx->have_data)
SetEvent (ctx->have_data);
UNLOCK (ctx->mutex);
"unblock control call failed for thread %p", ctx->thread_hd);
}
#endif
-
+
TRACE1 (DEBUG_SYSIO, "gpgme:destroy_writer", ctx->file_hd,
"waiting for termination of thread %p", ctx->thread_hd);
WaitForSingleObject (ctx->stopped, INFINITE);
TRACE1 (DEBUG_SYSIO, "gpgme:destroy_writer", ctx->file_hd,
"thread %p has terminated", ctx->thread_hd);
-
+
if (ctx->stopped)
CloseHandle (ctx->stopped);
if (ctx->have_data)
{
wt = create_writer (fd);
writer_table[i].fd = fd;
- writer_table[i].context = wt;
+ writer_table[i].context = wt;
writer_table[i].used = 1;
}
{
fd_table[rfd].handle = hd;
fd_table[wfd].rvid = rvid;
- }
+ }
#else
memset (&sec_attr, 0, sizeof (sec_attr));
sec_attr.nLength = sizeof (sec_attr);
sec_attr.bInheritHandle = FALSE;
-
+
if (!CreatePipe (&rh, &wh, &sec_attr, PIPEBUF_SIZE))
{
TRACE_LOG1 ("CreatePipe failed: ec=%d", (int) GetLastError ());
if (fd_table[fd].handle != INVALID_HANDLE_VALUE)
{
if (!CloseHandle (fd_table[fd].handle))
- {
+ {
TRACE_LOG1 ("CloseHandle failed: ec=%d", (int) GetLastError ());
/* FIXME: Should translate the error code. */
gpg_err_set_errno (EIO);
else if (fd_table[fd].socket != INVALID_SOCKET)
{
if (closesocket (fd_table[fd].socket))
- {
+ {
TRACE_LOG1 ("closesocket failed: ec=%d", (int) WSAGetLastError ());
/* FIXME: Should translate the error code. */
gpg_err_set_errno (EIO);
}
release_fd (fd);
-
+
return TRACE_SYSRES (0);
}
p = fdbuf;
*p = 0;
-
+
if (fd0 != -1)
{
if (fd0_isnull)
}
strcpy (p, "-&S2=null ");
p += strlen (p);
-
+
n = strlen (fdbuf);
for (i=0; (s = argv[i]); i++)
{
return NULL;
p = stpcpy (p, fdbuf);
- for (i = 0; argv[i]; i++)
+ for (i = 0; argv[i]; i++)
{
if (!i)
continue; /* Ignore argv[0]. */
p = stpcpy (p, argv[i]);
}
- return buf;
+ return buf;
}
#else
static char *
int n = 0;
char *buf;
char *p;
-
+
/* We have to quote some things because under Windows the program
parses the commandline and does some unquoting. We enclose the
whole argument in double-quotes, and escape literal double-quotes
gpg_err_set_errno (EBADF);
return TRACE_SYSRES (-1);
}
-
+
if (fd_list[i].dup_to == 0)
{
fd_in = fd_list[i].fd;
memset (&sec_attr, 0, sizeof sec_attr);
sec_attr.nLength = sizeof sec_attr;
sec_attr.bInheritHandle = FALSE;
-
+
arg_string = build_commandline (args);
free (args);
if (!arg_string)
int fd = fd_list[i].fd;
HANDLE ohd = INVALID_HANDLE_VALUE;
HANDLE hd = INVALID_HANDLE_VALUE;
-
+
/* Make it inheritable for the wrapper process. */
if (fd >= 0 && fd < MAX_SLAFD && fd_table[fd].used)
ohd = fd_table[fd].handle;
/* Return the child name of this handle. */
fd_list[i].peer_name = handle_to_fd (hd);
}
-
+
/* Write the handle translation information to the temporary
file. */
{
{
/* Strip the newline. */
len = strlen (line) - 1;
-
+
/* Format is: Local name, stdin/stdout/stderr, peer name, argv idx. */
snprintf (&line[len], BUFFER_MAX - len, "0x%x %d 0x%x %d \n",
fd_list[i].fd, fd_list[i].dup_to,
TRACE_LOG4 ("CreateProcess ready: hProcess=%p, hThread=%p, "
"dwProcessID=%d, dwThreadId=%d",
- pi.hProcess, pi.hThread,
+ pi.hProcess, pi.hThread,
(int) pi.dwProcessId, (int) pi.dwThreadId);
-
+
if (r_pid)
*r_pid = (pid_t)pi.dwProcessId;
-
+
if (ResumeThread (pi.hThread) < 0)
TRACE_LOG1 ("ResumeThread failed: ec=%d", (int) GetLastError ());
-
+
if (!CloseHandle (pi.hThread))
TRACE_LOG1 ("CloseHandle of thread failed: ec=%d",
(int) GetLastError ());
if (fds[i].for_read)
{
struct reader_context_s *ctx = find_reader (fds[i].fd,1);
-
+
if (!ctx)
TRACE_LOG1 ("error: no reader for FD 0x%x (ignored)",
fds[i].fd);
else if (fds[i].for_write)
{
struct writer_context_s *ctx = find_writer (fds[i].fd,1);
-
+
if (!ctx)
TRACE_LOG1 ("error: no writer for FD 0x%x (ignored)",
fds[i].fd);
}
}
TRACE_END (dbg_help, "]");
- if (!any)
+ if (!any)
return TRACE_SYSRES (0);
code = WaitForMultipleObjects (nwait, waitbuf, 0, nonblock ? 0 : 1000);
{
int k;
int j = handle_to_fd (waitbuf[i]);
-
+
TRACE_LOG1 ("WFMO invalid handle %d removed", j);
for (k = 0 ; k < nfds; k++)
{
TRACE_LOG1 ("WFMO returned %d", code);
count = -1;
}
-
+
if (count > 0)
{
TRACE_SEQ (dbg_help, "select OK [ ");
/* FIXME: Should determine a proper error code. */
gpg_err_set_errno (EIO);
}
-
+
return TRACE_SYSRES (count);
}
newfd = new_fd();
if (newfd == -1)
return TRACE_SYSRES (-1);
-
+
fd_table[newfd].handle = fd_table[fd].handle;
fd_table[newfd].socket = fd_table[fd].socket;
fd_table[newfd].rvid = fd_table[fd].rvid;
fd = new_fd();
if (fd == -1)
return TRACE_SYSRES (-1);
-
+
res = socket (domain, type, proto);
if (res == INVALID_SOCKET)
{
fd_table[fd].socket = res;
TRACE_SUC2 ("socket=0x%x (0x%x)", fd, fd_table[fd].socket);
-
+
return fd;
}
gpg_err_set_errno (EBADF);
return TRACE_SYSRES (-1);
}
-
+
res = connect (fd_table[fd].socket, addr, addrlen);
if (res)
{
-/* w32-sema.c
+/* w32-sema.c
Copyright (C) 2001 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2004, 2007 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
CRITICAL_SECTION *mp;
static CRITICAL_SECTION init_lock;
static int initialized;
-
+
if (!initialized) {
/* The very first time we call this function, we assume that
only one thread is running, so that we can bootstrap the
Copyright (C) 2001, 2002, 2003, 2004, 2007 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
but that header also redefines some Windows functions which we need
to avoid unless having included shlobj.h. */
#include <winsock2.h>
-#include <ws2tcpip.h>
+#include <ws2tcpip.h>
#include <windows.h>
#include <shlobj.h>
return 0;
}
return -1;
-}
+}
#endif /* HAVE_ALLOW_SET_FOREGROUND_WINDOW */
-void
+void
_gpgme_allow_set_foreground_window (pid_t pid)
{
#ifdef HAVE_ALLOW_SET_FOREGROUND_WINDOW
HKEY root_key, key_handle;
DWORD n1, nbytes, type;
char *result = NULL;
-
+
if (!root)
root_key = HKEY_CURRENT_USER;
else if (!strcmp( root, "HKEY_CLASSES_ROOT"))
root_key = HKEY_CURRENT_CONFIG;
else
return NULL;
-
+
if (RegOpenKeyExA (root_key, dir, 0, KEY_READ, &key_handle))
{
if (root)
#ifndef HAVE_W32CE_SYSTEM
/* Windows CE does not have an environment. */
- if (type == REG_EXPAND_SZ && strchr (result, '%'))
+ if (type == REG_EXPAND_SZ && strchr (result, '%'))
{
char *tmp;
-
+
n1 += 1000;
tmp = malloc (n1 + 1);
if (!tmp)
result = malloc (strlen (tmp)+1);
if (!result)
result = tmp;
- else
+ else
{
strcpy (result, tmp);
free (tmp);
find_program_in_registry (const char *name)
{
char *program = NULL;
-
+
program = read_w32_registry_string (NULL, "Software\\GNU\\GnuPG", name);
if (program)
{
{
char path[MAX_PATH];
char *result = NULL;
-
+
/* See http://wiki.tcl.tk/17492 for details on compatibility. */
if (SHGetSpecialFolderPathA (NULL, path, CSIDL_PROGRAM_FILES, 0))
{
else
{
int len = strlen(tmp);
-
+
/* GetTempPath may return with \ on the end */
while(len > 0 && tmp[len - 1] == '\\')
{
-/* wait-global.c
+/* wait-global.c
Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH
-
+
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
gpgme_error_t err = 0;
gpgme_error_t local_op_err = 0;
struct wait_item_s *item;
-
+
assert (nr);
nr--;
-
+
item = (struct wait_item_s *) fdt.fds[i].opaque;
assert (item);
ictx = item->ctx;
struct gpgme_io_event_done_data data;
data.err = 0;
data.op_err = 0;
-
+
/* FIXME: This does not perform too well. We have to
release the lock because the I/O event handler
acquires it to remove the context from the active
-/* wait-private.c
+/* wait-private.c
Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH
-
+
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
return err;
}
-
+
for (i = 0; i < ctx->fdt.size && nr; i++)
{
if (ctx->fdt.fds[i].fd != -1 && ctx->fdt.fds[i].signaled)
if (ctx->canceled)
err = gpg_error (GPG_ERR_CANCELED);
UNLOCK (ctx->lock);
-
+
if (!err)
- err = _gpgme_run_io_cb (&ctx->fdt.fds[i], 0, &op_err);
+ err = _gpgme_run_io_cb (&ctx->fdt.fds[i], 0, &op_err);
if (err)
{
/* An error occured. Close all fds in this context,
-/* wait-user.c
+/* wait-user.c
Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH
-
+
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-/* wait.c
+/* wait.c
Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 g10 Code GmbH
-
+
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* sizeof (*new_fds));
if (!new_fds)
return gpg_error_from_errno (errno);
-
+
fdt->fds = new_fds;
fdt->size += FDT_ALLOCSIZE;
for (j = 0; j < FDT_ALLOCSIZE; j++)
/* wait.h - Definitions for the wait queue interface.
Copyright (C) 2000 Werner Koch (dd9jn)
Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
-
+
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
{
/* If this is the first field, the old internal code will still work. */
void *handler_value;
-
+
/* The I/O callback can pass an operational error here. */
gpgme_error_t op_err;
};
Copyright (C) 2008, 2009 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
exit (ex);
}
-int
+int
main (int argc, char **argv)
{
int last_argc = -1;
}
else if (!strncmp (*argv, "--", 2))
show_usage (1);
-
- }
-
+
+ }
+
if (!argc)
show_usage (1);
/* Lookup the keys. */
err = gpgme_op_keylist_ext_start (ctx, (const char**)argv, 0, 0);
fail_if_err (err);
-
+
while (!(err = gpgme_op_keylist_next (ctx, &key)))
{
printf ("keyid: %s (fpr: %s)\n",
fail_if_err (err);
gpgme_set_armor (ctx, 1);
- err = gpgme_op_export_keys (ctx, keyarray, mode,
+ err = gpgme_op_export_keys (ctx, keyarray, mode,
(mode & GPGME_KEYLIST_MODE_EXTERN)? NULL:out);
fail_if_err (err);
Copyright (C) 2008, 2009 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
exit (ex);
}
-int
+int
main (int argc, char **argv)
{
int last_argc = -1;
}
else if (!strncmp (*argv, "--", 2))
show_usage (1);
-
- }
-
+
+ }
+
if (!argc)
show_usage (1);
if (url_mode)
gpgme_data_set_encoding (data, (nul_mode? GPGME_DATA_ENCODING_URL0
: GPGME_DATA_ENCODING_URL));
-
+
err = gpgme_op_import (ctx, data);
fail_if_err (err);
impres = gpgme_op_import_result (ctx);
exit (1);
}
print_import_result (impres);
-
+
gpgme_data_release (data);
}
Copyright (C) 2008, 2009 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
}
-int
+int
main (int argc, char **argv)
{
int last_argc = -1;
}
else if (!strncmp (*argv, "--", 2))
show_usage (1);
-
- }
-
+
+ }
+
if (argc > 1)
show_usage (1);
err = gpgme_op_keylist_start (ctx, argc? argv[0]:NULL, 0);
fail_if_err (err);
-
+
while (!(err = gpgme_op_keylist_next (ctx, &key)))
{
gpgme_user_id_t uid;
int nuids;
-
+
printf ("keyid : %s\n", key->subkeys?nonnull (key->subkeys->keyid):"?");
printf ("fpr : %s\n", key->subkeys?nonnull (key->subkeys->fpr):"?");
for (nuids=0, uid=key->uids; uid; uid = uid->next, nuids++)
{
printf ("userid %d: %s\n", nuids, nonnull(uid->uid));
- printf ("valid %d: %s\n", nuids,
+ printf ("valid %d: %s\n", nuids,
uid->validity == GPGME_VALIDITY_UNKNOWN? "unknown":
uid->validity == GPGME_VALIDITY_UNDEFINED? "undefined":
uid->validity == GPGME_VALIDITY_NEVER? "never":
Copyright (C) 2009 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
gpgme_new_signature_t sig;
for (invkey = result->invalid_signers; invkey; invkey = invkey->next)
- printf ("Signing key `%s' not used: %s <%s>\n",
- nonnull (invkey->fpr),
+ printf ("Signing key `%s' not used: %s <%s>\n",
+ nonnull (invkey->fpr),
gpg_strerror (invkey->reason), gpg_strsource (invkey->reason));
-
+
for (sig = result->signatures; sig; sig = sig->next)
{
printf ("Key fingerprint: %s\n", nonnull (sig->fpr));
}
-int
+int
main (int argc, char **argv)
{
int last_argc = -1;
}
else if (!strncmp (*argv, "--", 2))
show_usage (1);
-
- }
-
+
+ }
+
if (argc != 1)
show_usage (1);
if (key_string)
{
gpgme_key_t akey;
-
+
err = gpgme_get_key (ctx, key_string, &akey, 1);
if (err)
{
Copyright (C) 2001, 2002, 2003, 2004, 2009 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#define BUF_SIZE 512
char buf[BUF_SIZE + 1];
int ret;
-
+
ret = gpgme_data_seek (dh, 0, SEEK_SET);
if (ret)
fail_if_err (gpgme_err_code_from_errno (errno));
if (!srcdir)
srcdir = ".";
buf = malloc (strlen(srcdir) + strlen(fname) + 2);
- if (!buf)
+ if (!buf)
exit (8);
strcpy (buf, srcdir);
strcat (buf, "/");
Copyright (C) 2009 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
fputs (" sys-error", stdout);
}
-static void
+static void
print_validity (gpgme_validity_t val)
{
const char *s = NULL;
}
-int
+int
main (int argc, char **argv)
{
int last_argc = -1;
}
else if (!strncmp (*argv, "--", 2))
show_usage (1);
-
- }
-
+
+ }
+
if (argc < 1 || argc > 2)
show_usage (1);
-
+
fp_sig = fopen (argv[0], "rb");
if (!fp_sig)
{
err = gpgme_error_from_syserror ();
- fprintf (stderr, PGM ": can't open `%s': %s\n",
+ fprintf (stderr, PGM ": can't open `%s': %s\n",
argv[0], gpgme_strerror (err));
exit (1);
}
if (!fp_msg)
{
err = gpgme_error_from_syserror ();
- fprintf (stderr, PGM ": can't open `%s': %s\n",
+ fprintf (stderr, PGM ": can't open `%s': %s\n",
argv[1], gpgme_strerror (err));
exit (1);
}
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
}
}
-int
+int
main (int argc, char **argv)
{
round_t round = TEST_INITIALIZER;
Copyright (C) 2003, 2004, 2007 g10 Code GmbH
This file is part of GPGME.
-
+
GPGME is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
}
-int
+int
main (int argc, char **argv )
{
gpgme_engine_info_t info;
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
-
+
GPGME 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
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
#include <gpgme.h>
-int
+int
main (int argc, char **argv)
{
const char *null_result;