Session: Improvements to encryption functionality
authorBrad Jorsch <bjorsch@wikimedia.org>
Fri, 1 Jul 2016 14:44:47 +0000 (10:44 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Fri, 1 Jul 2016 15:08:19 +0000 (11:08 -0400)
commit9634f22207b50364da356f9cd28e42e6753eeee5
treec8936ae68def905f1368f8fa3e1e3c9d4f927c15
parent9c83f632ef1587f4c493f8603c3f627de74894da
Session: Improvements to encryption functionality

* Use CBC mode if CTR is unavailable, since the older method should be
  more commonly supported.
* Apply PKCS7 padding manually when using mcrypt, since mcrypt zero-pads
  instead. This didn't matter for CTR because the effective blocksize is
  1, but it does for CBC. OpenSSL uses PKCS7 padding for CBC mode by
  default, so we don't have to worry about it there.

Bug: T136587
Change-Id: I7290b1a7aa64df70f4ab10eee2080141528c4788
includes/session/Session.php