/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 plugins.d/plymouth.c

  • Committer: Teddy Hogeborn
  • Date: 2015-03-10 18:03:38 UTC
  • mto: (237.7.304 trunk)
  • mto: This revision was merged to the branch mainline in revision 325.
  • Revision ID: teddy@recompile.se-20150310180338-pcxw6r2qmw9k6br9
Add ":!RSA" to GnuTLS priority string, to disallow non-DHE kx.

If Mandos was somehow made to use a non-ephemeral Diffie-Hellman key
exchange algorithm in the TLS handshake, any saved network traffic
could then be decrypted later if the Mandos client key was obtained.
By default, Mandos uses ephemeral DH key exchanges which does not have
this problem, but a non-ephemeral key exchange algorithm was still
enabled by default.  The simplest solution is to simply turn that off,
which ensures that Mandos will always use ephemeral DH key exchanges.

There is a "PFS" priority string specifier, but we can't use it because:

1. Security-wise, it is a mix between "NORMAL" and "SECURE128" - it
   enables a lot more algorithms than "SECURE256".

2. It is only available since GnuTLS 3.2.4.

Thanks to Andreas Fischer <af@bantuX.org> for reporting this issue.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
/*
3
3
 * Plymouth - Read a password from Plymouth and output it
4
4
 * 
5
 
 * Copyright © 2010-2013 Teddy Hogeborn
6
 
 * Copyright © 2010-2013 Björn Påhlsson
 
5
 * Copyright © 2010-2014 Teddy Hogeborn
 
6
 * Copyright © 2010-2014 Björn Påhlsson
7
7
 * 
8
8
 * This program is free software: you can redistribute it and/or
9
9
 * modify it under the terms of the GNU General Public License as
84
84
  
85
85
  va_start(ap, formatstring);
86
86
  ret = vasprintf(&text, formatstring, ap);
87
 
  if (ret == -1){
 
87
  if(ret == -1){
88
88
    fprintf(stderr, "Mandos plugin %s: ",
89
89
            program_invocation_short_name);
90
90
    vfprintf(stderr, formatstring, ap);
179
179
    int i = 0;
180
180
    for (; argv[i]!=NULL; i++){
181
181
      tmp = realloc(new_argv, sizeof(const char *) * ((size_t)i + 1));
182
 
      if (tmp == NULL){
 
182
      if(tmp == NULL){
183
183
        error_plus(0, errno, "realloc");
184
184
        free(new_argv);
185
185
        _exit(EX_OSERR);
290
290
  if(proc_id == 0){
291
291
    struct dirent **direntries = NULL;
292
292
    ret = scandir("/proc", &direntries, is_plymouth, alphasort);
293
 
    if (ret == -1){
 
293
    if(ret == -1){
294
294
      error_plus(0, errno, "scandir");
295
295
    }
296
 
    if (ret > 0){
 
296
    if(ret > 0){
297
297
      ret = sscanf(direntries[0]->d_name, "%" SCNuMAX, &proc_id);
298
 
      if (ret < 0){
 
298
      if(ret < 0){
299
299
        error_plus(0, errno, "sscanf");
300
300
      }
301
301
    }