From ed239db49cbda829bbf273fd1dd18c1a05644393 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Wed, 1 Nov 2000 00:17:18 +0000 Subject: [PATCH] Allow keys to be referred to as 'Kname.+id+alg.' (with a trailing dot), since file completion often produces strings of that form. --- lib/dns/sec/dst/dst_api.c | 4 +++- lib/dns/sec/dst/dst_parse.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/dns/sec/dst/dst_api.c b/lib/dns/sec/dst/dst_api.c index fee784e43a..18094d7509 100644 --- a/lib/dns/sec/dst/dst_api.c +++ b/lib/dns/sec/dst/dst_api.c @@ -19,7 +19,7 @@ /* * Principal Author: Brian Wellington - * $Id: dst_api.c,v 1.64 2000/10/25 04:26:57 marka Exp $ + * $Id: dst_api.c,v 1.65 2000/11/01 00:17:17 bwelling Exp $ */ #include @@ -861,6 +861,8 @@ read_public_key(const char *filename, isc_mem_t *mctx, dst_key_t **keyp) { if (strcmp(filename + strlen(filename) - 8, ".private") == 0) sprintf(newfilename + strlen(filename) - 8, ".key"); + else if (strcmp(filename + strlen(filename) - 1, ".") == 0) + sprintf(newfilename + strlen(filename), "key"); else if (strcmp(filename + strlen(filename) - 4, ".key") != 0) sprintf(newfilename + strlen(filename), ".key"); diff --git a/lib/dns/sec/dst/dst_parse.c b/lib/dns/sec/dst/dst_parse.c index f3ba247cd6..f3f7848193 100644 --- a/lib/dns/sec/dst/dst_parse.c +++ b/lib/dns/sec/dst/dst_parse.c @@ -19,7 +19,7 @@ /* * Principal Author: Brian Wellington - * $Id: dst_parse.c,v 1.25 2000/09/08 14:25:40 bwelling Exp $ + * $Id: dst_parse.c,v 1.26 2000/11/01 00:17:18 bwelling Exp $ */ #include @@ -209,6 +209,8 @@ dst__privstruct_parsefile(dst_key_t *key, const isc_uint16_t id, if (strcmp(filename + strlen(filename) - 4, ".key") == 0) sprintf(newfilename + strlen(filename) - 4, ".private"); + else if (strcmp(filename + strlen(filename) - 1, ".") == 0) + sprintf(newfilename + strlen(filename), "private"); else if (strcmp(filename + strlen(filename) - 8, ".private") != 0) sprintf(newfilename + strlen(filename), ".private");