link_handshake.trunnel 1013 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. struct certs_cell {
  2. u8 n_certs;
  3. struct certs_cell_cert certs[n_certs];
  4. }
  5. const CERTTYPE_RSA1024_ID_LINK = 1;
  6. const CERTTYPE_RSA1024_ID_ID = 2;
  7. const CERTTYPE_RSA1024_ID_AUTH = 3;
  8. const CERTTYPE_ED_ID_SIGN = 4;
  9. const CERTTYPE_ED_SIGN_LINK = 5;
  10. const CERTTYPE_ED_SIGN_AUTH = 6;
  11. const CERTTYPE_RSA1024_ID_EDID = 7;
  12. struct certs_cell_cert {
  13. u8 cert_type;
  14. u16 cert_len;
  15. u8 body[cert_len];
  16. }
  17. struct rsa_ed_crosscert {
  18. u8 ed_key[32];
  19. u32 expiration;
  20. @ptr end_of_signed;
  21. u8 sig_len;
  22. u8 sig[sig_len]; // mismatches spec.
  23. }
  24. struct auth_challenge_cell {
  25. u8 challenge[32];
  26. u16 n_methods;
  27. u16 methods[n_methods];
  28. }
  29. context auth_ctx {
  30. u8 is_ed;
  31. }
  32. struct auth1 with context auth_ctx {
  33. u8 type[8];
  34. u8 cid[32];
  35. u8 sid[32];
  36. union u1[auth_ctx.is_ed] {
  37. 0 : ;
  38. 1 : u8 cid_ed[32];
  39. u8 sid_ed[32];
  40. default: fail;
  41. };
  42. u8 slog[32];
  43. u8 clog[32];
  44. u8 scert[32];
  45. u8 tlssecrets[32];
  46. @ptr end_of_fixed_part;
  47. u8 rand[24];
  48. @ptr end_of_signed;
  49. u8 sig[];
  50. }