diff options
author | Chocobozzz <me@florianbigard.com> | 2022-07-12 10:54:21 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-07-12 12:08:12 +0200 |
commit | 5d7cb63ede7c4bba93954c0586f589ad9748d5ea (patch) | |
tree | 12856de40417d16ebe86c16a9febe7cc9f36091b /server/initializers | |
parent | 0667dbaf268e05b5c9d22f662532e86a1233741c (diff) | |
download | PeerTube-5d7cb63ede7c4bba93954c0586f589ad9748d5ea.tar.gz PeerTube-5d7cb63ede7c4bba93954c0586f589ad9748d5ea.tar.zst PeerTube-5d7cb63ede7c4bba93954c0586f589ad9748d5ea.zip |
Add compat with openssl 3
Diffstat (limited to 'server/initializers')
-rw-r--r-- | server/initializers/migrations/0605-actor-missing-keys.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/server/initializers/migrations/0605-actor-missing-keys.ts b/server/initializers/migrations/0605-actor-missing-keys.ts index 72d9b359d..aa89a500c 100644 --- a/server/initializers/migrations/0605-actor-missing-keys.ts +++ b/server/initializers/migrations/0605-actor-missing-keys.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import * as Sequelize from 'sequelize' | 1 | import * as Sequelize from 'sequelize' |
2 | import { createPrivateKey, getPublicKey } from '../../helpers/core-utils' | 2 | import { generateRSAKeyPairPromise } from '../../helpers/core-utils' |
3 | import { PRIVATE_RSA_KEY_SIZE } from '../constants' | 3 | import { PRIVATE_RSA_KEY_SIZE } from '../constants' |
4 | 4 | ||
5 | async function up (utils: { | 5 | async function up (utils: { |
@@ -15,10 +15,9 @@ async function up (utils: { | |||
15 | const actors = await utils.sequelize.query<any>(query, options) | 15 | const actors = await utils.sequelize.query<any>(query, options) |
16 | 16 | ||
17 | for (const actor of actors) { | 17 | for (const actor of actors) { |
18 | const { key } = await createPrivateKey(PRIVATE_RSA_KEY_SIZE) | 18 | const { privateKey, publicKey } = await generateRSAKeyPairPromise(PRIVATE_RSA_KEY_SIZE) |
19 | const { publicKey } = await getPublicKey(key) | ||
20 | 19 | ||
21 | const queryUpdate = `UPDATE "actor" SET "publicKey" = '${publicKey}', "privateKey" = '${key}' WHERE id = ${actor.id}` | 20 | const queryUpdate = `UPDATE "actor" SET "publicKey" = '${publicKey}', "privateKey" = '${privateKey}' WHERE id = ${actor.id}` |
22 | await utils.sequelize.query(queryUpdate) | 21 | await utils.sequelize.query(queryUpdate) |
23 | } | 22 | } |
24 | } | 23 | } |