aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2016-12-01 18:12:18 -0800
committerzotlabs <mike@macgirvin.com>2016-12-01 18:12:18 -0800
commite793fc9973a763b14f1f6cddb425cd5c41aa799c (patch)
tree48c15d75804e554052e0fbd4cc9b99123c79691e
parent73876e5774e1581e2b85c349705b0c7b61d6c9ee (diff)
downloadvolse-hubzilla-e793fc9973a763b14f1f6cddb425cd5c41aa799c.tar.gz
volse-hubzilla-e793fc9973a763b14f1f6cddb425cd5c41aa799c.tar.bz2
volse-hubzilla-e793fc9973a763b14f1f6cddb425cd5c41aa799c.zip
trim iv in STD_encapsulate
-rw-r--r--Zotlabs/Access/Permissions.php1
-rw-r--r--include/crypto.php2
2 files changed, 3 insertions, 0 deletions
diff --git a/Zotlabs/Access/Permissions.php b/Zotlabs/Access/Permissions.php
index ed21ab99d..43baa6cf7 100644
--- a/Zotlabs/Access/Permissions.php
+++ b/Zotlabs/Access/Permissions.php
@@ -35,6 +35,7 @@ class Permissions {
*/
static public function version() {
+ // This must match the version in PermissionRoles.php before permission updates can run.
return 1;
}
diff --git a/include/crypto.php b/include/crypto.php
index 4b78bb63d..df4347f22 100644
--- a/include/crypto.php
+++ b/include/crypto.php
@@ -67,11 +67,13 @@ function AES128CBC_decrypt($data,$key,$iv) {
function STD_encrypt($data,$key,$iv) {
$key = substr($key,0,32);
+ $iv = substr($iv,0,16);
return openssl_encrypt($data,'aes-256-cbc',str_pad($key,32,"\0"),OPENSSL_RAW_DATA,str_pad($iv,16,"\0"));
}
function STD_decrypt($data,$key,$iv) {
$key = substr($key,0,32);
+ $iv = substr($iv,0,16);
return openssl_decrypt($data,'aes-256-cbc',str_pad($key,32,"\0"),OPENSSL_RAW_DATA,str_pad($iv,16,"\0"));
}