Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #17556

Closed (moved)
(moved)
Open
Created Nov 08, 2015 by Trac@tracbot

Doc or implementation error in NTor handshake

Either the docs or the implementation seem to be off for the implementation of the NTor handshake. Specifically, the docs (in Section 5.1.4) state:

verify = H(secret_input, t_verify)

and

auth = H(auth_input, t_mac)

where H(x,t) is defined as HMAC_SHA256 with message x and key t.

Looking into the source code, the implementation of these two is via the function h_tweak. In all cases, h_tweak is called with h_tweak(input, input_length, t_value). However, it then calls the underlying hmac function with the arguments reversed. This has the effect of redefining verify as H(t_verify, secret_input) and auth as H(t_mac, auth_input).

I'm not sure what the security implications of this are, but it is confusing. If there is no difference in the security of the result, it'd obviously be easier to update the docs. Otherwise, the patch to h_tweak should be obvious, but it will make handshakes with previous implementations fail.

Trac:
Username: awick

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking