Skip to content

Commit 02f5061

Browse files
committed
fix test encrypt()
1 parent 9dff24a commit 02f5061

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/WebPush.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ private function encrypt($userPublicKey, $payload)
209209

210210
// encrypt
211211
$iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-128-gcm'));
212-
if (!$this->nativePayloadEncryptionSupport) {
212+
if (!$this->nativePayloadEncryptionSupport && $this->payloadEncryptionSupport) {
213213
list($encryptedText, $tag) = \Jose\Util\GCM::encrypt($encryptionKey, $iv, $payload, "");
214214
$cipherText = $encryptedText.$tag;
215215
} else {

0 commit comments

Comments
 (0)