chiark / gitweb /
test-example: Rules for making a privkeys directory
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 2 Dec 2019 13:45:16 +0000 (13:45 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Feb 2020 21:56:52 +0000 (21:56 +0000)
This generates a directory suitable for use with the priv-cache
closure.  Nothing uses it yet.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
.gitignore
stest/Dir.sd.mk
test-example/Dir.sd.mk

index e73be05f789092e0122789aecde51c8adef2960f..a8320c9e79d75b8d662314217044c4fc97c74b6f 100644 (file)
@@ -44,6 +44,7 @@ debian/secnet.substvars
 /build
 
 test-example/*.key
+test-example/*.privkeys
 test-example/sites.conf
 test-example/bogus-setup-request
 build-stamp
index d8191700137a29ca8b22132567ef59fc310e9367..be0a8d9ea9db9be4182ff185f36f77147f8d0cc9 100644 (file)
@@ -7,6 +7,7 @@
 &DEPS += test-example/sites.conf
 &DEPS += test-example/inside.key
 &DEPS += test-example/outside.key
+&DEPS += test-example/all-privkeys
 
 &:include test-common.sd.mk
 
index 30813b207c1725d5fd81a02702f3efb7869f13db..d3eb7d24ddc29f5e1048bbaad102855b7b5617df 100644 (file)
@@ -8,4 +8,14 @@ include common.make
 &sites.conf: $(src)/make-secnet-sites &^/sites &/Dir.mk
        $(src)/make-secnet-sites &^/sites $@
 
+define privkey
+&/$1.privkeys/priv.$2: &/$3
+       mkdir -p $$(dir $$@) && cp $$< $$@.tmp && mv -f $$@.tmp $$@
+&all-privkeys:: &/$1.privkeys/priv.$2
+&clean::
+       rm -rf &/$1.privkeys
+endef
+
+$(eval $(call privkey,outside,0000000000,outside.key))
+
 &CLEAN += *.new