cssmapplePriv.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * Copyright (c) 2000-2004 Apple Computer, Inc. All Rights Reserved.
  3. *
  4. * @APPLE_LICENSE_HEADER_START@
  5. *
  6. * This file contains Original Code and/or Modifications of Original Code
  7. * as defined in and that are subject to the Apple Public Source License
  8. * Version 2.0 (the 'License'). You may not use this file except in
  9. * compliance with the License. Please obtain a copy of the License at
  10. * http://www.opensource.apple.com/apsl/ and read it before using this
  11. * file.
  12. *
  13. * The Original Code and all software distributed under the License are
  14. * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  15. * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  16. * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
  18. * Please see the License for the specific language governing rights and
  19. * limitations under the License.
  20. *
  21. * @APPLE_LICENSE_HEADER_END@
  22. *
  23. * cssmapplePriv.h -- Private CSSM features specific to Apple's Implementation
  24. */
  25. #ifndef _CSSMAPPLE_PRIV_H_
  26. #define _CSSMAPPLE_PRIV_H_ 1
  27. #include <Security/cssmtype.h>
  28. #include <Security/cssmapple.h>
  29. // CSSM functions are deprecated as of OSX 10.7, but have no replacement.
  30. // https://bugs.chromium.org/p/chromium/issues/detail?id=590914#c1
  31. #pragma clang diagnostic push
  32. #pragma clang diagnostic ignored "-Wdeprecated-declarations"
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36. /*
  37. * Options for X509TP's CSSM_TP_CertGroupVerify for policy
  38. * CSSMOID_APPLE_TP_REVOCATION_OCSP. A pointer to, and length of, one
  39. * of these is optionally placed in
  40. * CSSM_TP_VERIFY_CONTEXT.Cred->Policy.PolicyIds[n].FieldValue.
  41. */
  42. #define CSSM_APPLE_TP_OCSP_OPTS_VERSION 0
  43. typedef uint32 CSSM_APPLE_TP_OCSP_OPT_FLAGS;
  44. enum {
  45. // require OCSP verification for each cert; default is "try"
  46. CSSM_TP_ACTION_OCSP_REQUIRE_PER_CERT = 0x00000001,
  47. // require OCSP verification for certs which claim an OCSP responder
  48. CSSM_TP_ACTION_OCSP_REQUIRE_IF_RESP_PRESENT = 0x00000002,
  49. // disable network OCSP transactions
  50. CSSM_TP_ACTION_OCSP_DISABLE_NET = 0x00000004,
  51. // disable reads from local OCSP cache
  52. CSSM_TP_ACTION_OCSP_CACHE_READ_DISABLE = 0x00000008,
  53. // disable reads from local OCSP cache
  54. CSSM_TP_ACTION_OCSP_CACHE_WRITE_DISABLE = 0x00000010,
  55. // if set and positive OCSP verify for given cert, no further revocation
  56. // checking need be done on that cert
  57. CSSM_TP_ACTION_OCSP_SUFFICIENT = 0x00000020,
  58. // generate nonce in OCSP request
  59. CSSM_TP_OCSP_GEN_NONCE = 0x00000040,
  60. // when generating nonce, require matching nonce in response
  61. CSSM_TP_OCSP_REQUIRE_RESP_NONCE = 0x00000080
  62. };
  63. typedef struct {
  64. uint32 Version;
  65. CSSM_APPLE_TP_OCSP_OPT_FLAGS Flags;
  66. CSSM_DATA_PTR LocalResponder; /* URI */
  67. CSSM_DATA_PTR LocalResponderCert; /* X509 DER encoded cert */
  68. } CSSM_APPLE_TP_OCSP_OPTIONS;
  69. #ifdef __cplusplus
  70. }
  71. #endif
  72. #pragma clang diagnostic pop // "-Wdeprecated-declarations"
  73. #endif /* _CSSMAPPLE_PRIV_H_ */