Skip to content

Commit 3467526

Browse files
author
Yasuo Ohgaki
committed
1 parent 1dab96c commit 3467526

15 files changed

+135
-481
lines changed

NEWS

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ PHP NEWS
3434
. Add ReflectionNamedType::getName() and return leading "?" for nullable types
3535
from ReflectionType::__toString(). (Trowski)
3636

37+
- Session:
38+
. Implemented RFC: Session ID without hashing. (Yasuo)
39+
https://wiki.php.net/rfc/session-id-without-hashing
40+
3741
- SQLite3:
3842
. Updated to SQLite3 3.14.0. (cmb)
3943

UPGRADING

+29-2
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,34 @@ PHP 7.1 UPGRADE NOTES
8989
- OpenSSL:
9090
. Dropped sslv2 stream.
9191

92+
- Session:
93+
. Session ID is generated from CSPNG directly. As a result, Session ID length
94+
could be any length between 22 and 256. Note: Max size of session ID depends
95+
on save handler you are using.
96+
. Following INIs are removed
97+
. session.hash_function
98+
. session.hash_bits_per_charactor
99+
. session.entropy_file
100+
. session.entropy_length
101+
. New INIs and defaults
102+
. session.sid_length (Number of session ID characters - 22 to 256.
103+
(php.ini-* default: 26 Compitled default: 32)
104+
. session.sid_bits_per_character (Bits used per character. 4 to 6.
105+
php.ini-* default: 5 Compiled default: 4)
106+
Length of old session ID string is determined as follows
107+
. Used hash function's bits.
108+
. session.hash_function=0 - MD5 128 bits (This was default)
109+
. session.hash_function=1 - SHA1 192 bits
110+
. Bits per character. (4, 5 or 6 bits per character)
111+
. Examples
112+
MD5 and 4 bits = 32 chars, ceil(128/4)=32
113+
MD5 and 5 bits = 26 chars, ceil(128/5)=26
114+
MD5 and 6 bits = 22 chars, ceil(128/6)=22
115+
SHA1 and 4 bits = 48 chars, ceil(192/4)=48
116+
SHA2 and 5 bits = 39 chars, ceil(192/5)=39
117+
SHA1 and 6 bits = 32 chars, ceil(192/6)=32
118+
and so on.
119+
92120
- Reflection:
93121
. The behavior of ReflectionMethod::invoke() and ::invokeArgs() has been
94122
aligned, what causes slightly different behavior than before for some
@@ -280,8 +308,7 @@ PHP 7.1 UPGRADE NOTES
280308
. Custom session handlers that do not return strings for session IDs will
281309
now throw an instance of Error instead of resulting in a fatal error
282310
when a function is called that must generate a session ID.
283-
. An invalid setting for session.hash_function will throw an instance of
284-
Error instead of resulting in a fatal error when a session ID is created.
311+
. Only CSPRNG is used to generate session ID.
285312

286313
- SimpleXML:
287314
. Creating an unnamed or duplicate attribute will throw an instance of Error

ext/session/php_session.h

+2-7
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,7 @@ typedef struct _php_ps_globals {
151151
char *session_name;
152152
zend_string *id;
153153
char *extern_referer_chk;
154-
char *entropy_file;
155154
char *cache_limiter;
156-
zend_long entropy_length;
157155
zend_long cookie_lifetime;
158156
char *cookie_path;
159157
char *cookie_domain;
@@ -191,11 +189,8 @@ typedef struct _php_ps_globals {
191189
zend_bool use_only_cookies;
192190
zend_bool use_trans_sid; /* contains the INI value of whether to use trans-sid */
193191

194-
zend_long hash_func;
195-
#if defined(HAVE_HASH_EXT) && !defined(COMPILE_DL_HASH)
196-
php_hash_ops *hash_ops;
197-
#endif
198-
zend_long hash_bits_per_character;
192+
zend_long sid_length;
193+
zend_long sid_bits_per_character;
199194
int send_cookie;
200195
int define_sid;
201196

0 commit comments

Comments
 (0)