]> git.mxchange.org Git - friendica.git/commitdiff
zot/salmon new key format for batch keys
authorFriendika <info@friendika.com>
Tue, 27 Sep 2011 13:50:18 +0000 (06:50 -0700)
committerFriendika <info@friendika.com>
Tue, 27 Sep 2011 13:50:18 +0000 (06:50 -0700)
mod/hostxrd.php
mod/xrd.php
view/xrd_host.tpl
view/xrd_person.tpl

index 1cc18da7a6507eadf1394ac21c5465b4ccd4215d..e057cccad8547155db9eee7ca88e412817779f55 100644 (file)
@@ -1,11 +1,13 @@
 <?php
 
+require_once('include/crypto.php');
+
 function hostxrd_init(&$a) {
        header('Access-Control-Allow-Origin: *');
        header("Content-type: text/xml");
        $tpl = file_get_contents('view/xrd_host.tpl');
        echo str_replace(array(
-               '$zroot','$domain','$zot_post'),array(z_root(),z_path(),z_root() . '/post'),$tpl);
+               '$zroot','$domain','$zot_post','$bigkey'),array(z_root(),z_path(),z_root() . '/post', salmon_key(get_config('system','site_pubkey'))),$tpl);
        session_write_close();
        exit();
 
index dae6e4828b4c49eebedc49705b5fb5b6690e953b..a416a2cf3f3e99a3f9ca49be8db58b5cf277b32d 100644 (file)
@@ -41,6 +41,7 @@ function xrd_init(&$a) {
        $tpl = file_get_contents('view/xrd_person.tpl');
 
        $o = replace_macros($tpl, array(
+               '$nick'        => $r[0]['nickname'],
                '$accturi'     => $uri,
                '$profile_url' => $a->get_baseurl() . '/profile/'       . $r[0]['nickname'],
                '$hcard_url'   => $a->get_baseurl() . '/hcard/'         . $r[0]['nickname'],
@@ -50,7 +51,8 @@ function xrd_init(&$a) {
                '$dspr'        => $dspr,
                '$salmon'      => $a->get_baseurl() . '/salmon/'        . $r[0]['nickname'],
                '$salmen'      => $a->get_baseurl() . '/salmon/'        . $r[0]['nickname'] . '/mention',
-               '$modexp'      => 'data:application/magic-public-key,'  . $salmon_key
+               '$modexp'      => 'data:application/magic-public-key,'  . $salmon_key,
+               '$bigkey'      =>  salmon_key($r[0]['pubkey'])
        ));
 
 
index ee687ffa9d76af40a41315236d61739f1d7906e2..d27f948accea84b1abe8fc2655cfd1466fdebfaa 100644 (file)
@@ -21,5 +21,9 @@
         type="http://purl.org/zot/1.0/accept"
         zot:accept="application/atom+xml" />
 
+       <Property xmlns:mk="http://salmon-protocol.org/ns/magic-key"
+          type="http://salmon-protocol.org/ns/magic-key"
+          mk:key_id="1">$bigkey</Property>
+
 
 </XRD>
index 7373499bf5a1d71032b5e247e0755fbf5e5d3f28..2b5af3d0d2d8aa0c263d5f4322f776d482dd6286 100644 (file)
@@ -5,7 +5,7 @@
        <Alias>$accturi</Alias>
     <Alias>$profile_url</Alias>
  
-    <Link rel="http://purl.org/zot/1.0/post" 
+    <Link rel="http://purl.org/zot/1.0/post/$nick
           href="$zot_post" />
 
     <Property xmlns:zot="http://purl.og/zot/1.0"
@@ -40,4 +40,8 @@
     <Link rel="magic-public-key" 
           href="$modexp" />
  
+       <Property xmlns:mk="http://salmon-protocol.org/ns/magic-key"
+          type="http://salmon-protocol.org/ns/magic-key"
+          mk:key_id="1">$bigkey</Property>
+
 </XRD>