Leaked source code of windows server 2003
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.

331 lines
8.8 KiB

  1. #ifndef _ESS_Module_H_
  2. #define _ESS_Module_H_
  3. #include "msber.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. typedef ASN1objectidentifier2_t ObjectIdentifier;
  8. typedef ObjectIdentifier ContentType;
  9. typedef ASN1int32_t Version;
  10. #define Version_v0 0
  11. #define Version_v1 1
  12. #define Version_v2 2
  13. #define Version_v3 3
  14. typedef ASN1intx_t HUGEINTEGER;
  15. typedef HUGEINTEGER SerialNumber;
  16. typedef SerialNumber CertificateSerialNumber;
  17. typedef ASN1octetstring_t OCTETSTRING;
  18. typedef ASN1open_t NOCOPYANY;
  19. typedef OCTETSTRING SubjectKeyIdentifier;
  20. typedef NOCOPYANY GeneralNames;
  21. typedef ASN1octetstring_t ContentIdentifier;
  22. typedef ASN1int32_t AllOrFirstTier;
  23. #define AllOrFirstTier_allReceipts 0
  24. #define AllOrFirstTier_firstTierRecipients 1
  25. typedef ASN1octetstring_t MsgSigDigest;
  26. typedef ObjectIdentifier SecurityPolicyIdentifier;
  27. typedef ASN1uint16_t SecurityClassification;
  28. #define SecurityClassification_unmarked 0
  29. #define SecurityClassification_unclassified 1
  30. #define SecurityClassification_restricted 2
  31. #define SecurityClassification_confidential 3
  32. #define SecurityClassification_secret 4
  33. #define SecurityClassification_top_secret 5
  34. typedef ASN1octetstring_t Hash;
  35. typedef NOCOPYANY PolicyInformation;
  36. typedef struct SigningCertificate_policies {
  37. ASN1uint32_t count;
  38. PolicyInformation *value;
  39. } SigningCertificate_policies;
  40. typedef struct SigningCertificate_certs {
  41. ASN1uint32_t count;
  42. struct ESSCertID *value;
  43. } SigningCertificate_certs;
  44. typedef struct MLReceiptPolicy_inAdditionTo {
  45. ASN1uint32_t count;
  46. GeneralNames *value;
  47. } MLReceiptPolicy_inAdditionTo;
  48. typedef struct MLReceiptPolicy_insteadOf {
  49. ASN1uint32_t count;
  50. GeneralNames *value;
  51. } MLReceiptPolicy_insteadOf;
  52. typedef struct ReceiptsFrom_receiptList {
  53. ASN1uint32_t count;
  54. GeneralNames *value;
  55. } ReceiptsFrom_receiptList;
  56. typedef struct ReceiptRequest_receiptsTo {
  57. ASN1uint32_t count;
  58. GeneralNames *value;
  59. } ReceiptRequest_receiptsTo;
  60. typedef struct IssuerAndSerialNumber {
  61. NOCOPYANY issuer;
  62. SerialNumber serialNumber;
  63. } IssuerAndSerialNumber;
  64. typedef struct ReceiptsFrom {
  65. ASN1choice_t choice;
  66. union {
  67. # define allOrFirstTier_chosen 1
  68. AllOrFirstTier allOrFirstTier;
  69. # define receiptList_chosen 2
  70. ReceiptsFrom_receiptList receiptList;
  71. } u;
  72. } ReceiptsFrom;
  73. typedef struct Receipt {
  74. Version version;
  75. ContentType contentType;
  76. ContentIdentifier signedContentIdentifier;
  77. OCTETSTRING originatorSignatureValue;
  78. } Receipt;
  79. #define Receipt_PDU 0
  80. #define SIZE_ESS_Module_PDU_0 sizeof(Receipt)
  81. typedef struct ContentHints {
  82. union {
  83. ASN1uint16_t bit_mask;
  84. ASN1octet_t o[1];
  85. };
  86. # define contentDescription_present 0x80
  87. ASN1wstring_t contentDescription;
  88. ObjectIdentifier contentType;
  89. } ContentHints;
  90. #define ContentHints_PDU 1
  91. #define SIZE_ESS_Module_PDU_1 sizeof(ContentHints)
  92. typedef struct ContentReference {
  93. ContentType contentType;
  94. ContentIdentifier signedContentIdentifier;
  95. ASN1octetstring_t originatorSignatureValue;
  96. } ContentReference;
  97. #define ContentReference_PDU 2
  98. #define SIZE_ESS_Module_PDU_2 sizeof(ContentReference)
  99. typedef struct ESSPrivacyMark {
  100. ASN1choice_t choice;
  101. union {
  102. # define utf8String_chosen 1
  103. ASN1wstring_t utf8String;
  104. # define pString_chosen 2
  105. ASN1ztcharstring_t pString;
  106. } u;
  107. } ESSPrivacyMark;
  108. typedef struct SecurityCategories {
  109. ASN1uint32_t count;
  110. struct SecurityCategory *value;
  111. } SecurityCategories;
  112. typedef struct SecurityCategory {
  113. ObjectIdentifier type;
  114. NOCOPYANY value;
  115. } SecurityCategory;
  116. typedef struct EquivalentLabels {
  117. ASN1uint32_t count;
  118. struct ESSSecurityLabel *value;
  119. } EquivalentLabels;
  120. #define EquivalentLabels_PDU 3
  121. #define SIZE_ESS_Module_PDU_3 sizeof(EquivalentLabels)
  122. typedef struct MLExpansionHistory {
  123. ASN1uint32_t count;
  124. struct MLData *value;
  125. } MLExpansionHistory;
  126. #define MLExpansionHistory_PDU 4
  127. #define SIZE_ESS_Module_PDU_4 sizeof(MLExpansionHistory)
  128. typedef struct EntityIdentifier {
  129. ASN1choice_t choice;
  130. union {
  131. # define subjectKeyIdentifier_chosen 1
  132. SubjectKeyIdentifier subjectKeyIdentifier;
  133. # define EntityIdentifier_issuerAndSerialNumber_chosen 2
  134. IssuerAndSerialNumber issuerAndSerialNumber;
  135. } u;
  136. } EntityIdentifier;
  137. typedef struct MLReceiptPolicy {
  138. ASN1choice_t choice;
  139. union {
  140. # define none_chosen 1
  141. # define insteadOf_chosen 2
  142. MLReceiptPolicy_insteadOf insteadOf;
  143. # define inAdditionTo_chosen 3
  144. MLReceiptPolicy_inAdditionTo inAdditionTo;
  145. } u;
  146. } MLReceiptPolicy;
  147. typedef struct SigningCertificate {
  148. union {
  149. ASN1uint16_t bit_mask;
  150. ASN1octet_t o[1];
  151. };
  152. SigningCertificate_certs certs;
  153. # define policies_present 0x80
  154. SigningCertificate_policies policies;
  155. } SigningCertificate;
  156. #define SigningCertificate_PDU 5
  157. #define SIZE_ESS_Module_PDU_5 sizeof(SigningCertificate)
  158. typedef struct ESSCertID {
  159. union {
  160. ASN1uint16_t bit_mask;
  161. ASN1octet_t o[1];
  162. };
  163. Hash certHash;
  164. # define issuerSerial_present 0x80
  165. IssuerAndSerialNumber issuerSerial;
  166. } ESSCertID;
  167. typedef struct SMimeEncryptCerts {
  168. ASN1uint32_t count;
  169. struct SMimeEncryptCert *value;
  170. } SMimeEncryptCerts;
  171. #define SMimeEncryptCerts_PDU 6
  172. #define SIZE_ESS_Module_PDU_6 sizeof(SMimeEncryptCerts)
  173. typedef struct SMIMECapabilities {
  174. ASN1uint32_t count;
  175. struct SMIMECapability *value;
  176. } SMIMECapabilities;
  177. typedef struct SMIMECapability {
  178. union {
  179. ASN1uint16_t bit_mask;
  180. ASN1octet_t o[1];
  181. };
  182. ObjectIdentifier capabilityID;
  183. # define parameters_present 0x80
  184. ASN1open_t parameters;
  185. } SMIMECapability;
  186. typedef struct OtherKeyAttribute {
  187. union {
  188. ASN1uint16_t bit_mask;
  189. ASN1octet_t o[1];
  190. };
  191. ObjectIdentifier keyAttrId;
  192. # define keyAttr_present 0x80
  193. ASN1open_t keyAttr;
  194. } OtherKeyAttribute;
  195. typedef struct ReceiptRequest {
  196. ContentIdentifier signedContentIdentifier;
  197. ReceiptsFrom receiptsFrom;
  198. ReceiptRequest_receiptsTo receiptsTo;
  199. } ReceiptRequest;
  200. #define ReceiptRequest_PDU 7
  201. #define SIZE_ESS_Module_PDU_7 sizeof(ReceiptRequest)
  202. typedef struct ESSSecurityLabel {
  203. union {
  204. ASN1uint16_t bit_mask;
  205. ASN1octet_t o[1];
  206. };
  207. # define security_classification_present 0x80
  208. SecurityClassification security_classification;
  209. SecurityPolicyIdentifier security_policy_identifier;
  210. # define privacy_mark_present 0x40
  211. ESSPrivacyMark privacy_mark;
  212. # define security_categories_present 0x20
  213. SecurityCategories security_categories;
  214. } ESSSecurityLabel;
  215. #define ESSSecurityLabel_PDU 9
  216. #define SIZE_ESS_Module_PDU_9 sizeof(ESSSecurityLabel)
  217. typedef struct MLData {
  218. union {
  219. ASN1uint16_t bit_mask;
  220. ASN1octet_t o[1];
  221. };
  222. EntityIdentifier mailListIdentifier;
  223. ASN1generalizedtime_t expansionTime;
  224. # define mlReceiptPolicy_present 0x80
  225. MLReceiptPolicy mlReceiptPolicy;
  226. } MLData;
  227. typedef struct SMimeEncryptCert {
  228. Hash hash;
  229. SMIMECapabilities capabilities;
  230. } SMimeEncryptCert;
  231. typedef struct RecipientKeyIdentifier {
  232. union {
  233. ASN1uint16_t bit_mask;
  234. ASN1octet_t o[1];
  235. };
  236. SubjectKeyIdentifier subjectKeyIdentifier;
  237. # define date_present 0x80
  238. ASN1generalizedtime_t date;
  239. # define other_present 0x40
  240. OtherKeyAttribute other;
  241. } RecipientKeyIdentifier;
  242. typedef struct SMIMEEncryptionKeyPreference {
  243. ASN1choice_t choice;
  244. union {
  245. # define SMIMEEncryptionKeyPreference_issuerAndSerialNumber_chosen 1
  246. IssuerAndSerialNumber issuerAndSerialNumber;
  247. # define recipientKeyId_chosen 2
  248. RecipientKeyIdentifier recipientKeyId;
  249. # define subjectAltKeyIdentifier_chosen 3
  250. SubjectKeyIdentifier subjectAltKeyIdentifier;
  251. } u;
  252. } SMIMEEncryptionKeyPreference;
  253. #define SMIMEEncryptionKeyPreference_PDU 8
  254. #define SIZE_ESS_Module_PDU_8 sizeof(SMIMEEncryptionKeyPreference)
  255. extern ASN1int32_t ub_receiptsTo;
  256. extern ASN1objectidentifier_t id_aa_receiptRequest;
  257. extern ASN1objectidentifier_t id_aa_contentIdentifier;
  258. extern ASN1objectidentifier_t id_ct_receipt;
  259. extern ASN1objectidentifier_t id_aa_contentHint;
  260. extern ASN1objectidentifier_t id_aa_msgSigDigest;
  261. extern ASN1objectidentifier_t id_aa_contentReference;
  262. extern ASN1objectidentifier_t id_aa_securityLabel;
  263. extern ASN1int32_t ub_integer_options;
  264. extern ASN1int32_t ub_privacy_mark_length;
  265. extern ASN1int32_t ub_security_categories;
  266. extern ASN1objectidentifier_t id_aa_equivalentLabels;
  267. extern ASN1objectidentifier_t id_aa_mlExpandHistory;
  268. extern ASN1int32_t ub_ml_expansion_history;
  269. extern ASN1objectidentifier_t id_aa_signingCertificate;
  270. extern ASN1module_t ESS_Module;
  271. extern void ASN1CALL ESS_Module_Startup(void);
  272. extern void ASN1CALL ESS_Module_Cleanup(void);
  273. /* Prototypes of element functions for SEQUENCE OF and SET OF constructs */
  274. #ifdef __cplusplus
  275. } /* extern "C" */
  276. #endif
  277. #endif /* _ESS_Module_H_ */