X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=stest%2Fcommon.tcl;h=bcca102c49b9db77a143a0930bbb7e0796c37def;hb=90c43c174012d0352b4d05859c82c5993cb10f73;hp=328cb016a6b8b15b3759e5c44c16cd46c3f9547b;hpb=98a99d6c348383fafa223cad17410f8918d28e3c;p=secnet.git diff --git a/stest/common.tcl b/stest/common.tcl index 328cb01..bcca102 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,25 @@ exec cat } append cfg "; local-name \"test-example/$location/$site\"; - local-key rsa-private(\"$builddir/test-example/$site.key\"); " + switch -glob $privkey { + */ { + set sitesconf sites.conf + append cfg " + key-cache priv-cache({ + privkeys \"$builddir/${privkey}priv.\"; + }); +" + } + * { + set sitesconf sites.conf + append cfg " + local-key rsa-private(\"$builddir/$privkey\"); +" + } + } + set sitesconf $builddir/test-example/$sitesconf + append cfg $extra($site) append cfg " log logfile { @@ -101,7 +122,7 @@ exec cat file delete -force $pubkeys exec cp -rl $builddir/test-example/pubkeys $pubkeys - set f [open $builddir/test-example/sites.conf r] + set f [open $sitesconf r] while {[gets $f l] >= 0} { regsub {\"[^\"]*test-example/pubkeys/} $l "\"$pubkeys/" l append cfg $l "\n"