Skip to content

Commit f2d07c2

Browse files
committed
fixup! feat(push): Optionally use OAEP padding
1 parent 633683d commit f2d07c2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/Push.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,8 @@ protected function encryptAndSignDelete(Key $userKey, array $device, ?array $ids
10071007
$remainingIds = $ret['remaining'];
10081008
$data = $ret['data'];
10091009

1010-
if (!openssl_public_encrypt(json_encode($data), $encryptedSubject, $device['devicepublickey'], OPENSSL_PKCS1_PADDING)) {
1010+
$padding = $this->appConfig->getAppValueString('push_encryption_padding', 'PKCS1') === 'OAEP' ? OPENSSL_PKCS1_OAEP_PADDING : OPENSSL_PKCS1_PADDING;
1011+
if (!openssl_public_encrypt(json_encode($data), $encryptedSubject, $device['devicepublickey'], $padding)) {
10111012
$this->log->error(openssl_error_string(), ['app' => 'notifications']);
10121013
throw new \InvalidArgumentException('Failed to encrypt message for device');
10131014
}

0 commit comments

Comments
 (0)