chiark / gitweb /
Added the ability to override the key alias for specific applications
authorCiaran Gultnieks <ciaran@ciarang.com>
Tue, 4 Jan 2011 22:45:38 +0000 (22:45 +0000)
committerCiaran Gultnieks <ciaran@ciarang.com>
Tue, 4 Jan 2011 22:45:38 +0000 (22:45 +0000)
build.py
config.sample.py

index 3936a0957483519b97f2965d6d6830aacaa0834e..e35b08830b4b6d29917ed38fb13dc465a3ec48c8 100644 (file)
--- a/build.py
+++ b/build.py
@@ -220,9 +220,13 @@ for app in apps:
             # If a collision does occur later, we're going to have to
             # come up with a new alogrithm, AND rename all existing keys
             # in the keystore!
-            m = md5.new()
-            m.update(app['id'])
-            keyalias = m.hexdigest()[:8]
+            if keyaliases.has_key(app['id']):
+                # For this particular app, the key alias is overridden...
+                keyalias = keyaliases[app['id']]
+            else:
+                m = md5.new()
+                m.update(app['id'])
+                keyalias = m.hexdigest()[:8]
             print "Key alias: " + keyalias
 
             # See if we already have a key for this application, and
index 089ed55d84a72d2830e966d18ea5e1a6b7710cf7..50cfb2ef2af72326e8a3a31887deeb809f373267 100644 (file)
@@ -22,7 +22,12 @@ keystorepass = "foo"
 #The password for keys - the same is used for each auto-generated key.
 keypass = "foo2"
 
-#THe distinguished name used for all keys.
+#The distinguished name used for all keys.
 keydname = "CN=Birdman, OU=Cell, O=Alcatraz, L=Alcatraz, S=California, C=US"
-"
+
+#Use this to override the auto-generated key aliases with specific ones
+#for particular applications. Normally, just leave it empty.
+keyaliases = {}
+keyaliases['com.example.app'] = 'example'
+