Allow keys to be referred to as 'Kname.+id+alg.' (with a trailing dot), since

file completion often produces strings of that form.
This commit is contained in:
Brian Wellington 2000-11-01 00:17:18 +00:00
parent 783055c0a6
commit ed239db49c
2 changed files with 6 additions and 2 deletions

View file

@ -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 <config.h>
@ -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");

View file

@ -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 <config.h>
@ -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");