History

20090730-1933

forsyth committed 17 years ago

Commit 329dc891 parent 4c3002e6 files · +42 −1Browse files

Unified · Split

6 files
  1. CHANGES +2 −0
  2. include/version.h +1 −1
  3. libinterp/keyring.c +2 −0
  4. libkeyring/dsaalg.c +13 −0
  5. libkeyring/egalg.c +12 −0
  6. libkeyring/rsaalg.c +12 −0
CHANGES+2−0
@@ -1,3 +1,5 @@
120090730
2 improve the error checking in strtosk and strtopk to help detect mangled or inappropriate keys
120090728320090728
2 emu/port/main.c: put host's working directory name as emuwdir4 emu/port/main.c: put host's working directory name as emuwdir
3 document initial environment variables in emu(1)5 document initial environment variables in emu(1)
include/version.h+1−1
@@ -1 +1 @@
1#define VERSION "Fourth Edition (20090728)"1#define VERSION "Fourth Edition (20090730)"
libinterp/keyring.c+2−0
@@ -177,6 +177,8 @@ base64tobig(char *str, char **strp) · 176 unmodified lines
177 177
178 for(p = str; *p && *p != '\n'; p++)178 for(p = str; *p && *p != '\n'; p++)
179 ;179 ;
180 if(p == str)
181 return nil;
180 n = dec64(hex, sizeof(hex), str, p - str);182 n = dec64(hex, sizeof(hex), str, p - str);
181 b = betomp(hex, n, nil);183 b = betomp(hex, n, nil);
182 if(strp){184 if(strp){
libkeyring/dsaalg.c+13−0
@@ -25,6 +25,11 @@ dsa_str2sk(char *str, char **strp) · 24 unmodified lines
25 dsa->secret = base64tobig(p, &p);25 dsa->secret = base64tobig(p, &p);
26 if(strp)26 if(strp)
27 *strp = p;27 *strp = p;
28 if(dsa->pub.p == nil || dsa->pub.q == nil ||
29 dsa->pub.alpha == nil || dsa->pub.key == nil || dsa->secret == nil){
30 dsaprivfree(dsa);
31 return nil;
32 }
28 return dsa;33 return dsa;
29}34}
30 35
@@ -41,6 +46,10 @@ dsa_str2pk(char *str, char **strp) · 10 unmodified lines
41 dsa->key = base64tobig(p, &p);46 dsa->key = base64tobig(p, &p);
42 if(strp)47 if(strp)
43 *strp = p;48 *strp = p;
49 if(dsa->p == nil || dsa->q == nil || dsa->alpha == nil || dsa->key == nil){
50 dsapubfree(dsa);
51 return nil;
52 }
44 return dsa;53 return dsa;
45}54}
46 55
@@ -55,6 +64,10 @@ dsa_str2sig(char *str, char **strp) · 8 unmodified lines
55 dsa->s = base64tobig(p, &p);64 dsa->s = base64tobig(p, &p);
56 if(strp)65 if(strp)
57 *strp = p;66 *strp = p;
67 if(dsa->r == nil || dsa->s == nil){
68 dsasigfree(dsa);
69 return nil;
70 }
58 return dsa;71 return dsa;
59}72}
60 73
libkeyring/egalg.c+12−0
@@ -24,6 +24,10 @@ eg_str2sk(char *str, char **strp) · 23 unmodified lines
24 eg->secret = base64tobig(p, &p);24 eg->secret = base64tobig(p, &p);
25 if(strp)25 if(strp)
26 *strp = p;26 *strp = p;
27 if(eg->pub.p == nil || eg->pub.alpha == nil || eg->pub.key == nil || eg->secret == nil){
28 egprivfree(eg);
29 return nil;
30 }
27 return eg;31 return eg;
28}32}
29 33
@@ -39,6 +43,10 @@ eg_str2pk(char *str, char **strp) · 9 unmodified lines
39 eg->key = base64tobig(p, &p);43 eg->key = base64tobig(p, &p);
40 if(strp)44 if(strp)
41 *strp = p;45 *strp = p;
46 if(eg->p == nil || eg->alpha == nil || eg->key == nil){
47 egpubfree(eg);
48 return nil;
49 }
42 return eg;50 return eg;
43}51}
44 52
@@ -53,6 +61,10 @@ eg_str2sig(char *str, char **strp) · 8 unmodified lines
53 eg->s = base64tobig(p, &p);61 eg->s = base64tobig(p, &p);
54 if(strp)62 if(strp)
55 *strp = p;63 *strp = p;
64 if(eg->r == nil || eg->s == nil){
65 egsigfree(eg);
66 return nil;
67 }
56 return eg;68 return eg;
57}69}
58 70
libkeyring/rsaalg.c+12−0
@@ -28,6 +28,12 @@ rsa_str2sk(char *str, char **strp) · 27 unmodified lines
28 rsa->c2 = base64tobig(p, &p);28 rsa->c2 = base64tobig(p, &p);
29 if(strp)29 if(strp)
30 *strp = p;30 *strp = p;
31 if(rsa->pub.n == nil || rsa->pub.ek == nil ||
32 rsa->dk == nil || rsa->p == nil || rsa->q == nil ||
33 rsa->kp == nil || rsa->kq == nil || rsa->c2 == nil){
34 rsaprivfree(rsa);
35 return nil;
36 }
31 37
32 return rsa;38 return rsa;
33}39}
@@ -43,6 +49,10 @@ rsa_str2pk(char *str, char **strp) · 9 unmodified lines
43 rsa->ek = base64tobig(p, &p);49 rsa->ek = base64tobig(p, &p);
44 if(strp)50 if(strp)
45 *strp = p;51 *strp = p;
52 if(rsa->n == nil || rsa->ek == nil){
53 rsapubfree(rsa);
54 return nil;
55 }
46 56
47 return rsa;57 return rsa;
48}58}
@@ -54,6 +64,8 @@ rsa_str2sig(char *str, char **strp) · 5 unmodified lines
54 char *p;64 char *p;
55 65
56 rsa = base64tobig(str, &p);66 rsa = base64tobig(str, &p);
67 if(rsa == nil)
68 return nil;
57 if(strp)69 if(strp)
58 *strp = p;70 *strp = p;
59 return rsa;71 return rsa;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t