Changeset View
Changeset View
Standalone View
Standalone View
gnupg2-1.9.20/sm/server.c
Context not available. | |||||
set from the command line or config file. We only require those | set from the command line or config file. We only require those | ||||
marked as encrypt-to. */ | marked as encrypt-to. */ | ||||
void | void | ||||
gpgsm_server (certlist_t default_recplist) | gpgsm_server (ctrl_t ctrl, certlist_t default_recplist) | ||||
{ | { | ||||
int rc; | int rc; | ||||
int filedes[2]; | int filedes[2]; | ||||
ASSUAN_CONTEXT ctx; | ASSUAN_CONTEXT ctx; | ||||
struct server_control_s ctrl; | |||||
static const char hello[] = ("GNU Privacy Guard's S/M server " | static const char hello[] = ("GNU Privacy Guard's S/M server " | ||||
VERSION " ready"); | VERSION " ready"); | ||||
memset (&ctrl, 0, sizeof ctrl); | |||||
gpgsm_init_default_ctrl (&ctrl); | |||||
/* For now we use a simple pipe based server so that we can work | /* For now we use a simple pipe based server so that we can work | ||||
from scripts. We will later add options to run as a daemon and | from scripts. We will later add options to run as a daemon and | ||||
wait for requests on a Unix domain socket */ | wait for requests on a Unix domain socket */ | ||||
Context not available. | |||||
assuan_register_output_notify (ctx, output_notify); | assuan_register_output_notify (ctx, output_notify); | ||||
assuan_register_option_handler (ctx, option_handler); | assuan_register_option_handler (ctx, option_handler); | ||||
assuan_set_pointer (ctx, &ctrl); | assuan_set_pointer (ctx, ctrl); | ||||
ctrl.server_local = xcalloc (1, sizeof *ctrl.server_local); | ctrl->server_local = xcalloc (1, sizeof *ctrl->server_local); | ||||
ctrl.server_local->assuan_ctx = ctx; | ctrl->server_local->assuan_ctx = ctx; | ||||
ctrl.server_local->message_fd = -1; | ctrl->server_local->message_fd = -1; | ||||
ctrl.server_local->list_internal = 1; | ctrl->server_local->list_internal = 1; | ||||
ctrl.server_local->list_external = 0; | ctrl->server_local->list_external = 0; | ||||
ctrl.server_local->default_recplist = default_recplist; | ctrl->server_local->default_recplist = default_recplist; | ||||
if (DBG_ASSUAN) | if (DBG_ASSUAN) | ||||
assuan_set_log_stream (ctx, log_get_stream ()); | assuan_set_log_stream (ctx, log_get_stream ()); | ||||
Context not available. | |||||
} | } | ||||
} | } | ||||
gpgsm_release_certlist (ctrl.server_local->recplist); | gpgsm_release_certlist (ctrl->server_local->recplist); | ||||
ctrl.server_local->recplist = NULL; | ctrl->server_local->recplist = NULL; | ||||
gpgsm_release_certlist (ctrl.server_local->signerlist); | gpgsm_release_certlist (ctrl->server_local->signerlist); | ||||
ctrl.server_local->signerlist = NULL; | ctrl->server_local->signerlist = NULL; | ||||
assuan_deinit_server (ctx); | assuan_deinit_server (ctx); | ||||
} | } | ||||
Context not available. |