[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #31589 [Core Tor/Tor]: hs-v3: Simplify decrypt_desc_layer interface



#31589: hs-v3: Simplify decrypt_desc_layer interface
-----------------------------------------------+---------------------------
 Reporter:  asn                                |          Owner:  (none)
     Type:  defect                             |         Status:
                                               |  needs_review
 Priority:  Medium                             |      Milestone:  Tor:
                                               |  unspecified
Component:  Core Tor/Tor                       |        Version:
 Severity:  Normal                             |     Resolution:
 Keywords:  tor-hs easy refactoring tech-debt  |  Actual Points:
Parent ID:                                     |         Points:
 Reviewer:                                     |        Sponsor:
-----------------------------------------------+---------------------------

Comment (by asn):

 Replying to [comment:4 ltbringer]:
 > `desc` is passed down to `build_secret_key_iv_mac` -> `build_kdf_key` ->
 `build_secret_input`.
 >
 > That means, either we:
 >
 > 1. Remove `desc` and provide `desc->plaintext_data.blinded_pubkey`,
 `desc->subcredential` and `desc->plaintext_data.revision_counter`
 > 2. Ditch encrypted_blob and encrypted_blob_size as arguments and get
 them off desc. (same as you suggest)
 >
 > My limited experience says, it would be neater to just pass `desc` but I
 would like to know why that wasn't your preference as either solutions are
 easy.

 Hello, the reason I suggested the other approach is to be more
 **explicit** on what that function needs, in the sense where if a reader
 reads the function prototype they understand exactly what the function
 needs instead of the amorphous `desc` which could be anything. That said,
 you are right that this would add 3 more arguments to the function...

 I haven't checked your patch yet, FWIW.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/31589#comment:7>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs