aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
Diffstat (limited to 'g10')
-rw-r--r--g10/ChangeLog11
-rw-r--r--g10/hkp.c6
-rw-r--r--g10/keyserver.c9
3 files changed, 26 insertions, 0 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 8ae6963cc..281751960 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,14 @@
+2002-02-19 David Shaw <[email protected]>
+
+ * hkp.c (parse_hkp_index): Catch corruption in HKP index lines
+ (can be caused by broken or malicious keyservers).
+
+ * keyserver.c (keyserver_work): Add KEYSERVER_NOT_SUPPORTED for
+ unsupported actions (say, a keyserver that has no way to search,
+ or a readonly keyserver that has no way to add). Also add a
+ USE_EXTERNAL_HKP define to disable the internal HKP keyserver
+ code.
+
2002-02-14 Werner Koch <[email protected]>
* g10.c: New option --no-use-agent.
diff --git a/g10/hkp.c b/g10/hkp.c
index 77739e765..e1dd5d26d 100644
--- a/g10/hkp.c
+++ b/g10/hkp.c
@@ -337,6 +337,12 @@ parse_hkp_index(IOBUF buffer,char *line)
{
int uidindex=0;
+ if(line==NULL)
+ {
+ uid=m_strdup("Key index corrupted");
+ return ret;
+ }
+
/* All that's left is the user name. Strip off anything
<between brackets> and de-urlencode it. */
diff --git a/g10/keyserver.c b/g10/keyserver.c
index 2dcd098c0..47347e573 100644
--- a/g10/keyserver.c
+++ b/g10/keyserver.c
@@ -538,6 +538,7 @@ keyserver_work(int action,STRLIST list,u32 (*kidlist)[2],int count)
return G10ERR_BAD_URI;
}
+#ifndef USE_EXTERNAL_HKP
/* Use the internal HKP code */
if(strcasecmp(opt.keyserver_scheme,"x-hkp")==0 ||
strcasecmp(opt.keyserver_scheme,"hkp")==0 ||
@@ -563,6 +564,7 @@ keyserver_work(int action,STRLIST list,u32 (*kidlist)[2],int count)
return 0;
}
+#endif
/* It's not the internal HKP code, so try and spawn a handler for it */
@@ -576,6 +578,13 @@ keyserver_work(int action,STRLIST list,u32 (*kidlist)[2],int count)
opt.keyserver_scheme);
break;
+ case KEYSERVER_NOT_SUPPORTED:
+ log_error(_("action \"%s\" not supported with keyserver "
+ "scheme \"%s\"\n"),
+ action==GET?"get":action==SEND?"send":
+ action==SEARCH?"search":"unknown",
+ opt.keyserver_scheme);
+
case KEYSERVER_INTERNAL_ERROR:
default:
log_error(_("keyserver internal error\n"));