Skip to content
Snippets Groups Projects
Commit 9b95e870 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[fix] #990 Load a default keypair if none is found

parent cddcf9b6
No related branches found
No related tags found
No related merge requests found
...@@ -110,6 +110,11 @@ function Server (home, memoryOnly, overrideConf) { ...@@ -110,6 +110,11 @@ function Server (home, memoryOnly, overrideConf) {
that.conf[key] = defaultValues[key]; that.conf[key] = defaultValues[key];
} }
}); });
// Default keypair
if (!that.conf.pair || !that.conf.pair.pub || !that.conf.pair.sec) {
// Create a random key
that.conf.pair = keyring.randomKey().json()
}
// Extract key pair // Extract key pair
that.keyPair = keyring.Key(that.conf.pair.pub, that.conf.pair.sec); that.keyPair = keyring.Key(that.conf.pair.pub, that.conf.pair.sec);
that.sign = that.keyPair.sign; that.sign = that.keyPair.sign;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment