]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Diaspora/DiasporaPlugin.php
Include the Diaspora GUID string in our XRD metadata
[quix0rs-gnu-social.git] / 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)