}
set extra(outside) {}
+set privkey(inside) test-example/inside.privkeys/
+set privkey(outside) test-example/outside.privkeys/
+
proc mkconf {location site} {
global tmp
global builddir
global ports
global extra
global netlinkfh
+ upvar #0 privkey($site) privkey
set pipefp $tmp/$site.netlink
foreach tr {t r} {
file delete $pipefp.$tr
"
close $fakeuh
set cfg "
+ hash sha1;
netlink userv-ipif {
name \"netlink\";
userv-path \"$fakeuf\";
}
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-nonego.conf
+ append cfg "
+ local-key rsa-private(\"$builddir/$privkey\");
+"
+ }
+ }
+ set sitesconf $builddir/test-example/$sitesconf
+
append cfg $extra($site)
append cfg "
log logfile {
transform eax-serpent { }, serpent256-cbc { };
}
- set f [open $builddir/test-example/sites.conf r]
+ set pubkeys $tmp/$site.pubkeys
+ file delete -force $pubkeys
+ exec cp -rl $builddir/test-example/pubkeys $pubkeys
+
+ set f [open $sitesconf r]
+ while {[gets $f l] >= 0} {
+ regsub {\"[^\"]*test-example/pubkeys/} $l "\"$pubkeys/" l
+ append cfg $l "\n"
+ }
set sites [read $f]
close $f
append cfg $sites
append cfg {
sites map(site,all-sites);
}
+
return $cfg
}
if {![hbytes length $data]} return
switch -exact $site {
inside {
- puts OK
- finish 0
+ switch -glob $data {
+ 45000054ed9d4000fe0166d9ac12e802ac12e80900* {
+ puts "OK $data"
+ finish 0
+ }
+ * {
+ error "unexpected $site $data"
+ }
+ }
}
outside {
error "inside rx'd!"