no need to obscure the diaspora signature if we're not obscuring the posts
This commit is contained in:
parent
c9ec4f46b6
commit
f17c1f9694
@ -1523,7 +1523,7 @@ function diaspora_comment($importer,$xml,$msg) {
|
||||
$key = get_config('system','pubkey');
|
||||
$x = array('signer' => $diaspora_handle, 'body' => $text,
|
||||
'signed_text' => $signed_data, 'signature' => base64_encode($author_signature));
|
||||
$datarray['diaspora_meta'] = json_encode(crypto_encapsulate(json_encode($x),$key));
|
||||
$datarray['diaspora_meta'] = json_encode($x);
|
||||
}
|
||||
|
||||
|
||||
@ -2137,7 +2137,7 @@ function diaspora_like($importer,$xml,$msg) {
|
||||
$key = get_config('system','pubkey');
|
||||
$x = array('signer' => $diaspora_handle, 'body' => $text,
|
||||
'signed_text' => $signed_data, 'signature' => base64_encode($author_signature));
|
||||
$arr['diaspora_meta'] = json_encode(crypto_encapsulate(json_encode($x),$key));
|
||||
$arr['diaspora_meta'] = json_encode($x);
|
||||
}
|
||||
|
||||
$x = item_store($arr);
|
||||
|
@ -843,7 +843,7 @@ function get_item_elements($x) {
|
||||
|
||||
$arr['sig'] = (($x['signature']) ? htmlspecialchars($x['signature'], ENT_COMPAT,'UTF-8',false) : '');
|
||||
|
||||
$arr['diaspora_meta'] = (($x['diaspora_signature']) ? json_encode(crypto_encapsulate($x['diaspora_signature'],$key)) : '');
|
||||
$arr['diaspora_meta'] = (($x['diaspora_signature']) ? json_encode($x['diaspora_signature']) : '');
|
||||
$arr['object'] = activity_sanitise($x['object']);
|
||||
$arr['target'] = activity_sanitise($x['target']);
|
||||
|
||||
@ -1155,9 +1155,15 @@ function encode_item($item,$mirror = false) {
|
||||
if($item['term'])
|
||||
$x['tags'] = encode_item_terms($item['term']);
|
||||
|
||||
if($item['diaspora_meta'])
|
||||
$x['diaspora_signature'] = crypto_unencapsulate(json_decode($item['diaspora_meta'],true),$key);
|
||||
|
||||
if($item['diaspora_meta']) {
|
||||
$z = json_decode($item['diaspora_meta'],true);
|
||||
if($z) {
|
||||
if(array_key_exists('iv',$z))
|
||||
$x['diaspora_signature'] = crypto_unencapsulate($z,$key);
|
||||
else
|
||||
$x['diaspora_signature'] = $z;
|
||||
}
|
||||
}
|
||||
logger('encode_item: ' . print_r($x,true), LOGGER_DATA);
|
||||
|
||||
return $x;
|
||||
|
Reference in New Issue
Block a user