diff --git a/README.md b/README.md index 9b1c06b..2e9c09b 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Help me out for a couple of :beers:! [![Latest Stable Version](https://poser.pugx.org/Spomky-Labs/php-aes-gcm/v/stable.png)](https://packagist.org/packages/Spomky-Labs/php-aes-gcm) [![Total Downloads](https://poser.pugx.org/Spomky-Labs/php-aes-gcm/downloads.png)](https://packagist.org/packages/Spomky-Labs/php-aes-gcm) [![Latest Unstable Version](https://poser.pugx.org/Spomky-Labs/php-aes-gcm/v/unstable.png)](https://packagist.org/packages/Spomky-Labs/php-aes-gcm) -[![License](https://poser.pugx.org/Spomky-Labs/php-aes-gcm/license.png)](https://packagist.org/packages/Spomky-Labs/php-aes-gcm) +[![License](https://poser.pugx.org/Spomky-Labs/php-aes-gcm/license.png)](https://packagist.org/packages/Spomky-Labs/php-aes-gcm) [![GuardRails badge](https://badges.production.guardrails.io/Spomky-Labs/php-aes-gcm.svg)](https://www.guardrails.io) # The Release Process diff --git a/src/AESGCM.php b/src/AESGCM.php index ce7a7d7..7b7b1c5 100644 --- a/src/AESGCM.php +++ b/src/AESGCM.php @@ -192,7 +192,7 @@ public static function decryptWithAppendedTag($K, $IV, $Ciphertext = null, $A = private static function decryptWithPHP71($K, $key_length, $IV, $C, $A, $T) { $mode = 'aes-'.($key_length).'-gcm'; - $P = openssl_decrypt(null === $C ? '' : $C, $mode, $K, OPENSSL_RAW_DATA, $IV, $T, $A); + $P = openssl_decrypt(null === $C ? '' : $C, $mode, $K, OPENSSL_RAW_DATA, $IV, $T, null === $A ? '' : $A); Assertion::true(false !== $P, 'Unable to decrypt or to verify the tag.'); return $P;