]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Include the Diaspora GUID string in our XRD metadata
authorMikael Nordfeldth <mmn@hethane.se>
Sat, 6 Jun 2015 12:49:39 +0000 (14:49 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sat, 6 Jun 2015 12:49:39 +0000 (14:49 +0200)
plugins/Diaspora/DiasporaPlugin.php

index ae5fb2f73afbc7e76111b082ab32eff96d22cfb9..66a9759f8787078d984914a803c29a9653c9ec74 100644 (file)
@@ -43,6 +43,11 @@ class DiasporaPlugin extends Plugin
         assert($magicsig->publicKey instanceof Crypt_RSA);
         $xrd->links[] = new XML_XRD_Element_Link(self::REL_PUBLIC_KEY,
                                     base64_encode($magicsig->exportPublicKey()), 'RSA');
+
+        // Instead of choosing a random string, we calculate our GUID from the public key
+        // by fingerprint through a sha256 hash.
+        $xrd->links[] = new XML_XRD_Element_Link(self::REL_GUID,
+                                    strtolower($magicsig->toFingerprint()));
     }
 
     public function onPluginVersion(array &$versions)