diff options
author | Friendika <info@friendika.com> | 2011-08-22 04:55:09 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-08-22 04:55:09 -0700 |
commit | 564ade0685470158ac487d9a9f18a21079c729bb (patch) | |
tree | 63cf2d6825d8b1f42be2aca67ceda4a357a72f5e | |
parent | ef99267b947d5ae7bc046013e6542ff895271e16 (diff) | |
download | volse-hubzilla-564ade0685470158ac487d9a9f18a21079c729bb.tar.gz volse-hubzilla-564ade0685470158ac487d9a9f18a21079c729bb.tar.bz2 volse-hubzilla-564ade0685470158ac487d9a9f18a21079c729bb.zip |
store key with contact record
-rw-r--r-- | include/diaspora.php | 7 | ||||
-rw-r--r-- | mod/follow.php | 5 |
2 files changed, 9 insertions, 3 deletions
diff --git a/include/diaspora.php b/include/diaspora.php index 4113e9ce1..f3adc608e 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -77,10 +77,15 @@ EOT; $ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $outer_aes_key, $decrypted_header, MCRYPT_MODE_CBC, $outer_iv); $outer_json = json_encode(array('iv' => $b_outer_iv,'key' => $b_outer_aes_key)); + $encrypted_outer_key_bundle = ''; openssl_public_encrypt($outer_json,$encrypted_outer_key_bundle,$pubkey); - + + logger('outer_bundle_encrypt: ' . openssl_error_string()); $b64_encrypted_outer_key_bundle = base64_encode($encrypted_outer_key_bundle); + + logger('outer_bundle: ' . $b64_encrypted_outer_key_bundle . ' key: ' . $pubkey); + $encrypted_header_json_object = json_encode(array('aes_key' => base64_encode($encrypted_outer_key_bundle), 'ciphertext' => base64_encode($ciphertext))); $cipher_json = base64_encode($encrypted_header_json_object); diff --git a/mod/follow.php b/mod/follow.php index 009fe4e9a..df4d2e630 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -100,9 +100,9 @@ function follow_post(&$a) { $new_relation = CONTACT_IS_FOLLOWER; // create contact record - $r = q("INSERT INTO `contact` ( `uid`, `created`, `url`, `addr`, `alias`, `notify`, `poll`, `name`, `nick`, `photo`, `network`, `rel`, `priority`, + $r = q("INSERT INTO `contact` ( `uid`, `created`, `url`, `addr`, `alias`, `notify`, `poll`, `name`, `nick`, `photo`, `network`, `pubkey`, `rel`, `priority`, `writable`, `blocked`, `readonly`, `pending` ) - VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, 0, 0, 0 ) ", + VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, 0, 0, 0 ) ", intval(local_user()), dbesc(datetime_convert()), dbesc($ret['url']), @@ -114,6 +114,7 @@ function follow_post(&$a) { dbesc($ret['nick']), dbesc($ret['photo']), dbesc($ret['network']), + dbesc($ret['pubkey']), intval($new_relation), intval($ret['priority']), intval($writeable) |