]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Default of Magicsig keypair toString should be secure
authorMikael Nordfeldth <mmn@hethane.se>
Tue, 3 Jun 2014 10:51:52 +0000 (12:51 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Tue, 3 Jun 2014 10:51:52 +0000 (12:51 +0200)
Prevent crappy coders from leaking private keys.

plugins/OStatus/OStatusPlugin.php
plugins/OStatus/classes/Magicsig.php

index 704b457272ad716e39f9fd18ddcb1058fbcbfdb3..42ee9a43efb86a5299adfff1dfd5249d1e0f4be8 100644 (file)
@@ -1349,7 +1349,7 @@ class OStatusPlugin extends Plugin
 
         if ($magicsig instanceof Magicsig) {
             $xrd->links[] = new XML_XRD_Element_Link(Magicsig::PUBLICKEYREL,
-                                'data:application/magic-public-key,'. $magicsig->toString(false));
+                                'data:application/magic-public-key,'. $magicsig->toString());
         }
 
         // TODO - finalize where the redirect should go on the publisher
index 82ee71055919e8971b3060539fa23247392f2208..2ee52dd347e583cde627ea0e106494dc69b5956b 100644 (file)
@@ -169,10 +169,10 @@ class Magicsig extends Managed_DataObject
     /**
      * Encode the keypair or public key as a string.
      *
-     * @param boolean $full_pair set to false to leave out the private key.
+     * @param boolean $full_pair set to true to include the private key.
      * @return string
      */
-    public function toString($full_pair = true)
+    public function toString($full_pair=false)
     {
         $mod = Magicsig::base64_url_encode($this->publicKey->modulus->toBytes());
         $exp = Magicsig::base64_url_encode($this->publicKey->exponent->toBytes());