ed25519_cert.trunnel 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. struct ed25519_cert {
  2. u8 version IN [1];
  3. u8 cert_type;
  4. u32 exp_field;
  5. u8 cert_key_type;
  6. u8 certified_key[32];
  7. u8 n_extensions;
  8. struct ed25519_cert_extension ext[n_extensions];
  9. u8 signature[64];
  10. }
  11. const CERTEXT_SIGNED_WITH_KEY = 4;
  12. const CERTEXT_FLAG_AFFECTS_VALIDATION = 1;
  13. struct ed25519_cert_extension {
  14. u16 ext_length;
  15. u8 ext_type;
  16. u8 ext_flags;
  17. union un[ext_type] with length ext_length {
  18. CERTEXT_SIGNED_WITH_KEY : u8 signing_key[32];
  19. default: u8 unparsed[];
  20. };
  21. }
  22. /*
  23. struct cert_revocation {
  24. u8 prefix[8];
  25. u8 version IN [1];
  26. u8 keytype;
  27. u8 identity_key[32];
  28. u8 revoked_key[32];
  29. u64 published;
  30. u8 n_extensions;
  31. struct cert_extension ext[n_extensions];
  32. u8 signature[64];
  33. }
  34. struct crosscert_ed_rsa {
  35. u8 ed_key[32];
  36. u32 expiration_date;
  37. u8 signature[128];
  38. }
  39. struct auth02_cell {
  40. u8 type[8];
  41. u8 cid[32];
  42. u8 sid[32];
  43. u8 cid_ed[32];
  44. u8 sid_ed[32];
  45. u8 slog[32];
  46. u8 clog[32];
  47. u8 scert[32];
  48. u8 tlssecrets[32];
  49. u8 rand[24];
  50. u8 sig[64];
  51. }
  52. const LS_IPV4 = 0x00;
  53. const LS_IPV6 = 0x01;
  54. const LS_LEGACY_ID = 0x02;
  55. const LS_ED25519_ID = 0x03;
  56. // amended from tor.trunnel
  57. struct link_specifier {
  58. u8 ls_type;
  59. u8 ls_len;
  60. union un[ls_type] with length ls_len {
  61. LS_IPV4: u32 ipv4_addr; u16 ipv4_port;
  62. LS_IPV6: u8 ipv6_addr[16]; u16 ipv6_port;
  63. LS_LEGACY_ID: u8 legacy_id[20];
  64. LS_ED25519_ID: u8 ed25519_id[32];
  65. default: u8 unrecognized[];
  66. };
  67. }
  68. */