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.

73 lines
2.8 KiB

  1. //+-------------------------------------------------------------------------
  2. // Microsoft Windows
  3. //
  4. // Copyright (C) Microsoft Corporation, 1999 - 1999
  5. //
  6. // File: rootlist.h
  7. //
  8. // Contents: Signed List of Trusted Roots Helper Functions
  9. //
  10. // History: 01-Aug-99 philh created
  11. //--------------------------------------------------------------------------
  12. #ifndef __ROOT_LIST_INCLUDED__
  13. #define __ROOT_LIST_INCLUDED__
  14. #include "wincrypt.h"
  15. //+-------------------------------------------------------------------------
  16. // Verify that the encoded CTL contains a signed list of roots. For success,
  17. // return certificate store containing the trusted roots to add or
  18. // remove. Also for success, return certificate context of the signer.
  19. //
  20. // The signature of the CTL is verified. The signer of the CTL is verified
  21. // up to a trusted root containing the predefined Microsoft public key.
  22. // The signer and intermediate certificates must have the
  23. // szOID_ROOT_LIST_SIGNER enhanced key usage extension.
  24. //
  25. // The CTL fields are validated as follows:
  26. // - There is at least one SubjectUsage (really the roots enhanced key usage)
  27. // - If NextUpdate isn't NULL, that the CTL is still time valid
  28. // - Only allow roots identified by their sha1 hash
  29. //
  30. // The following CTL extensions are processed:
  31. // - szOID_ENHANCED_KEY_USAGE - if present, must contain
  32. // szOID_ROOT_LIST_SIGNER usage
  33. // - szOID_REMOVE_CERTIFICATE - integer value, 0 => FALSE (add)
  34. // 1 => TRUE (remove), all other values are invalid
  35. // - szOID_CERT_POLICIES - ignored
  36. //
  37. // If the CTL contains any other critical extensions, then, the
  38. // CTL verification fails.
  39. //
  40. // For a successfully verified CTL:
  41. // - TRUE is returned
  42. // - *pfRemoveRoots is set to FALSE to add roots and is set to TRUE to
  43. // remove roots.
  44. // - *phRootListStore is a certificate store containing only the roots to
  45. // add or remove. *phRootListStore must be closed by calling
  46. // CertCloseStore(). For added roots, the CTL's SubjectUsage field is
  47. // set as CERT_ENHKEY_USAGE_PROP_ID on all of the certificates in the
  48. // store.
  49. // - *ppSignerCert is a pointer to the certificate context of the signer.
  50. // *ppSignerCert must be freed by calling CertFreeCertificateContext().
  51. //
  52. // Otherwise, FALSE is returned with *phRootListStore and *ppSignerCert
  53. // set to NULL.
  54. //--------------------------------------------------------------------------
  55. BOOL
  56. WINAPI
  57. I_CertVerifySignedListOfTrustedRoots(
  58. IN const BYTE *pbCtlEncoded,
  59. IN DWORD cbCtlEncoded,
  60. OUT BOOL *pfRemoveRoots, // FALSE: add, TRUE: remove
  61. OUT HCERTSTORE *phRootListStore,
  62. OUT PCCERT_CONTEXT *ppSignerCert
  63. );
  64. #endif // __ROOT_LIST_INCLUDED__