diff options
author | zotlabs <mike@macgirvin.com> | 2018-11-11 15:12:01 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-11-11 15:12:01 -0800 |
commit | da452decf695ceac249642ec9d12fb724fa547f7 (patch) | |
tree | 2412eadb628d7e24d09b4545a78883cd0e72244c /include/crypto.php | |
parent | c80ac58effdb71fe457daa164053ea57c1513e68 (diff) | |
download | volse-hubzilla-da452decf695ceac249642ec9d12fb724fa547f7.tar.gz volse-hubzilla-da452decf695ceac249642ec9d12fb724fa547f7.tar.bz2 volse-hubzilla-da452decf695ceac249642ec9d12fb724fa547f7.zip |
more z6 debugging
Diffstat (limited to 'include/crypto.php')
-rw-r--r-- | include/crypto.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/crypto.php b/include/crypto.php index 1040ac29b..fc1029e55 100644 --- a/include/crypto.php +++ b/include/crypto.php @@ -225,9 +225,14 @@ function crypto_unencapsulate($data,$prvkey) { if(! $data) return; - $alg = ((array_key_exists('alg',$data)) ? $data['alg'] : 'aes256cbc'); - if($alg === 'aes256cbc') + $alg = ((is_array($data) && array_key_exists('encrypted',$data)) ? $data['alg'] : ''); + if(! $alg) { + return $data; + } + + if($alg === 'aes256cbc') { return aes_unencapsulate($data,$prvkey); + } return other_unencapsulate($data,$prvkey,$alg); |