Esempio n. 1
0
static struct lshd_config *
make_lshd_config(struct lshd_context *ctx)
{
  NEW(lshd_config, self);
  init_server_config(&self->super, &lshd_config_parser,
		     FILE_LSHD_CONF, ENV_LSHD_CONF);

  self->algorithms = make_algorithms_options(all_symmetric_algorithms());

  self->ctx = ctx;

  /* Default behaviour is to lookup the "ssh" service, and fall back
   * to port 22 if that fails. */
  string_queue_init(&self->ports);
  self->ports_override_config_file = 0;
  object_queue_init(&self->interfaces);
  self->interfaces_override_config_file = 0;

  self->hostkey = NULL;
  self->daemonic = 0;
  self->daemon_flags = 0;

  self->pid_file = NULL;
  self->use_pid_file = -1;
  self->corefile = -1;
  
  return self;
}
Esempio n. 2
0
static struct lsh_writekey_options *
make_lsh_writekey_options(void)
{
  NEW(lsh_writekey_options, self);
  self->file = NULL;
  
  /* We don't need window change tracking. */
  self->tty = make_unix_interact(NULL);
    
  self->label = NULL;
  self->style = -1;

  self->passphrase = NULL;
  self->iterations = 1500;

  self->crypto_algorithms = all_symmetric_algorithms();

  /* NOTE: We don't need any randomness here, as we won't be signing
   * anything. */
  self->signature_algorithms = all_signature_algorithms(NULL);

  /* We use this only for salt and iv generation. */
  self->r = make_bad_random();

  /* A better default would be crypto_cbc(make_des3()) */
  self->crypto = NULL;
  
  return self;
}