aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-09-27 06:50:18 -0700
committerFriendika <info@friendika.com>2011-09-27 06:50:18 -0700
commit75af366122fa472c28a4105553646c53ec0a16e7 (patch)
tree27a69031074cfd460073c0ceec797b7cc07c3f5e
parent59525e1e321d4cdac668bfc79dd5de0962ab5f56 (diff)
downloadvolse-hubzilla-75af366122fa472c28a4105553646c53ec0a16e7.tar.gz
volse-hubzilla-75af366122fa472c28a4105553646c53ec0a16e7.tar.bz2
volse-hubzilla-75af366122fa472c28a4105553646c53ec0a16e7.zip
zot/salmon new key format for batch keys
-rw-r--r--mod/hostxrd.php4
-rw-r--r--mod/xrd.php4
-rw-r--r--view/xrd_host.tpl4
-rw-r--r--view/xrd_person.tpl6
4 files changed, 15 insertions, 3 deletions
diff --git a/mod/hostxrd.php b/mod/hostxrd.php
index 1cc18da7a..e057cccad 100644
--- a/mod/hostxrd.php
+++ b/mod/hostxrd.php
@@ -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();
diff --git a/mod/xrd.php b/mod/xrd.php
index dae6e4828..a416a2cf3 100644
--- a/mod/xrd.php
+++ b/mod/xrd.php
@@ -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'])
));
diff --git a/view/xrd_host.tpl b/view/xrd_host.tpl
index ee687ffa9..d27f948ac 100644
--- a/view/xrd_host.tpl
+++ b/view/xrd_host.tpl
@@ -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>
diff --git a/view/xrd_person.tpl b/view/xrd_person.tpl
index 7373499bf..2b5af3d0d 100644
--- a/view/xrd_person.tpl
+++ b/view/xrd_person.tpl
@@ -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>