You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
3.0 KiB

4 years ago
4 years ago
  1. // p≡p Basic API
  2. // Copyleft (c) 2019, p≡p foundation
  3. // this file is under GNU General Public License 3.0
  4. // see LICENSE.txt
  5. // written by Volker Birk
  6. type ISO639_1 extends string size=2 > a-z
  7. type Hex extends string > a-f0-9
  8. type hash extends hex min=16, max=128,
  9. doc="32bit Key ID to SHA512 in hex";
  10. type TID extends binary size=16,
  11. doc="UUID version 4 variant 1";
  12. enum comm_type {
  13. hex unknown 0;
  14. doc > range 0x01 to 0x09: no encryption, 0x0a to 0x0e: nothing reasonable
  15. hex no_encryption 0x01 doc="generic";
  16. hex no_encrypted_channel 0x02;
  17. hex key_not_found 0x03;
  18. hex key_expired 0x04;
  19. hex key_revoked 0x05;
  20. hex key_b0rken 0x06;
  21. hex key_expired_but_confirmed 0x07
  22. doc="NOT with confirmed bit. Just retaining info here in case of renewal.";
  23. hex my_key_not_included 0x09;
  24. hex security_by_obscurity 0x0a;
  25. hex b0rken_crypto 0x0b;
  26. hex key_too_short 0x0c;
  27. hex compromised 0x0e doc="known compromised connection";
  28. hex compromized 0x0e doc="deprecated misspelling";
  29. hex mistrusted 0x0f doc="known mistrusted key";
  30. doc > range 0x10 to 0x3f: unconfirmed encryption
  31. hex unconfirmed_encryption 0x10 doc="generic";
  32. hex OpenPGP_weak_unconfirmed 0x11 doc="RSA 1024 is weak";
  33. hex to_be_checked 0x20 doc="generic";
  34. hex SMIME_unconfirmed 0x21;
  35. hex CMS_unconfirmed 0x22;
  36. hex strong_but_unconfirmed 0x30 doc="generic";
  37. hex OpenPGP_unconfirmed 0x38 doc="key at least 2048 bit RSA or EC";
  38. hex OTR_unconfirmed 0x3a;
  39. doc > range 0x40 to 0x7f: unconfirmed encryption and anonymization
  40. hex unconfirmed_enc_anon 0x40 doc="generic";
  41. hex pEp_unconfirmed 0x7f
  42. hex confirmed 0x80 doc="this bit decides if trust is confirmed";
  43. doc > range 0x81 to 0x8f: reserved
  44. doc > range 0x90 to 0xbf: confirmed encryption
  45. hex confirmed_encryption 0x90 doc="generic";
  46. hex OpenPGP_weak 0x91 doc="RSA 1024 is weak (unused)";
  47. hex to_be_checked_confirmed 0xa0 doc="generic";
  48. hex SMIME 0xa1;
  49. hex CMS 0xa2;
  50. hex strong_encryption 0xb0 doc="generic";
  51. hex OpenPGP 0xb8 doc="key at least 2048 bit RSA or EC";
  52. hex OTR 0xba;
  53. doc > range 0xc0 to 0xff: confirmed encryption and anonymization
  54. hex confirmed_enc_anon 0xc0 doc="generic";
  55. hex pEp 0xff
  56. } // enum comm_type
  57. struct identity {
  58. field string address;
  59. field hash fpr;
  60. field string user_id;
  61. field string username;
  62. field ISO639_1 lang;
  63. flags {
  64. flag not_for_sync 0x0001
  65. doc="don't use this identity for Sync";
  66. flag list 0x0002
  67. doc="identity of list of persons";
  68. doc | the second octet flags are calculated
  69. flag devicegroup 0x0100
  70. doc="identity of a device group member"
  71. }
  72. } // struct Identity