aboutsummaryrefslogtreecommitdiffstats
path: root/mod/dfrn_notify.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-08-05 02:57:03 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-08-05 02:57:03 -0700
commit40a06771ff2a22f3801dfe174ca318cf4f67c1b1 (patch)
tree118bb7d76726b68d2155229b8039170e5c500d9e /mod/dfrn_notify.php
parentb294ff63024da5629a0d7b6f66aaa9af6d1dd400 (diff)
downloadvolse-hubzilla-40a06771ff2a22f3801dfe174ca318cf4f67c1b1.tar.gz
volse-hubzilla-40a06771ff2a22f3801dfe174ca318cf4f67c1b1.tar.bz2
volse-hubzilla-40a06771ff2a22f3801dfe174ca318cf4f67c1b1.zip
reciprocal verification on notify, poll
Diffstat (limited to 'mod/dfrn_notify.php')
-rw-r--r--mod/dfrn_notify.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php
index 38756f724..5655977e5 100644
--- a/mod/dfrn_notify.php
+++ b/mod/dfrn_notify.php
@@ -253,7 +253,14 @@ function dfrn_notify_content(&$a) {
openssl_private_encrypt($hash,$challenge,$r[0]['prvkey']);
$challenge = bin2hex($challenge);
- echo '<?xml version="1.0" encoding="UTF-8"?><dfrn_notify><status>' .$status . '</status><dfrn_id>' . $_GET['dfrn_id'] . '</dfrn_id>'
+
+ $encrypted_id = '';
+ $id_str = $_GET['dfrn_id'] . '.' . mt_rand(1000,9999);
+
+ openssl_private_encrypt($id_str,$encrypted_id,$r[0]['prvkey']);
+ $encrypted_id = bin2hex($encrypted_id);
+
+ echo '<?xml version="1.0" encoding="UTF-8"?><dfrn_notify><status>' .$status . '</status><dfrn_id>' . $encrypted_id . '</dfrn_id>'
. '<challenge>' . $challenge . '</challenge></dfrn_notify>' . "\r\n" ;
session_write_close();
exit;