summaryrefslogtreecommitdiff
path: root/libkeyring/egalg.c
diff options
context:
space:
mode:
authorforsyth <forsyth@vitanuova.com>2009-07-30 19:33:32 +0100
committerforsyth <forsyth@vitanuova.com>2009-07-30 19:33:32 +0100
commit032c0afdfc6ec3ccf93e50f635a1105d69e0a716 (patch)
treea0ebc214dbb4b214d56709185ea4921309263c62 /libkeyring/egalg.c
parentea1a81b6f8df49918483d91781f2791edf95a523 (diff)
20090730-1933
Diffstat (limited to 'libkeyring/egalg.c')
-rw-r--r--libkeyring/egalg.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libkeyring/egalg.c b/libkeyring/egalg.c
index 3a914d0f..0c6b88d1 100644
--- a/libkeyring/egalg.c
+++ b/libkeyring/egalg.c
@@ -24,6 +24,10 @@ eg_str2sk(char *str, char **strp)
eg->secret = base64tobig(p, &p);
if(strp)
*strp = p;
+ if(eg->pub.p == nil || eg->pub.alpha == nil || eg->pub.key == nil || eg->secret == nil){
+ egprivfree(eg);
+ return nil;
+ }
return eg;
}
@@ -39,6 +43,10 @@ eg_str2pk(char *str, char **strp)
eg->key = base64tobig(p, &p);
if(strp)
*strp = p;
+ if(eg->p == nil || eg->alpha == nil || eg->key == nil){
+ egpubfree(eg);
+ return nil;
+ }
return eg;
}
@@ -53,6 +61,10 @@ eg_str2sig(char *str, char **strp)
eg->s = base64tobig(p, &p);
if(strp)
*strp = p;
+ if(eg->r == nil || eg->s == nil){
+ egsigfree(eg);
+ return nil;
+ }
return eg;
}