From: Mikael Nordfeldth Date: Sat, 6 Jun 2015 12:46:17 +0000 (+0200) Subject: Diaspora seeds tend to give the key type in 'type' attribute X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=623a7eee5740f7c352d3b569755a6b3828d8699c;p=quix0rs-gnu-social.git Diaspora seeds tend to give the key type in 'type' attribute --- diff --git a/plugins/Diaspora/DiasporaPlugin.php b/plugins/Diaspora/DiasporaPlugin.php index 1490fce7a3..ae5fb2f73a 100644 --- a/plugins/Diaspora/DiasporaPlugin.php +++ b/plugins/Diaspora/DiasporaPlugin.php @@ -38,8 +38,11 @@ class DiasporaPlugin extends Plugin public function onEndAttachPubkeyToUserXRD(Magicsig $magicsig, XML_XRD $xrd, Profile $target) { + // So far we've only handled RSA keys, but it can change in the future, + // so be prepared. And remember to change the statically assigned type attribute below! + assert($magicsig->publicKey instanceof Crypt_RSA); $xrd->links[] = new XML_XRD_Element_Link(self::REL_PUBLIC_KEY, - base64_encode($magicsig->exportPublicKey())); + base64_encode($magicsig->exportPublicKey()), 'RSA'); } public function onPluginVersion(array &$versions)