/mandos/release

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

« back to all changes in this revision

Viewing changes to dracut-module/password-agent.c

  • Committer: teddy at recompile
  • Date: 2020-02-09 03:54:46 UTC
  • mto: This revision was merged to the branch mainline in revision 396.
  • Revision ID: teddy@recompile.se-20200209035446-kud6h0l6u30lo10h
Makefile: fix targets run-server & run-client with GnuTLS 3.5.9

* Makefile (keydir/tls-privkey.pem keydir/tls-pubkey.pem): If the TLS
  session keys were not generated by mandos-keygen (which will happen
  with GnuTLS version 3.5.9 or older), create dummy empty unused files
  to avoid confusing make(1), which would otherwise re-run this target
  and create new OpenPGP key files which would not match the key
  fingerprint in the confdir/clients.conf file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
/*
3
3
 * Mandos password agent - Simple password agent to run Mandos client
4
4
 *
5
 
 * Copyright © 2019-2020 Teddy Hogeborn
6
 
 * Copyright © 2019-2020 Björn Påhlsson
 
5
 * Copyright © 2019 Teddy Hogeborn
 
6
 * Copyright © 2019 Björn Påhlsson
7
7
 * 
8
8
 * This file is part of Mandos.
9
9
 * 
868
868
  }
869
869
  close(pipefds[1]);
870
870
 
871
 
  if(pid == -1){
872
 
    error(0, errno, "Failed to fork()");
873
 
    close(pipefds[0]);
874
 
    return false;
875
 
  }
876
 
 
877
871
  if(not add_to_queue(queue, (task_context){
878
872
        .func=wait_for_mandos_client_exit,
879
873
        .pid=pid,
1193
1187
  bool *const password_is_read = task.password_is_read;
1194
1188
 
1195
1189
  /* We use the GLib "Key-value file parser" functions to parse the
1196
 
     question file.  See <https://systemd.io/PASSWORD_AGENTS/> for
1197
 
     specification of contents */
 
1190
     question file.  See <https://www.freedesktop.org/wiki/Software
 
1191
     /systemd/PasswordAgents/> for specification of contents */
1198
1192
  __attribute__((nonnull))
1199
1193
    void cleanup_g_key_file(GKeyFile **key_file){
1200
1194
    if(*key_file != NULL){
1490
1484
         not. You may but don't have to include a final NUL byte in
1491
1485
         your message.
1492
1486
 
1493
 
         — <https://systemd.io/PASSWORD_AGENTS/> (Tue, 15 Sep 2020
1494
 
         14:24:20 GMT)
 
1487
         — <https://www.freedesktop.org/wiki/Software/systemd/
 
1488
         PasswordAgents/> (Wed 08 Oct 2014 02:14:28 AM UTC)
1495
1489
      */
1496
1490
      send_buffer[0] = '+';     /* Prefix with "+" */
1497
1491
      /* Always add an extra NUL */
2196
2190
    }
2197
2191
    exit(EXIT_SUCCESS);
2198
2192
  }
2199
 
  if(pid == -1){
2200
 
    error(EXIT_FAILURE, errno, "Failed to fork()");
2201
 
  }
2202
 
 
2203
2193
  int status;
2204
2194
  waitpid(pid, &status, 0);
2205
2195
  if(WIFEXITED(status) and (WEXITSTATUS(status) == EXIT_SUCCESS)){
5958
5948
                                           test_fixture *fixture,
5959
5949
                                           __attribute__((unused))
5960
5950
                                           gconstpointer user_data){
5961
 
#ifndef __amd64__
5962
 
  g_test_skip("Skipping EMSGSIZE test on non-AMD64 platform");
5963
 
#else
5964
5951
  __attribute__((cleanup(cleanup_close)))
5965
5952
    const int epoll_fd = epoll_create1(EPOLL_CLOEXEC);
5966
5953
  g_assert_cmpint(epoll_fd, >=, 0);
6019
6006
  g_assert_cmpuint((unsigned int)queue->length, ==, 0);
6020
6007
  g_assert_true(string_set_contains(cancelled_filenames,
6021
6008
                                    question_filename));
6022
 
#endif
6023
6009
}
6024
6010
 
6025
6011
static void test_send_password_to_socket_retry(__attribute__((unused))