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

  • Committer: Teddy Hogeborn
  • Date: 2015-07-20 03:03:33 UTC
  • Revision ID: teddy@recompile.se-20150720030333-203m2aeblypcsfte
Bug fix for GnuTLS 3: be compatible with old 2048-bit DSA keys.

The mandos-keygen program in Mandos version 1.6.0 and older generated
2048-bit DSA keys, and when GnuTLS uses these it has trouble
connecting using the Mandos default priority string.  This was
previously fixed in Mandos 1.6.2, but the bug reappeared when using
GnuTLS 3, so the default priority string has to change again; this
time also the Mandos client has to change its default, so now the
server and the client should use the same default priority string:

SECURE256:!CTYPE-X.509:+CTYPE-OPENPGP:!RSA:+SIGN-DSA-SHA256

* mandos (main/server_defaults): Changed default priority string.
* mandos-options.xml (/section/para[id="priority_compat"]): Removed.
  (/section/para[id="priority"]): Changed default priority string.
* mandos.conf ([DEFAULT]/priority): - '' -
* mandos.conf.xml (OPTIONS/priority): Refer to the id "priority"
                                      instead of "priority_compat".
* mandos.xml (OPTIONS/--priority): - '' -
* plugins.d/mandos-client.c (main): Changed default priority string.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
/*
3
3
 * Password-prompt - Read a password from the terminal and print it
4
4
 * 
5
 
 * Copyright © 2008-2012 Teddy Hogeborn
6
 
 * Copyright © 2008-2012 Björn Påhlsson
 
5
 * Copyright © 2008-2014 Teddy Hogeborn
 
6
 * Copyright © 2008-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
72
72
/* Needed for conflict resolution */
73
73
const char plymouth_name[] = "plymouthd";
74
74
 
75
 
__attribute__((format (gnu_printf, 2, 3), nonnull(1)))
76
 
int fprintf_plus(FILE *stream, const char *format, ...){
77
 
  va_list ap;
78
 
  va_start (ap, format);
79
 
  
80
 
  TEMP_FAILURE_RETRY(fprintf(stream, "Mandos plugin %s: ",
81
 
                             program_invocation_short_name));
82
 
  return TEMP_FAILURE_RETRY(vfprintf(stream, format, ap));
83
 
}
84
 
 
85
75
/* Function to use when printing errors */
86
76
__attribute__((format (gnu_printf, 3, 4)))
87
77
void error_plus(int status, int errnum, const char *formatstring,
92
82
  
93
83
  va_start(ap, formatstring);
94
84
  ret = vasprintf(&text, formatstring, ap);
95
 
  if (ret == -1){
 
85
  if(ret == -1){
96
86
    fprintf(stderr, "Mandos plugin %s: ",
97
87
            program_invocation_short_name);
98
88
    vfprintf(stderr, formatstring, ap);
222
212
  struct dirent **direntries = NULL;
223
213
  int ret;
224
214
  ret = scandir("/proc", &direntries, is_plymouth, alphasort);
225
 
  if (ret == -1){
 
215
  if(ret == -1){
226
216
    error_plus(1, errno, "scandir");
227
217
  }
228
218
  free(direntries);
313
303
    fprintf(stderr, "Starting %s\n", argv[0]);
314
304
  }
315
305
 
316
 
  if (conflict_detection()){
 
306
  if(conflict_detection()){
317
307
    if(debug){
318
308
      fprintf(stderr, "Stopping %s because of conflict\n", argv[0]);
319
309
    }