summary refs log tree commit diff
path: root/synapse/config/key.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-04-30 15:13:14 +0100
committerMark Haines <mark.haines@matrix.org>2015-04-30 15:13:14 +0100
commitc28f1d16f072b22ae34be34d3cbcc8a06e394f6f (patch)
tree0a93ac4a3afdc1e290eef259b66e9acc74361f94 /synapse/config/key.py
parentAllow --enable-registration to be passed on the commandline (diff)
downloadsynapse-c28f1d16f072b22ae34be34d3cbcc8a06e394f6f.tar.xz
Add a random string to the auto generated key id
Diffstat (limited to '')
-rw-r--r--synapse/config/key.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/config/key.py b/synapse/config/key.py
index a63f7d841b..4a18a94775 100644
--- a/synapse/config/key.py
+++ b/synapse/config/key.py
@@ -20,6 +20,7 @@ from syutil.crypto.signing_key import (
     is_signing_algorithm_supported, decode_verify_key_bytes
 )
 from syutil.base64util import decode_base64
+from synapse.util.stringutils import random_string
 
 
 class KeyConfig(Config):
@@ -110,9 +111,10 @@ class KeyConfig(Config):
         signing_key_path = config["signing_key_path"]
         if not os.path.exists(signing_key_path):
             with open(signing_key_path, "w") as signing_key_file:
+                key_id = "a_" + random_string(4)
                 syutil.crypto.signing_key.write_signing_keys(
                     signing_key_file,
-                    (syutil.crypto.signing_key.generate_signing_key("auto"),),
+                    (syutil.crypto.signing_key.generate_signing_key(key_id),),
                 )
         else:
             signing_keys = self.read_file(signing_key_path, "signing_key")