cell_establish_intro.trunnel 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * This contains the definition of the ESTABLISH_INTRO and INTRO_ESTABLISHED
  3. * cell for onion service version 3 and onward. The following format is
  4. * specified in proposal 224 section 3.1.
  5. */
  6. extern struct trn_cell_extension;
  7. const TRUNNEL_SHA3_256_LEN = 32;
  8. /* ESTABLISH_INTRO payload. See details in section 3.1.1 */
  9. struct trn_cell_establish_intro {
  10. /* Indicate the start of the handshake authentication data. */
  11. @ptr start_cell;
  12. /* Authentication key material. */
  13. u8 auth_key_type IN [0x00, 0x01, 0x02];
  14. u16 auth_key_len;
  15. u8 auth_key[auth_key_len];
  16. /* Extension(s). Reserved fields. */
  17. struct trn_cell_extension extensions;
  18. @ptr end_mac_fields;
  19. /* Handshake MAC. */
  20. u8 handshake_mac[TRUNNEL_SHA3_256_LEN];
  21. /* Signature */
  22. /* Indicate the end of the handshake authentication data. */
  23. @ptr end_sig_fields;
  24. u16 sig_len;
  25. u8 sig[sig_len];
  26. };
  27. /* INTRO_ESTABLISHED payload which is an acknowledge of the ESTABLISH_INTRO
  28. * cell. For legacy node, this payload is empty so the following only applies
  29. * to version >= 3. */
  30. struct trn_cell_intro_established {
  31. /* Extension(s). Reserved fields. */
  32. struct trn_cell_extension extensions;
  33. };