rename key files, adjust Makefile targets
authorJohannes Berg <johannes@sipsolutions.net>
Thu, 22 May 2008 15:10:09 +0000 (17:10 +0200)
committerJohannes Berg <johannes@sipsolutions.net>
Thu, 22 May 2008 15:10:09 +0000 (17:10 +0200)
Makefile
dbgen.py
key.priv.pem [moved from test-key.priv.pem with 100% similarity]
key.pub.pem [moved from test-key.pub.pem with 100% similarity]
verify.sh

index 0d82adb..26fa230 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 all:   regulatory.bin verify
 
 
-regulatory.bin:        regulatory.sqlite dbgen.py
+regulatory.bin:        regulatory.sqlite dbgen.py key.priv.pem
        @./dbgen.py
 
 clean:
@@ -14,5 +14,5 @@ regulatory.sqlite: db/*.sql
                sed 's/AUTO_INCREMENT/AUTOINCREMENT/; s/use regulatory;//' < $$i | sqlite3 regulatory.sqlite ;\
        done
 
-verify:        regulatory.sqlite verify.sh
+verify:        regulatory.sqlite verify.sh key.pub.pem
        @./verify.sh
index b08b9a6..6b56505 100755 (executable)
--- a/dbgen.py
+++ b/dbgen.py
@@ -111,7 +111,7 @@ for country in cursor:
     # struct regdb_file_reg_country
     output.write(struct.pack('>ccxxI', str(alpha2[0]), str(alpha2[1]), reg_rules_collections[reg_collection_id]))
 
-key = RSA.load_key('test-key.priv.pem')
+key = RSA.load_key('key.priv.pem')
 hash = sha.new()
 hash.update(output.getvalue())
 sig = key.sign(hash.digest())
similarity index 100%
rename from test-key.priv.pem
rename to key.priv.pem
similarity index 100%
rename from test-key.pub.pem
rename to key.pub.pem
index cdfc492..d9aca10 100755 (executable)
--- a/verify.sh
+++ b/verify.sh
@@ -9,6 +9,6 @@ tmp=$(mktemp)
 tmpdata=$(mktemp)
 dd if="$DBFILE" of="$tmp" bs=1 count=128 skip=$((flen - 128)) 2>/dev/null
 dd if="$DBFILE" of="$tmpdata" bs=1 count=$((flen - 128)) 2>/dev/null
-openssl dgst -sha1 -verify test-key.pub.pem -signature "$tmp" "$tmpdata"
+openssl dgst -sha1 -verify key.pub.pem -signature "$tmp" "$tmpdata"
 rm -f "$tmp"
 rm -f "$tmpdata"