From fe1a9b27be026ab3625267c08db4022edb5dafc9 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 3 Dec 2019 21:03:46 +0000 Subject: [PATCH] stest: Honour new privkey() hash If set to a path not ending in /, it refers to a key file, and we generate the "rsa-private" call. With the default value, this produces the same path as before. But now it can be set to a directory ending in /, in which case we specify a priv-cache. No functional change yet. Signed-off-by: Ian Jackson --- stest/common.tcl | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/stest/common.tcl b/stest/common.tcl index 328cb01..9a7e38f 100644 --- a/stest/common.tcl +++ b/stest/common.tcl @@ -25,6 +25,9 @@ set extra(inside) { } set extra(outside) {} +set privkey(inside) test-example/inside.key +set privkey(outside) test-example/outside.key + proc mkconf {location site} { global tmp global builddir @@ -32,6 +35,7 @@ proc mkconf {location site} { global ports global extra global netlinkfh + upvar #0 privkey($site) privkey set pipefp $tmp/$site.netlink foreach tr {t r} { file delete $pipefp.$tr @@ -78,8 +82,22 @@ exec cat } append cfg "; local-name \"test-example/$location/$site\"; - local-key rsa-private(\"$builddir/test-example/$site.key\"); " + switch -glob $privkey { + */ { + append cfg " + key-cache priv-cache({ + privkeys \"$builddir/${privkey}priv.\"; + }); +" + } + * { + append cfg " + local-key rsa-private(\"$builddir/$privkey\"); +" + } + } + append cfg $extra($site) append cfg " log logfile { -- 2.30.2