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/helpers/custom-validators | |
parent | 0667dbaf268e05b5c9d22f662532e86a1233741c (diff) | |
download | PeerTube-5d7cb63ede7c4bba93954c0586f589ad9748d5ea.tar.gz PeerTube-5d7cb63ede7c4bba93954c0586f589ad9748d5ea.tar.zst PeerTube-5d7cb63ede7c4bba93954c0586f589ad9748d5ea.zip |
Add compat with openssl 3
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r-- | server/helpers/custom-validators/activitypub/actor.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/helpers/custom-validators/activitypub/actor.ts b/server/helpers/custom-validators/activitypub/actor.ts index a4b152722..f43c35b23 100644 --- a/server/helpers/custom-validators/activitypub/actor.ts +++ b/server/helpers/custom-validators/activitypub/actor.ts | |||
@@ -41,9 +41,9 @@ function isActorPreferredUsernameValid (preferredUsername: string) { | |||
41 | function isActorPrivateKeyValid (privateKey: string) { | 41 | function isActorPrivateKeyValid (privateKey: string) { |
42 | return exists(privateKey) && | 42 | return exists(privateKey) && |
43 | typeof privateKey === 'string' && | 43 | typeof privateKey === 'string' && |
44 | privateKey.startsWith('-----BEGIN RSA PRIVATE KEY-----') && | 44 | (privateKey.startsWith('-----BEGIN RSA PRIVATE KEY-----') || privateKey.startsWith('-----BEGIN PRIVATE KEY-----')) && |
45 | // Sometimes there is a \n at the end, so just assert the string contains the end mark | 45 | // Sometimes there is a \n at the end, so just assert the string contains the end mark |
46 | privateKey.includes('-----END RSA PRIVATE KEY-----') && | 46 | (privateKey.includes('-----END RSA PRIVATE KEY-----') || privateKey.includes('-----END PRIVATE KEY-----')) && |
47 | validator.isLength(privateKey, CONSTRAINTS_FIELDS.ACTORS.PRIVATE_KEY) | 47 | validator.isLength(privateKey, CONSTRAINTS_FIELDS.ACTORS.PRIVATE_KEY) |
48 | } | 48 | } |
49 | 49 | ||