1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

Add compat with openssl 3

This commit is contained in:
Chocobozzz 2022-07-12 10:54:21 +02:00
parent 0667dbaf26
commit 5d7cb63ede
No known key found for this signature in database
GPG key ID: 583A612D890159BE
6 changed files with 65 additions and 73 deletions

View file

@ -41,9 +41,9 @@ function isActorPreferredUsernameValid (preferredUsername: string) {
function isActorPrivateKeyValid (privateKey: string) {
return exists(privateKey) &&
typeof privateKey === 'string' &&
privateKey.startsWith('-----BEGIN RSA PRIVATE KEY-----') &&
(privateKey.startsWith('-----BEGIN RSA PRIVATE KEY-----') || privateKey.startsWith('-----BEGIN PRIVATE KEY-----')) &&
// Sometimes there is a \n at the end, so just assert the string contains the end mark
privateKey.includes('-----END RSA PRIVATE KEY-----') &&
(privateKey.includes('-----END RSA PRIVATE KEY-----') || privateKey.includes('-----END PRIVATE KEY-----')) &&
validator.isLength(privateKey, CONSTRAINTS_FIELDS.ACTORS.PRIVATE_KEY)
}