From 5d7cb63ede7c4bba93954c0586f589ad9748d5ea Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 12 Jul 2022 10:54:21 +0200 Subject: Add compat with openssl 3 --- server/helpers/custom-validators/activitypub/actor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/helpers/custom-validators/activitypub') 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) { 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) } -- cgit v1.2.3