mirror of
https://github.com/friendica/friendica
synced 2024-11-10 07:42:53 +00:00
sorting through key issue
This commit is contained in:
parent
660787916e
commit
d653d922b1
1 changed files with 11 additions and 11 deletions
|
@ -841,18 +841,18 @@ function dfrn_notify_content(&$a) {
|
||||||
$encrypted_id = '';
|
$encrypted_id = '';
|
||||||
$id_str = $my_id . '.' . mt_rand(1000,9999);
|
$id_str = $my_id . '.' . mt_rand(1000,9999);
|
||||||
|
|
||||||
if(strlen($r[0]['prvkey']) || strlen($r[0]['pubkey'])) {
|
$prv_key = trim($r[0]['prvkey']);
|
||||||
if(($r[0]['duplex']) || (! strlen($r[0]['pubkey']))) {
|
$pub_key = trim($r[0]['pubkey']);
|
||||||
openssl_private_encrypt($hash,$challenge,$r[0]['prvkey']);
|
$dplx = intval($r[0]['duplex']);
|
||||||
openssl_private_encrypt($id_str,$encrypted_id,$r[0]['prvkey']);
|
|
||||||
|
if((($dplx) && (strlen($prv_key))) || ((strlen($prv_key)) && (!(strlen($pub_key))))) {
|
||||||
|
openssl_private_encrypt($hash,$challenge,$prv_key);
|
||||||
|
openssl_private_encrypt($id_str,$encrypted_id,$prv_key);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
openssl_public_encrypt($hash,$challenge,$r[0]['pubkey']);
|
openssl_public_encrypt($hash,$challenge,$pub_key);
|
||||||
openssl_public_encrypt($id_str,$encrypted_id,$r[0]['pubkey']);
|
openssl_public_encrypt($id_str,$encrypted_id,$pub_key);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
$status = 1;
|
|
||||||
|
|
||||||
$challenge = bin2hex($challenge);
|
$challenge = bin2hex($challenge);
|
||||||
$encrypted_id = bin2hex($encrypted_id);
|
$encrypted_id = bin2hex($encrypted_id);
|
||||||
|
|
Loading…
Reference in a new issue