aboutsummaryrefslogtreecommitdiffstats
path: root/include/import.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/import.php')
-rw-r--r--include/import.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/import.php b/include/import.php
index 291dd2638..7dac518f5 100644
--- a/include/import.php
+++ b/include/import.php
@@ -80,6 +80,12 @@ function import_channel($channel, $account_id, $seize, $newname = '') {
}
}
+ if (empty($channel['channel_epubkey']) && empty($channel['channel_eprvkey'])) {
+ $eckey = sodium_crypto_sign_keypair();
+ $channel['channel_epubkey'] = sodium_bin2base64(sodium_crypto_sign_publickey($eckey), SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING);
+ $channel['channel_eprvkey'] = sodium_bin2base64(sodium_crypto_sign_secretkey($eckey), SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING);
+ }
+
unset($channel['channel_id']);
$channel['channel_account_id'] = $account_id;
$channel['channel_primary'] = (($seize) ? 1 : 0);