cell_introduce1.trunnel 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * This contains the definition of the INTRODUCE1 and INTRODUCE_ACK cell for
  3. * onion service version 3 and onward. The following format is specified in
  4. * proposal 224 section 3.2.
  5. */
  6. /* From cell_common.trunnel. */
  7. extern struct trn_cell_extension;
  8. /* From ed25519_cert.trunnel. */
  9. extern struct link_specifier;
  10. const TRUNNEL_SHA1_LEN = 20;
  11. const TRUNNEL_REND_COOKIE_LEN = 20;
  12. /* INTRODUCE1 payload. See details in section 3.2.1. */
  13. struct trn_cell_introduce1 {
  14. /* Always zeroed. MUST be checked explicitly by the caller. */
  15. u8 legacy_key_id[TRUNNEL_SHA1_LEN];
  16. /* Authentication key material. */
  17. u8 auth_key_type IN [0x00, 0x01, 0x02];
  18. u16 auth_key_len;
  19. u8 auth_key[auth_key_len];
  20. /* Extension(s). Reserved fields. */
  21. struct trn_cell_extension extensions;
  22. /* Variable length, up to the end of cell. */
  23. u8 encrypted[];
  24. };
  25. /* INTRODUCE_ACK payload. See details in section 3.2.2. */
  26. struct trn_cell_introduce_ack {
  27. /* Status of introduction. */
  28. u16 status IN [0x0000, 0x0001, 0x0002];
  29. /* Extension(s). Reserved fields. */
  30. struct trn_cell_extension extensions;
  31. };
  32. /* Encrypted section of the INTRODUCE1/INTRODUCE2 cell. */
  33. struct trn_cell_introduce_encrypted {
  34. /* Rendezvous cookie. */
  35. u8 rend_cookie[TRUNNEL_REND_COOKIE_LEN];
  36. /* Extension(s). Reserved fields. */
  37. struct trn_cell_extension extensions;
  38. /* Onion key material. */
  39. u8 onion_key_type IN [0x01];
  40. u16 onion_key_len;
  41. u8 onion_key[onion_key_len];
  42. /* Link specifiers(s) */
  43. u8 nspec;
  44. struct link_specifier nspecs[nspec];
  45. /* Optional padding. This might be empty or not. */
  46. u8 pad[];
  47. };