From 192fd885d5a5cf0f939e47f557a2d53d0cc52d3e Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Wed, 4 Sep 2024 17:16:57 +0200 Subject: [PATCH] Return null in derivePublicKey if privateKey is null (#10882) --- libs/common/src/platform/services/crypto.service.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/common/src/platform/services/crypto.service.ts b/libs/common/src/platform/services/crypto.service.ts index e6860dadf3..8ce2b5e1a0 100644 --- a/libs/common/src/platform/services/crypto.service.ts +++ b/libs/common/src/platform/services/crypto.service.ts @@ -945,6 +945,10 @@ export class CryptoService implements CryptoServiceAbstraction { } private async derivePublicKey(privateKey: UserPrivateKey) { + if (privateKey == null) { + return null; + } + return (await this.cryptoFunctionService.rsaExtractPublicKey(privateKey)) as UserPublicKey; }