File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 13
13
use function is_array ;
14
14
use function is_int ;
15
15
use function is_string ;
16
+ use function strlen ;
16
17
17
18
/**
18
19
* This class provides a layer to persist transient auth data using cookies.
@@ -39,6 +40,11 @@ final class CookieStore implements StoreInterface
39
40
*/
40
41
public const VAL_CRYPTO_ALGO = 'aes-128-gcm ' ;
41
42
43
+ /**
44
+ * @var int
45
+ */
46
+ public const VAL_CRYPTO_TAG_LENGTH_BYTES = 16 ;
47
+
42
48
/**
43
49
* When true, CookieStore will not setState() itself. You will need manually call the method to persist state to storage.
44
50
*/
@@ -123,7 +129,7 @@ public function decrypt(
123
129
$ iv = base64_decode ($ data ['iv ' ], true );
124
130
$ tag = base64_decode ($ data ['tag ' ], true );
125
131
126
- if (! is_string ($ iv ) || ! is_string ($ tag )) {
132
+ if (! is_string ($ iv ) || ! is_string ($ tag ) || self :: VAL_CRYPTO_TAG_LENGTH_BYTES !== strlen ( $ tag ) ) {
127
133
return null ;
128
134
}
129
135
You can’t perform that action at this time.
0 commit comments