]> git.mxchange.org Git - friendica.git/commitdiff
added 's' keys - salmon keys, small keys, stupid keys, whatever...
authorMike Macgirvin <mike@macgirvin.com>
Tue, 12 Oct 2010 06:22:38 +0000 (23:22 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Tue, 12 Oct 2010 06:22:38 +0000 (23:22 -0700)
boot.php
database.sql
mod/dfrn_confirm.php
mod/register.php
update.php

index 640c0199f026c5e293fa5e801864bc9ee581236b..3f2a2551b800b57262e8fd87a84b4d9039c9523a 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -2,7 +2,7 @@
 
 set_time_limit(0);
 
-define ( 'BUILD_ID' , 1005 );
+define ( 'BUILD_ID' , 1006 );
 
 define ( 'EOL', "<br />\r\n");
 define ( 'ATOM_TIME',  'Y-m-d\TH:i:s\Z' );
index 43d6c0041fa4f5efe674ca7d92376c2027906867..24dd9495d467c866603aadb3e26c8014e770e615 100644 (file)
@@ -349,16 +349,14 @@ CREATE TABLE IF NOT EXISTS `user` (
   `theme` char(255) NOT NULL,
   `pubkey` text NOT NULL,
   `prvkey` text NOT NULL,
-  `verified` tinyint(1) unsigned NOT NULL DEFAULT '0',
-  `blocked` tinyint(1) unsigned NOT NULL DEFAULT '0',
-  `notify-flags` int(11) unsigned NOT NULL DEFAULT '65535',
-  `pwdreset` char(255) NOT NULL,
-  `allow_cid` mediumtext NOT NULL,
-  `allow_gid` mediumtext NOT NULL,
-  `deny_cid` mediumtext NOT NULL,
-  `deny_gid` mediumtext NOT NULL,
-  PRIMARY KEY (`uid`)
-) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
+  `spubkey` text NOT NULL,
+  `sprvkey` text NOT NULL,
+  `verified` tinyint(1) unsigned NOT NULL DEFAULT '0', `blocked`
+  tinyint(1) unsigned NOT NULL DEFAULT '0', `notify-flags` int(11)
+  unsigned NOT NULL DEFAULT '65535', `pwdreset` char(255) NOT NULL,
+  `allow_cid` mediumtext NOT NULL, `allow_gid` mediumtext NOT NULL,
+  `deny_cid` mediumtext NOT NULL, `deny_gid` mediumtext NOT NULL,
+  PRIMARY KEY (`uid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 
 
 CREATE TABLE IF NOT EXISTS `register` (
index dd50e82a0929e7eec285717b4a4459e8e4d01c06..265a62b888c5694701d0a87ced0e12b68986234d 100644 (file)
@@ -290,7 +290,7 @@ function dfrn_confirm_post(&$a) {
                $source_url = hex2bin($_POST['source_url']);
                $aes_key    = $_POST['aes_key'];
                $duplex     = $_POST['duplex'];
-               $version_id = $_POST['dfrn_version'];
+               $version_id = (float) $_POST['dfrn_version'];
 
 
                // If $aes_key is set, both of these items require unpacking from the hex transport encoding.
@@ -483,7 +483,7 @@ function dfrn_confirm_post(&$a) {
                        $res = mail($r[0]['email'], t("Connection accepted at ") . $a->config['sitename'],
                                $email_tpl, 'From: ' . t('Administrator') . '@' . $_SERVER[SERVER_NAME] );
                        if(!$res) {
-                               notice( t("Email notification failed.") . EOL );
+                               // pointless throwing an error here and confusing the person at the other end of the wire.
                        }
                }
                xml_status(0); // Success
index d65c154a851d0bd43f3af6dbdbcdf651f7b2f959..a2cae99617b28d5ab46ba2a541784c4b9c9a253a 100644 (file)
@@ -109,15 +109,31 @@ function register_post(&$a) {
        $pkey = openssl_pkey_get_details($res);
        $pubkey = $pkey["key"];
 
+       $sres=openssl_pkey_new(array(
+               'encrypt_key' => false ));
+
+       // Get private key
+
+       $sprvkey = '';
+
+       openssl_pkey_export($sres, $sprvkey);
+
+       // Get public key
+
+       $spkey = openssl_pkey_get_details($sres);
+       $spubkey = $spkey["key"];
+
        $r = q("INSERT INTO `user` ( `username`, `password`, `email`, `nickname`,
-               `pubkey`, `prvkey`, `verified`, `blocked` )
-               VALUES ( '%s', '%s', '%s', '%s', '%s', '%s', %d, %d )",
+               `pubkey`, `prvkey`, `spubkey`, `sprvkey`, `verified`, `blocked` )
+               VALUES ( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d )",
                dbesc($username),
                dbesc($new_password_encoded),
                dbesc($email),
                dbesc($nickname),
                dbesc($pubkey),
                dbesc($prvkey),
+               dbesc($spubkey),
+               dbesc($sprvkey),
                intval($verified),
                intval($blocked)
                );
index 5d2210107ce8d8d2641f33e22340ff1996ad0987..80ec50bd272e06c272740c33070b6bab51172167 100644 (file)
@@ -33,4 +33,11 @@ function update_1003() {
 
 function update_1004() {
        q("ALTER TABLE `contact` ADD `subhub` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `usehub`");
+}
+
+function update_1005() {
+
+       q("ALTER TABLE `user` ADD `spubkey` TEXT NOT NULL AFTER `prvkey` ,
+               ADD `sprvkey` TEXT NOT NULL AFTER `spubkey`");
+
 }
\ No newline at end of file