X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=spec%2Fdfrn2_contact_confirmation.svg;h=81268509d4bdbfc087b4ec279696553941567f57;hb=0e2f4b682580ecf7d5c55044e484b98ea75f2047;hp=bb506a2328efa2f852a624cfb179577d376dbd98;hpb=b067a1114679ebc3dc6132759c511c3ac8b73e49;p=friendica.git diff --git a/spec/dfrn2_contact_confirmation.svg b/spec/dfrn2_contact_confirmation.svg index bb506a2328..81268509d4 100644 --- a/spec/dfrn2_contact_confirmation.svg +++ b/spec/dfrn2_contact_confirmation.svg @@ -1,162 +1 @@ - - - - - - - - - -Friendica - Contact confirmation - - - - -bob@example.com - - - - -karen@karenhompage.com - - -notifications.php - - -notifications_content() ------------------------------------------ -- This is the page where Karen see Bobs friendship request -- the submit form redirects to Karens local dfrn_confirm page -($dfrn_id, $contact_id, $intro_id are submitted) - - -dfrn_confirm.php - - -dfrn_confirm_post() -SCENARIO 1 ( no $_POST['source_url'] available) --------------------------------------------------------------------------------- -- contact data come either form $handsfree (if autoconfirm) or -from $_POST -- get all data about Karen form the user table -[Note: Bob have been issued an ID (contact issue-id) when he first -requested the friendship. Locate Bobs contact record. At this -time, his record will have both pending and blocked set to 1. -There won't be any dfrn_id if this is a network follower, so use -the contact_id instead] -- search for Bob in the contact table by contact_id, dfrn_id and -issued-id not empty (for the uid -> Karens user id) -- if network = dfrn - -> create a new keypair (prvkey & pubkey) and update the -contact -[Note: Generate a key pair for all further communications with -this person. We have a keypair for every contact, and a site key -for unknown people. This provides a means to carry on -relationships with other people any single key is compromised. It -is a robust key. We're much more worried about key leakage -than anybody cracking it.] - -> update Bobs contact record (in the contact table) with the -generated prvkey - -> encrypting the dfrn_id with Karens prvkey (Bob can decrypt it -on the other and with Karens site-pubkey) and add it to the -transmit params. - -> encrypting Karens profile url with Bobs site-pubkey (Bob -can decrypt it with his own private key) and add it to the -transmit params. - -> add the above generated public key to params which -getting transmitted (if $aes_allow -> encrypt the the public key) - -> add duplex state and page-flags to the params - -> send params to Bobs dfrn_confirm page ($res = -post_url($dfrn_confirm,$params); - - -dfrn_confirm_post() -SCENARIO 2 ( $_POST['source_url'] is available) ------------------------------------------------------------------------- -- get all data about Bob from the user table (prvkey and uid form -Bob ) -- decrypt the transmitted source_url (profile url) with Bobs -prvkey -- get data of Karen from contact table by her source_url (and by -her user id) -- decrypt the dfrn_id sent by Karen with Karens site-pubkey -(taken from contact table) -- if possible decrpyt the pubkey sent by Karen with the prvkey of -Bob (taken from user table) -> if this is not possible use the raw -pubkey -- search if the dfrn_id is already present in the contact table (if it -is prensent it is a duplicate) -- update dfrn-id and pubkey for Karens contact entry in the -contact table - - - -> set the relation for the contact and set pending = 0 and -blocked = 0 - - -- update the relationship of the contact Karen --> if duplex delete the issued-id --> set blocked = 0 and pending = 0 - - -send a notification - - -delete the intro of Bob - - -Note: this chart respects only dfrn -contacts and focuses on key exchange -(for other areas it might be very -incomplete) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Friendica - Contact confirmationbob@example.comkaren@karenhompage.comnotifications.phpnotifications_content()------------------------------------------ This is the page where Karen see Bobs friendship request- the submit form redirects to Karens local dfrn_confirm page($dfrn_id, $contact_id, $intro_id are submitted)dfrn_confirm.phpdfrn_confirm_post()SCENARIO 1 ( no $_POST['source_url'] available)--------------------------------------------------------------------------------- contact data come either form $handsfree (if autoconfirm) orfrom $_POST- get all data about Karen form the user table[Note: Bob have been issued an ID (contact issue-id) when he firstrequested the friendship. Locate Bobs contact record. At thistime, his record will have both pending and blocked set to 1.There won't be any dfrn_id if this is a network follower, so usethe contact_id instead]- search for Bob in the contact table by contact_id, dfrn_id andissued-id not empty (for the uid -> Karens user id)- if network = dfrn-> create a new keypair (prvkey & pubkey) and update thecontact[Note: Generate a key pair for all further communications withthis person. We have a keypair for every contact, and a site keyfor unknown people. This provides a means to carry onrelationships with other people any single key is compromised. Itis a robust key. We're much more worried about key leakagethan anybody cracking it.]-> update Bobs contact record (in the contact table) with thegenerated prvkey-> encrypting the dfrn_id with Karens prvkey (Bob can decrypt iton the other and with Karens site-pubkey) and add it to thetransmit params.-> encrypting Karens profile url with Bobs site-pubkey (Bobcan decrypt it with his own private key) and add it to thetransmit params.-> add the above generated public key to params whichgetting transmitted (if $aes_allow -> encrypt the the public key)-> add duplex state and page-flags to the params-> send params to Bobs dfrn_confirm page ($res =Network::post($dfrn_confirm,$params);dfrn_confirm_post()SCENARIO 2 ( $_POST['source_url'] is available)------------------------------------------------------------------------- get all data about Bob from the user table (prvkey and uid formBob )- decrypt the transmitted source_url (profile url) with Bobsprvkey- get data of Karen from contact table by her source_url (and byher user id)- decrypt the dfrn_id sent by Karen with Karens site-pubkey(taken from contact table)- if possible decrpyt the pubkey sent by Karen with the prvkey ofBob (taken from user table) -> if this is not possible use the rawpubkey- search if the dfrn_id is already present in the contact table (if itis prensent it is a duplicate)- update dfrn-id and pubkey for Karens contact entry in thecontact table-> set the relation for the contact and set pending = 0 andblocked = 0- update the relationship of the contact Karen-> if duplex delete the issued-id-> set blocked = 0 and pending = 0send a notificationdelete the intro of BobNote: this chart respects only dfrncontacts and focuses on key exchange(for other areas it might be veryincomplete) \ No newline at end of file