X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fdfrn_confirm.php;h=564ae5ca2346a952e4ccf750c30bdd8b43d7012d;hb=b6fe837a643c9c7bb63a5196d4d14c508f3fce55;hp=227d72cbfb14d6cd0ea3ae97ad2c54b76ef9cc59;hpb=83f0807e59b5be288374a825d1e4f75869d515de;p=friendica.git diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index 227d72cbfb..564ae5ca23 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -144,19 +144,12 @@ function dfrn_confirm_post(&$a,$handsfree = null) { * worried about key leakage than anybody cracking it. * */ + require_once('include/crypto.php'); - $res = openssl_pkey_new(array( - 'digest_alg' => 'sha1', - 'private_key_bits' => 4096, - 'encrypt_key' => false ) - ); - - $private_key = ''; - - openssl_pkey_export($res, $private_key); + $res = new_keypair(1024); - $pubkey = openssl_pkey_get_details($res); - $public_key = $pubkey["key"]; + $private_key = $res['prvkey']; + $public_key = $res['pubkey']; // Save the private key. Send them the public key. @@ -507,7 +500,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { ); if($contact && $g && intval($g[0]['def_gid'])) { require_once('include/group.php'); - group_add_member($uid,'',$contact[0]['id'],$g[0]['def_gid']); + group_add_member($uid,'',$contact['id'],$g[0]['def_gid']); } // Let's send our user to the contact editor in case they want to