diff options
author | Friendika <info@friendika.com> | 2011-09-19 21:24:16 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-09-19 21:24:16 -0700 |
commit | d653d922b117cb123268e0b7f7b584e86482f5a7 (patch) | |
tree | afacbf2d29130d55d934531b40fa21c34af646c3 /mod/dfrn_notify.php | |
parent | 660787916ef33e8efc6d03ad1f74e1c74eb7feaf (diff) | |
download | volse-hubzilla-d653d922b117cb123268e0b7f7b584e86482f5a7.tar.gz volse-hubzilla-d653d922b117cb123268e0b7f7b584e86482f5a7.tar.bz2 volse-hubzilla-d653d922b117cb123268e0b7f7b584e86482f5a7.zip |
sorting through key issue
Diffstat (limited to 'mod/dfrn_notify.php')
-rw-r--r-- | mod/dfrn_notify.php | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index bd665c208..870e4f2fb 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -841,18 +841,18 @@ function dfrn_notify_content(&$a) { $encrypted_id = ''; $id_str = $my_id . '.' . mt_rand(1000,9999); - if(strlen($r[0]['prvkey']) || strlen($r[0]['pubkey'])) { - if(($r[0]['duplex']) || (! strlen($r[0]['pubkey']))) { - openssl_private_encrypt($hash,$challenge,$r[0]['prvkey']); - openssl_private_encrypt($id_str,$encrypted_id,$r[0]['prvkey']); - } - else { - openssl_public_encrypt($hash,$challenge,$r[0]['pubkey']); - openssl_public_encrypt($id_str,$encrypted_id,$r[0]['pubkey']); - } + $prv_key = trim($r[0]['prvkey']); + $pub_key = trim($r[0]['pubkey']); + $dplx = intval($r[0]['duplex']); + + 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 { + openssl_public_encrypt($hash,$challenge,$pub_key); + openssl_public_encrypt($id_str,$encrypted_id,$pub_key); } - else - $status = 1; $challenge = bin2hex($challenge); $encrypted_id = bin2hex($encrypted_id); |