p≡p engine
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.

133 lines
3.5 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
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 Nana Karlstetter and Volker Birk
  6. type ISO639_1 is string size=2 > a-z
  7. type hex is string > a-f0-9
  8. type hash doc="32bit Key ID to SHA512 in hex"
  9. is hex min=16, max=128;
  10. type hash_list doc="sequence of fingerprints of keys"
  11. is list< hash >;
  12. type TID doc="UUID version 4 variant 1"
  13. is binary size=16;
  14. type blob_list is list< blob >;
  15. type identity_list is list< identity >;
  16. type string_list is list< string > ;
  17. type string_pair is pair< string, string >;
  18. // string: text
  19. // int: integer number
  20. // blob: Binary Large Object
  21. // size_t: size in memory
  22. // const:
  23. // identity:
  24. // message:
  25. // rating:
  26. // enc_format:
  27. // hash:
  28. // TID:
  29. enum comm_type {
  30. hex unknown 0;
  31. doc > range 0x01 to 0x09: no encryption, 0x0a to 0x0e: nothing reasonable
  32. hex no_encryption 0x01 doc="generic";
  33. hex no_encrypted_channel 0x02;
  34. hex key_not_found 0x03;
  35. hex key_expired 0x04;
  36. hex key_revoked 0x05;
  37. hex key_b0rken 0x06;
  38. hex key_expired_but_confirmed 0x07
  39. doc="NOT with confirmed bit. Just retaining info here in case of renewal.";
  40. hex my_key_not_included 0x09;
  41. hex security_by_obscurity 0x0a;
  42. hex b0rken_crypto 0x0b;
  43. hex key_too_short 0x0c;
  44. hex compromised 0x0e doc="known compromised connection";
  45. hex compromized 0x0e doc="deprecated misspelling";
  46. hex mistrusted 0x0f doc="known mistrusted key";
  47. doc > range 0x10 to 0x3f: unconfirmed encryption
  48. hex unconfirmed_encryption 0x10 doc="generic";
  49. hex OpenPGP_weak_unconfirmed 0x11 doc="RSA 1024 is weak";
  50. hex to_be_checked 0x20 doc="generic";
  51. hex SMIME_unconfirmed 0x21;
  52. hex CMS_unconfirmed 0x22;
  53. hex strong_but_unconfirmed 0x30 doc="generic";
  54. hex OpenPGP_unconfirmed 0x38 doc="key at least 2048 bit RSA or EC";
  55. hex OTR_unconfirmed 0x3a;
  56. doc > range 0x40 to 0x7f: unconfirmed encryption and anonymization
  57. hex unconfirmed_enc_anon 0x40 doc="generic";
  58. hex pEp_unconfirmed 0x7f
  59. hex confirmed 0x80 doc="this bit decides if trust is confirmed";
  60. doc > range 0x81 to 0x8f: reserved
  61. doc > range 0x90 to 0xbf: confirmed encryption
  62. hex confirmed_encryption 0x90 doc="generic";
  63. hex OpenPGP_weak 0x91 doc="RSA 1024 is weak (unused)";
  64. hex to_be_checked_confirmed 0xa0 doc="generic";
  65. hex SMIME 0xa1;
  66. hex CMS 0xa2;
  67. hex strong_encryption 0xb0 doc="generic";
  68. hex OpenPGP 0xb8 doc="key at least 2048 bit RSA or EC";
  69. hex OTR 0xba;
  70. doc > range 0xc0 to 0xff: confirmed encryption and anonymization
  71. hex confirmed_enc_anon 0xc0 doc="generic";
  72. hex pEp 0xff
  73. } // enum comm_type
  74. struct identity {
  75. field string address doc="SMTP address or URI";
  76. field hash fpr doc="fingerprint of key being used as ID";
  77. field string user_id doc="ID for person or entity in M2M case";
  78. field string username doc="descriptive string";
  79. field ISO639_1 lang doc="two-digit language code or null bytes";
  80. flags {
  81. flag not_for_sync 0x0001
  82. doc="don't use this identity for Sync";
  83. flag list 0x0002
  84. doc="identity of list of persons";
  85. doc | the second octet flags are calculated
  86. flag devicegroup 0x0100
  87. doc="identity of a device group member"
  88. }
  89. } // struct Identity