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.

98 lines
2.8 KiB

  1. #pragma once
  2. EXTERN_C const XML_SPECIAL_STRING sc_ss_xmldsignamespace;
  3. NTSTATUS
  4. Rtl_InspectManifest_Signature(
  5. PXML_LOGICAL_STATE pLogicalState,
  6. PRTL_MANIFEST_CONTENT_RAW pManifestContent,
  7. PXMLDOC_THING pDocThing,
  8. PRTL_GROWING_LIST pAttributes,
  9. MANIFEST_ELEMENT_CALLBACK_REASON Reason,
  10. const struct _XML_ELEMENT_DEFINITION *pElementDefinition
  11. );
  12. DECLARE_ELEMENT(Signature);
  13. typedef enum {
  14. DsigKey_DSA,
  15. DsigKey_RSA
  16. } XmlDsigKeyType;
  17. #define XMLDSIG_FLAG_SIGNATURE_DATA_PRESENT (0x00000001)
  18. #define XMLDSIG_FLAG_SIGNATURE_METHOD_PRESENT (0x00000002)
  19. #define XMLDSIG_FLAG_DIGEST_METHOD_PRESENT (0x00000004)
  20. #define XMLDSIG_FLAG_DIGEST_VALUE_PRESENT (0x00000008)
  21. #define XMLDSIG_FLAG_KEY_NAME_PRESENT (0x00000010)
  22. #define XMLDSIG_FLAG_DSAKEY_P_PRESENT (0x00010000)
  23. #define XMLDSIG_FLAG_DSAKEY_Q_PRESENT (0x00020000)
  24. #define XMLDSIG_FLAG_DSAKEY_G_PRESENT (0x00040000)
  25. #define XMLDSIG_FLAG_DSAKEY_Y_PRESENT (0x00080000)
  26. #define XMLDSIG_FLAG_DSAKEY_J_PRESENT (0x00100000)
  27. #define XMLDSIG_FLAG_DSAKEY_SEED_PRESENT (0x00200000)
  28. #define XMLDSIG_FLAG_DSAKEY_PGENCOUNTER_PRESENT (0x00400000)
  29. #define XMLDSIG_FLAG_RSAKEY_MODULUS_PRESENT (0x00010000)
  30. #define XMLDSIG_FLAG_RSAKEY_EXPONENT_PRESENT (0x00020000)
  31. typedef struct _XML_DSIG_BLOCK
  32. {
  33. ULONG ulFlags;
  34. XML_EXTENT DsigDocumentExtent;
  35. XML_EXTENT ParentElement;
  36. //
  37. // Everything to know about the signature itself.
  38. //
  39. struct {
  40. XML_EXTENT SignedInfoBlock;
  41. XML_EXTENT CanonicalizationMethod;
  42. XML_EXTENT SignatureMethod;
  43. XML_EXTENT DigestMethod;
  44. XML_EXTENT DigestValueData;
  45. } SignedInfoData;
  46. //
  47. // The base-64 encoded value of the signature of the SignedInfo block
  48. //
  49. XML_EXTENT SignatureData;
  50. //
  51. // Key data right now is just the name of the key and the
  52. // actual key bits. At some point in the future we'll
  53. // consider using X509 as well, but for now since it's not
  54. // available in-kernel, we're out of luck.
  55. //
  56. struct
  57. {
  58. XML_EXTENT KeyName;
  59. XmlDsigKeyType Type;
  60. //
  61. // As more key types become available, they should be
  62. // added here.
  63. //
  64. union
  65. {
  66. struct
  67. {
  68. ULONG Flags;
  69. XML_EXTENT P, Q, G, Y, J, Seed, PgenCounter;
  70. } DSAValue;
  71. struct
  72. {
  73. ULONG Flags;
  74. XML_EXTENT Modulus, Exponent;
  75. } RSAValue;
  76. } KeyData;
  77. } KeyInfo;
  78. }
  79. XML_DSIG_BLOCK, *PXML_DSIG_BLOCK;