chiark / gitweb /
stest: New `hashclosure' variable
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 1 Jan 2020 23:46:02 +0000 (23:46 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 1 Jan 2020 23:48:13 +0000 (23:48 +0000)
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 <ijackson@chiark.greenend.org.uk>
stest/common.tcl

index 8897bd90da340a99b4529b65e736691673c7cbb9..5d4518302f407afd617cef387a3f3ff64acb5ff7 100644 (file)
@@ -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"
     }