540
539
fprintf(stderr, "Establishing TLS session with %s\n", ip);
543
542
gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) tcp_sd);
546
545
ret = gnutls_handshake (session);
547
546
} while(ret == GNUTLS_E_AGAIN or ret == GNUTLS_E_INTERRUPTED);
783
782
{ .name = "debug", .key = 128,
784
783
.doc = "Debug mode", .group = 3 },
785
784
{ .name = "connect", .key = 'c',
787
.doc = "Connect directly to a sepcified mandos server",
785
.arg = "ADDRESS:PORT",
786
.doc = "Connect directly to a specific Mandos server",
789
788
{ .name = "interface", .key = 'i',
791
.doc = "Interface that Avahi will conntect through",
790
.doc = "Interface that will be used to search for Mandos"
793
793
{ .name = "keydir", .key = 'd',
795
.doc = "Directory where the openpgp keyring is",
795
.doc = "Directory to read the OpenPGP key files from",
797
797
{ .name = "seckey", .key = 's',
799
.doc = "Secret openpgp key for gnutls authentication",
799
.doc = "OpenPGP secret key file base name",
801
801
{ .name = "pubkey", .key = 'p',
803
.doc = "Public openpgp key for gnutls authentication",
803
.doc = "OpenPGP public key file base name",
805
805
{ .name = "dh-bits", .key = 129,
807
.doc = "dh-bits to use in gnutls communication",
807
.doc = "Bit length of the prime number used in the"
808
" Diffie-Hellman key exchange",
809
810
{ .name = "priority", .key = 130,
811
.doc = "GNUTLS priority", .group = 1 },
812
.doc = "GnuTLS priority string for the TLS handshake",
816
817
error_t parse_opt (int key, char *arg,
817
818
struct argp_state *state) {
860
861
struct argp argp = { .options = options, .parser = parse_opt,
862
863
.doc = "Mandos client -- Get and decrypt"
863
" passwords from mandos server" };
864
" passwords from a Mandos server" };
864
865
ret = argp_parse (&argp, argc, argv, 0, 0, NULL);
865
866
if (ret == ARGP_ERR_UNKNOWN){
866
867
fprintf(stderr, "Unknown error while parsing arguments\n");
989
990
config.publish_addresses = 0;
990
991
config.publish_workstation = 0;
991
992
config.publish_domain = 0;
993
994
/* Allocate a new server */
994
995
mc.server = avahi_server_new(avahi_simple_poll_get
995
996
(mc.simple_poll), &config, NULL,
998
999
/* Free the Avahi configuration data */
999
1000
avahi_server_config_free(&config);