]> git.mxchange.org Git - friendica.git/commitdiff
federation friday update
authorFriendika <info@friendika.com>
Fri, 16 Sep 2011 00:47:16 +0000 (17:47 -0700)
committerFriendika <info@friendika.com>
Fri, 16 Sep 2011 00:47:16 +0000 (17:47 -0700)
boot.php
include/diaspora.php

index a9cfb7cac0dfbdf953ebab4818bee3a14ac7a477..6ee649230a27d0650819990e161b11e79bf0cbcc 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -7,7 +7,7 @@ require_once('include/text.php');
 require_once("include/pgettext.php");
 
 
-define ( 'FRIENDIKA_VERSION',      '2.2.1103' );
+define ( 'FRIENDIKA_VERSION',      '2.2.1104' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
 define ( 'DB_UPDATE_VERSION',      1087      );
 
index 2145ca56ccc8e54ed137d88c06d535d96afaaf09..4b1cc333bd9f48854291a22fdcaeacd365faf621 100644 (file)
@@ -115,7 +115,7 @@ function diaspora_msg_build($msg,$user,$contact,$prvkey,$pubkey) {
        $outer_iv = random_string(16);
        $b_outer_iv = base64_encode($outer_iv);
        
-       $handle = 'acct:' . $user['nickname'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3);
+       $handle = $user['nickname'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3);
 
        $padded_data = pkcs5_pad($msg,16);
        $inner_encrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $inner_aes_key, $padded_data, MCRYPT_MODE_CBC, $inner_iv);
@@ -126,7 +126,7 @@ function diaspora_msg_build($msg,$user,$contact,$prvkey,$pubkey) {
        $b64url_data = base64url_encode($b64_data);
        $data = str_replace(array("\n","\r"," ","\t"),array('','','',''),$b64url_data);
 
-       $type = 'application/atom+xml';
+       $type = 'application/xml';
        $encoding = 'base64url';
        $alg = 'RSA-SHA256';
 
@@ -140,10 +140,7 @@ $decrypted_header = <<< EOT
 <decrypted_header>
   <iv>$b_inner_iv</iv>
   <aes_key>$b_inner_aes_key</aes_key>
-  <author>
-    <name>{$user['username']}</name>
-    <uri>$handle</uri>
-  </author>
+  <author_id>$handle</author_id>
 </decrypted_header>
 EOT;
 
@@ -204,7 +201,7 @@ function diaspora_decode($importer,$xml) {
        $public = false;
        $basedom = parse_xml_string($xml);
 
-       $children = $basedom->children(NAMESPACE_DIASPORA_PROTOCOL);
+       $children = $basedom->children('https://joindiaspora.com/protocol');
 
        if($children->header) {
                $public = true;
@@ -288,16 +285,6 @@ function diaspora_decode($importer,$xml) {
        // strip whitespace so our data element will return to one big base64 blob
        $data = str_replace(array(" ","\t","\r","\n"),array("","","",""),$base->data);
 
-       // Add back the 60 char linefeeds
-
-       // This completely violates the entire principle of salmon magic signatures,
-       // which was to have a message signing format that was completely ambivalent to linefeeds 
-       // and transport whitespace mangling, and base64 wrapping rules. Guess what? PHP and Ruby 
-       // use different linelengths for base64 output. 
-
-//    $lines = str_split($data,60);
- //   $data = implode("\n",$lines);
-
 
        // stash away some other stuff for later
 
@@ -347,7 +334,7 @@ function diaspora_decode($importer,$xml) {
 
        if(! $verify) {
                logger('mod-diaspora: Message did not verify. Discarding.');
-               http_status_exit(400);
+//             http_status_exit(400);
        }
 
        logger('mod-diaspora: Message verified.');