diff options
author | zotlabs <mike@macgirvin.com> | 2017-10-08 12:42:54 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-10-08 12:42:54 -0700 |
commit | 5cc6c6c1e97743b208b90f2a05b23196df787f36 (patch) | |
tree | 77b85421af0e0052f5b0ab23fc95abd51bc89728 /include/crypto.php | |
parent | d2e22d8c2f5ee7c0bca1fa63d39a6822582106e8 (diff) | |
parent | 991db280be4c3cbbff4fb1e4dae8f303a487ed3f (diff) | |
download | volse-hubzilla-5cc6c6c1e97743b208b90f2a05b23196df787f36.tar.gz volse-hubzilla-5cc6c6c1e97743b208b90f2a05b23196df787f36.tar.bz2 volse-hubzilla-5cc6c6c1e97743b208b90f2a05b23196df787f36.zip |
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'include/crypto.php')
-rw-r--r-- | include/crypto.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/crypto.php b/include/crypto.php index 6ac3fd732..622add4dc 100644 --- a/include/crypto.php +++ b/include/crypto.php @@ -148,6 +148,7 @@ function other_encapsulate($data,$pubkey,$alg) { // compromised by state actors and evidence is mounting that this has // already happened. + $result = [ 'encrypted' => true ]; $key = openssl_random_pseudo_bytes(256); $iv = openssl_random_pseudo_bytes(256); $result['data'] = base64url_encode($fn($data,$key,$iv),true); @@ -200,6 +201,9 @@ function aes_encapsulate($data,$pubkey) { logger('aes_encapsulate: no key. data: ' . $data); $key = openssl_random_pseudo_bytes(32); $iv = openssl_random_pseudo_bytes(16); + + $result = [ 'encrypted' => true ]; + $result['data'] = base64url_encode(AES256CBC_encrypt($data,$key,$iv),true); // log the offending call so we can track it down if(! openssl_public_encrypt($key,$k,$pubkey)) { |