History

20070817-1337

Charles.Forsyth committed 19 years ago

Commit 526ea871 parent 35e45384 files · +16 −8Browse files

Unified · Split

4 files
  1. CHANGES +4 −0
  2. include/version.h +1 −1
  3. libinterp/alt.c +3 −6
  4. libkeyring/rsaalg.c +8 −1
CHANGES+4−0
@@ -1,3 +1,7 @@
1+20070817
2+ two old changes that weren't in the distribution...
3+ libkeyring/rsaalg.c: previously failed to ensure the output key was the right length (really rsagen should do that)
4+ libinterp/alt.c: use a better random number generator
15 20070814
26 bufio.b didn't update the buffer pointers correctly on write errors
37 20070807
include/version.h+1−1
@@ -1 +1 @@
1−#define VERSION "Fourth Edition (20070814)"
1+#define VERSION "Fourth Edition (20070817)"
libinterp/alt.c+3−6
@@ -268,7 +268,7 @@ xecalt(int block) · 267 unmodified lines
268268 Alt *a;
269269 Prog *p;
270270 int nrdy;
271− static int xrand = -1;
271+ static ulong xrand = 0x20342;
272272
273273 p = currun();
274274
@@ -288,10 +288,7 @@ xecalt(int block) · 13 unmodified lines
288288 return;
289289 }
290290
291− xrand += xrand;
292− if(xrand < 0)
293− xrand ^= 0x88888EEF;
294−
295− altcomm(a, xrand%nrdy);
291+ xrand = xrand*1103515245 + 12345;
292+ altcomm(a, (xrand>>8)%nrdy);
296293 altdone(a, p, nil, -1);
297294 }
libkeyring/rsaalg.c+8−1
@@ -124,7 +124,14 @@ rsa_sk2pk(void *vs) · 123 unmodified lines
124124 static void*
125125 rsa_gen(int len)
126126 {
127− return rsagen(len, 8, 0);
127+ RSApriv *key;
128+
129+ for(;;){
130+ key = rsagen(len, 6, 0);
131+ if(mpsignif(key->pub.n) == len)
132+ return key;
133+ free(key);
134+ }
128135 }
129136
130137 /* generate an rsa secret key with same params as a public key */