]> andersk Git - openssh.git/commitdiff
- provos@cvs.openbsd.org 2001/06/22 21:57:59
authormouring <mouring>
Mon, 25 Jun 2001 04:18:59 +0000 (04:18 +0000)
committermouring <mouring>
Mon, 25 Jun 2001 04:18:59 +0000 (04:18 +0000)
     [dh.c]
     increase linebuffer to deal with larger moduli; use rewind instead of
     close/open

ChangeLog
dh.c

index a6f2313ef053c7cda766f06c3cf72fbce0787541..a93a8b92a7cb13269c075b389fc2b5e8424362e7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
      merge authorized_keys2 into authorized_keys.
      authorized_keys2 is used for backward compat.
      (just append authorized_keys2 to authorized_keys).
+   - provos@cvs.openbsd.org 2001/06/22 21:57:59
+     [dh.c]
+     increase linebuffer to deal with larger moduli; use rewind instead of
+     close/open
 
 20010622
  - (stevesk) handle systems without pw_expire and pw_change.
diff --git a/dh.c b/dh.c
index 26deb9fbf0755ab0b8128cbb0eccb18cea47f324..66eb95545b5f8ac7c2dc6997823486220a08fb05 100644 (file)
--- a/dh.c
+++ b/dh.c
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: dh.c,v 1.15 2001/06/22 21:27:07 provos Exp $");
+RCSID("$OpenBSD: dh.c,v 1.16 2001/06/22 21:57:59 provos Exp $");
 
 #include "xmalloc.h"
 
@@ -103,7 +103,7 @@ DH *
 choose_dh(int min, int wantbits, int max)
 {
        FILE *f;
-       char line[1024];
+       char line[2048];
        int best, bestcount, which;
        int linenum;
        struct dhgroup dhg;
@@ -134,18 +134,14 @@ choose_dh(int min, int wantbits, int max)
                if (dhg.size == best)
                        bestcount++;
        }
-       fclose (f);
+       rewind(f);
 
        if (bestcount == 0) {
+               fclose(f);
                log("WARNING: no suitable primes in %s", _PATH_DH_PRIMES);
                return (NULL);
        }
 
-       f = fopen(_PATH_DH_PRIMES, "r");
-       if (!f) {
-               fatal("WARNING: %s disappeared, giving up", _PATH_DH_PRIMES);
-       }
-
        linenum = 0;
        which = arc4random() % bestcount;
        while (fgets(line, sizeof(line), f)) {
This page took 0.101601 seconds and 5 git commands to generate.