/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to plugin-runner.c

  • Committer: Teddy Hogeborn
  • Date: 2019-02-10 08:41:14 UTC
  • Revision ID: teddy@recompile.se-20190210084114-u91mijrxtifvzra5
Bug fix: Only create TLS key with certtool, and read correct key file

* debian/mandos-client.postinst (create_keys): Remove any bad keys
                                               created by 1.8.0-1.
                                               Only create TLS keys if
                                               certtool succeeds.
* debian/mandos.postinst (configure): Remove any bad keys from
                                      clients.conf, and inform the
                                      user if any were found.
* debian/mandos.templates (mandos/removed_bad_key_ids): New message.
* mandos (MandosServer.handle_ipc): Do not trust a key_id with a known
                                    bad key ID.
* mandos-keygen (keygen): Only create TLS keys if certtool succeeds.
  (password): Bug fix: Generate key_id correctly, and only output
              key_id if TLS key exists.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
/*
3
3
 * Mandos plugin runner - Run Mandos plugins
4
4
 *
5
 
 * Copyright © 2008-2017 Teddy Hogeborn
6
 
 * Copyright © 2008-2017 Björn Påhlsson
 
5
 * Copyright © 2008-2018 Teddy Hogeborn
 
6
 * Copyright © 2008-2018 Björn Påhlsson
7
7
 * 
8
8
 * This file is part of Mandos.
9
9
 * 
313
313
__attribute__((nonnull))
314
314
static void free_plugin(plugin *plugin_node){
315
315
  
316
 
  free(plugin_node->name);
317
316
  for(char **arg = plugin_node->argv; *arg != NULL; arg++){
318
317
    free(*arg);
319
318
  }
584
583
      if(arg[0] == '\0'){
585
584
        break;
586
585
      }
 
586
      /* FALLTHROUGH */
587
587
    default:
588
588
      return ARGP_ERR_UNKNOWN;
589
589
    }
1093
1093
    
1094
1094
    new_plugin->pid = pid;
1095
1095
    new_plugin->fd = pipefd[0];
1096
 
    
 
1096
 
 
1097
    if(debug){
 
1098
      fprintf(stderr, "Plugin %s started (PID %" PRIdMAX ")\n",
 
1099
              new_plugin->name, (intmax_t) (new_plugin->pid));
 
1100
    }
 
1101
 
1097
1102
    /* Unblock SIGCHLD so signal handler can be run if this process
1098
1103
       has already completed */
1099
1104
    ret = (int)TEMP_FAILURE_RETRY(sigprocmask(SIG_UNBLOCK,