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 @@
120070817
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
120070814520070814
2 bufio.b didn't update the buffer pointers correctly on write errors6 bufio.b didn't update the buffer pointers correctly on write errors
320070807720070807
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
268 Alt *a;268 Alt *a;
269 Prog *p;269 Prog *p;
270 int nrdy;270 int nrdy;
271 static int xrand = -1;271 static ulong xrand = 0x20342;
272 272
273 p = currun();273 p = currun();
274 274
@@ -288,10 +288,7 @@ xecalt(int block) · 13 unmodified lines
288 return;288 return;
289 }289 }
290 290
291 xrand += xrand;291 xrand = xrand*1103515245 + 12345;
292 if(xrand < 0)292 altcomm(a, (xrand>>8)%nrdy);
293 xrand ^= 0x88888EEF;
294
295 altcomm(a, xrand%nrdy);
296 altdone(a, p, nil, -1);293 altdone(a, p, nil, -1);
297}294}
libkeyring/rsaalg.c+8−1
@@ -124,7 +124,14 @@ rsa_sk2pk(void *vs) · 123 unmodified lines
124static void*124static void*
125rsa_gen(int len)125rsa_gen(int len)
126{126{
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 }
128}135}
129 136
130/* generate an rsa secret key with same params as a public key */137/* generate an rsa secret key with same params as a public key */