~ubuntu-branches/ubuntu/karmic/gnupg2/karmic-updates

« back to all changes in this revision

Viewing changes to scd/scdaemon.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:
5
5
 *
6
6
 * GnuPG is free software; you can redistribute it and/or modify
7
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
 
8
 * the Free Software Foundation; either version 3 of the License, or
9
9
 * (at your option) any later version.
10
10
 *
11
11
 * GnuPG is distributed in the hope that it will be useful,
14
14
 * GNU General Public License for more details.
15
15
 *
16
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
 
17
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
19
18
 */
20
19
 
21
20
#ifndef SCDAEMON_H
26
25
#endif
27
26
#define GPG_ERR_SOURCE_DEFAULT  GPG_ERR_SOURCE_SCD
28
27
#include <gpg-error.h>
29
 
#define map_assuan_err(a) \
30
 
        map_assuan_err_with_source (GPG_ERR_SOURCE_DEFAULT, (a))
31
 
 
32
 
#include <errno.h>
33
28
 
34
29
#include <time.h>
35
30
#include <gcrypt.h>
36
31
#include "../common/util.h"
37
 
#include "../common/errors.h"
38
 
 
39
 
 
40
 
#define MAX_DIGEST_LEN 24 
 
32
#include "../common/sysutils.h"
 
33
 
 
34
/* To convey some special hash algorithms we use algorithm numbers
 
35
   reserved for application use. */
 
36
#ifndef GCRY_MD_USER
 
37
#define GCRY_MD_USER 1024
 
38
#endif
 
39
#define GCRY_MD_USER_TLS_MD5SHA1 (GCRY_MD_USER+1)
 
40
 
 
41
/* Maximum length of a digest.  */
 
42
#define MAX_DIGEST_LEN 36
 
43
 
 
44
 
41
45
 
42
46
/* A large struct name "opt" to keep global flags. */
43
 
struct {
 
47
struct
 
48
{
44
49
  unsigned int debug; /* Debug flags (DBG_foo_VALUE). */
45
50
  int verbose;        /* Verbosity level. */
46
51
  int quiet;          /* Be as quiet as possible. */
82
87
 
83
88
struct server_control_s 
84
89
{
 
90
  /* Private data used to fire up the connection thread.  We use this
 
91
     structure do avoid an extra allocation for just a few bytes. */
 
92
  struct {
 
93
    gnupg_fd_t fd;
 
94
  } thread_startup;
 
95
  
85
96
  /* Local data of the server; used only in command.c. */
86
97
  struct server_local_s *server_local;
87
98
 
102
113
  } in_data;  
103
114
};
104
115
 
105
 
typedef struct server_control_s *CTRL;
106
 
typedef struct server_control_s *ctrl_t;
107
 
typedef struct app_ctx_s *APP;
108
116
typedef struct app_ctx_s *app_t;
109
117
 
110
118
/*-- scdaemon.c --*/
111
119
void scd_exit (int rc);
112
 
void scd_init_default_ctrl (ctrl_t ctrl);
113
120
const char *scd_get_socket_name (void);
114
121
 
115
122
/*-- command.c --*/
116
 
void scd_command_handler (int);
117
 
void send_status_info (CTRL ctrl, const char *keyword, ...);
 
123
void initialize_module_command (void);
 
124
void scd_command_handler (ctrl_t, int);
 
125
void send_status_info (ctrl_t ctrl, const char *keyword, ...)
 
126
     GNUPG_GCC_A_SENTINEL(1);
118
127
void scd_update_reader_status_file (void);
119
128
 
120
129