~ubuntu-branches/ubuntu/jaunty/gnupg2/jaunty-security

« back to all changes in this revision

Viewing changes to agent/simple-pwquery.h

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Viehmann
  • Date: 2008-10-04 10:25:53 UTC
  • mfrom: (5.1.15 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081004102553-fv62pp8dsitxli47
Tags: 2.0.9-3.1
* Non-maintainer upload.
* agent/gpg-agent.c: Deinit the threading library before exec'ing
  the command to run in --daemon mode. And because that still doesn't
  restore the sigprocmask, do that manually. Closes: #499569

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* simple-pwquery.c - A simple password query cleint for gpg-agent
2
 
 *      Copyright (C) 2002 Free Software Foundation, Inc.
3
 
 *
4
 
 * This file is part of GnuPG.
5
 
 *
6
 
 * GnuPG is free software; you can redistribute it and/or modify
7
 
 * it under the terms of the GNU General Public License as published by
8
 
 * the Free Software Foundation; either version 2 of the License, or
9
 
 * (at your option) any later version.
10
 
 *
11
 
 * GnuPG is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 * GNU General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU General Public License
17
 
 * along with this program; if not, write to the Free Software
18
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19
 
 */
20
 
 
21
 
#ifndef SIMPLE_PWQUERY_H
22
 
#define SIMPLE_PWQUERY_H
23
 
 
24
 
#ifdef SIMPLE_PWQUERY_IMPLEMENTATION /* Begin configuration stuff. */
25
 
 
26
 
/* Include whatever files you need.  */
27
 
#include <gcrypt.h>
28
 
#include "../jnlib/logging.h"
29
 
 
30
 
/* Try to write error message using the standard log mechanism.  The
31
 
   current implementation requires that the HAVE_JNLIB_LOGGING is also
32
 
   defined. */
33
 
#define SPWQ_USE_LOGGING  1
34
 
 
35
 
/* Memory allocation functions used by the implementation.  Note, that
36
 
   the returned value is expected to be freed with
37
 
   spwq_secure_free. */
38
 
#define spwq_malloc(a)         gcry_malloc (a)
39
 
#define spwq_free(a)           gcry_free (a)
40
 
#define spwq_secure_malloc(a)  gcry_malloc_secure (a)
41
 
#define spwq_secure_free(a)    gcry_free (a)
42
 
 
43
 
 
44
 
#endif /*SIMPLE_PWQUERY_IMPLEMENTATION*/ /* End configuration stuff. */
45
 
 
46
 
 
47
 
/* Ask the gpg-agent for a passphrase and present the user with a
48
 
   DESCRIPTION, a PROMPT and optiaonlly with a TRYAGAIN extra text.
49
 
   If a CACHEID is not NULL it is used to locate the passphrase in in
50
 
   the cache and store it under this ID.  If ERRORCODE is not NULL it
51
 
   should point a variable receiving an errorcode; thsi errocode might
52
 
   be 0 if the user canceled the operation.  The function returns NULL
53
 
   to indicate an error. */
54
 
char *simple_pwquery (const char *cacheid, 
55
 
                      const char *tryagain,
56
 
                      const char *prompt,
57
 
                      const char *description,
58
 
                      int *errorcode);
59
 
 
60
 
 
61
 
#define SPWQ_OUT_OF_CORE 1
62
 
#define SPWQ_IO_ERROR 2
63
 
#define SPWQ_PROTOCOL_ERROR 3 
64
 
#define SPWQ_ERR_RESPONSE 4
65
 
#define SPWQ_NO_AGENT 5
66
 
#define SPWQ_SYS_ERROR 6
67
 
#define SPWQ_GENERAL_ERROR 7
68
 
 
69
 
#endif /*SIMPLE_PWQUERY_H*/