We are going to have tests which use the peer-keys site config key,
which refers to external key files from a pubkeys directory. In the
case of stest, these are pubkeys from test-example.
Because secnet may rename files etc. in this directory, we need a
private one per test. So, for each test, when making the config file,
make a copy of the pubkeys directory. Of course this means that
directory needs to exist, so mkdir it (and clean it), although the
machinery for populating it doesn't exist yet.
Also, when copying the sites.conf file, adjust references to
test-example to refer to the copy. (Currently there won't be any such
references.)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
test-example/*.key
test-example/*.privkeys
test-example/*.key
test-example/*.privkeys
test-example/sites.conf
test-example/bogus-setup-request
build-stamp
test-example/sites.conf
test-example/bogus-setup-request
build-stamp
transform eax-serpent { }, serpent256-cbc { };
}
transform eax-serpent { }, serpent256-cbc { };
}
+ set pubkeys $tmp/$site.pubkeys
+ file delete -force $pubkeys
+ exec cp -rl $builddir/test-example/pubkeys $pubkeys
+
set f [open $builddir/test-example/sites.conf r]
set f [open $builddir/test-example/sites.conf 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);
}
set sites [read $f]
close $f
append cfg $sites
append cfg {
sites map(site,all-sites);
}
base64 -d <$< >$@.new && mv -f $@.new $@
&sites.conf: $(src)/make-secnet-sites &^/sites &/Dir.mk
base64 -d <$< >$@.new && mv -f $@.new $@
&sites.conf: $(src)/make-secnet-sites &^/sites &/Dir.mk
$(src)/make-secnet-sites &^/sites $@
$(src)/make-secnet-sites &^/sites $@
+&clean::
+ rm -rf &pubkeys
+
define privkey
&/$1.privkeys/priv.$2: &/$3
mkdir -p $$(dir $$@) && cp $$< $$@.tmp && mv -f $$@.tmp $$@
define privkey
&/$1.privkeys/priv.$2: &/$3
mkdir -p $$(dir $$@) && cp $$< $$@.tmp && mv -f $$@.tmp $$@