From 31f82370bfe7b27a785caf1b5de566546f949851 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 1 Jan 2020 23:46:02 +0000 Subject: [PATCH] stest: New `hashclosure' variable This will let us test setting the `hash' key, which controls hashing for algorithms which don't imply the hash. In particular it will let us test things other than the sha1 which we previously hardcoded. Signed-off-by: Ian Jackson --- stest/common.tcl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stest/common.tcl b/stest/common.tcl index 8897bd9..5d45183 100644 --- a/stest/common.tcl +++ b/stest/common.tcl @@ -29,6 +29,7 @@ set privkey(inside) test-example/inside.privkeys/ set privkey(outside) test-example/outside.privkeys/ set initiator inside +set hashclosure sha1 proc sitesconf_hook {l} { return $l } @@ -44,6 +45,7 @@ proc mkconf {location site} { global ports global extra global netlinkfh + global hashclosure upvar #0 privkey($site) privkey set pipefp $tmp/$site.netlink foreach tr {t r} { @@ -67,7 +69,7 @@ exec cat " close $fakeuh set cfg " - hash sha1; + hash $hashclosure; netlink userv-ipif { name \"netlink\"; userv-path \"$fakeuf\"; @@ -145,6 +147,7 @@ exec cat set f [open $sitesconf r] while {[gets $f l] >= 0} { regsub {\"[^\"]*test-example/pubkeys/} $l "\"$pubkeys/" l + regsub {hash sha1;$} $l "hash $hashclosure;" l set l [sitesconf_hook $l] append cfg $l "\n" } -- 2.30.2