X509_STORE_set_verify_cb_func.pod 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. =pod
  2. =head1 NAME
  3. X509_STORE_set_lookup_crls_cb,
  4. X509_STORE_set_verify_func,
  5. X509_STORE_get_cleanup,
  6. X509_STORE_set_cleanup,
  7. X509_STORE_get_lookup_crls,
  8. X509_STORE_set_lookup_crls,
  9. X509_STORE_get_lookup_certs,
  10. X509_STORE_set_lookup_certs,
  11. X509_STORE_get_check_policy,
  12. X509_STORE_set_check_policy,
  13. X509_STORE_get_cert_crl,
  14. X509_STORE_set_cert_crl,
  15. X509_STORE_get_check_crl,
  16. X509_STORE_set_check_crl,
  17. X509_STORE_get_get_crl,
  18. X509_STORE_set_get_crl,
  19. X509_STORE_get_check_revocation,
  20. X509_STORE_set_check_revocation,
  21. X509_STORE_get_check_issued,
  22. X509_STORE_set_check_issued,
  23. X509_STORE_get_get_issuer,
  24. X509_STORE_set_get_issuer,
  25. X509_STORE_CTX_get_verify,
  26. X509_STORE_set_verify,
  27. X509_STORE_get_verify_cb,
  28. X509_STORE_set_verify_cb_func, X509_STORE_set_verify_cb,
  29. X509_STORE_CTX_cert_crl_fn, X509_STORE_CTX_check_crl_fn,
  30. X509_STORE_CTX_check_issued_fn, X509_STORE_CTX_check_policy_fn,
  31. X509_STORE_CTX_check_revocation_fn, X509_STORE_CTX_cleanup_fn,
  32. X509_STORE_CTX_get_crl_fn, X509_STORE_CTX_get_issuer_fn,
  33. X509_STORE_CTX_lookup_certs_fn, X509_STORE_CTX_lookup_crls_fn
  34. - set verification callback
  35. =head1 SYNOPSIS
  36. #include <openssl/x509_vfy.h>
  37. typedef int (*X509_STORE_CTX_get_issuer_fn)(X509 **issuer,
  38. X509_STORE_CTX *ctx, X509 *x);
  39. typedef int (*X509_STORE_CTX_check_issued_fn)(X509_STORE_CTX *ctx,
  40. X509 *x, X509 *issuer);
  41. typedef int (*X509_STORE_CTX_check_revocation_fn)(X509_STORE_CTX *ctx);
  42. typedef int (*X509_STORE_CTX_get_crl_fn)(X509_STORE_CTX *ctx,
  43. X509_CRL **crl, X509 *x);
  44. typedef int (*X509_STORE_CTX_check_crl_fn)(X509_STORE_CTX *ctx, X509_CRL *crl);
  45. typedef int (*X509_STORE_CTX_cert_crl_fn)(X509_STORE_CTX *ctx,
  46. X509_CRL *crl, X509 *x);
  47. typedef int (*X509_STORE_CTX_check_policy_fn)(X509_STORE_CTX *ctx);
  48. typedef STACK_OF(X509) *(*X509_STORE_CTX_lookup_certs_fn)(X509_STORE_CTX *ctx,
  49. X509_NAME *nm);
  50. typedef STACK_OF(X509_CRL) *(*X509_STORE_CTX_lookup_crls_fn)(X509_STORE_CTX *ctx,
  51. X509_NAME *nm);
  52. typedef int (*X509_STORE_CTX_cleanup_fn)(X509_STORE_CTX *ctx);
  53. void X509_STORE_set_verify_cb(X509_STORE *ctx,
  54. X509_STORE_CTX_verify_cb verify_cb);
  55. X509_STORE_CTX_verify_cb X509_STORE_get_verify_cb(X509_STORE_CTX *ctx);
  56. void X509_STORE_set_verify(X509_STORE *ctx, X509_STORE_CTX_verify_fn verify);
  57. X509_STORE_CTX_verify_fn X509_STORE_CTX_get_verify(X509_STORE_CTX *ctx);
  58. void X509_STORE_set_get_issuer(X509_STORE *ctx,
  59. X509_STORE_CTX_get_issuer_fn get_issuer);
  60. X509_STORE_CTX_get_issuer_fn X509_STORE_get_get_issuer(X509_STORE_CTX *ctx);
  61. void X509_STORE_set_check_issued(X509_STORE *ctx,
  62. X509_STORE_CTX_check_issued_fn check_issued);
  63. X509_STORE_CTX_check_issued_fn X509_STORE_get_check_issued(X509_STORE_CTX *ctx);
  64. void X509_STORE_set_check_revocation(X509_STORE *ctx,
  65. X509_STORE_CTX_check_revocation_fn check_revocation);
  66. X509_STORE_CTX_check_revocation_fn X509_STORE_get_check_revocation(X509_STORE_CTX *ctx);
  67. void X509_STORE_set_get_crl(X509_STORE *ctx,
  68. X509_STORE_CTX_get_crl_fn get_crl);
  69. X509_STORE_CTX_get_crl_fn X509_STORE_get_get_crl(X509_STORE_CTX *ctx);
  70. void X509_STORE_set_check_crl(X509_STORE *ctx,
  71. X509_STORE_CTX_check_crl_fn check_crl);
  72. X509_STORE_CTX_check_crl_fn X509_STORE_get_check_crl(X509_STORE_CTX *ctx);
  73. void X509_STORE_set_cert_crl(X509_STORE *ctx,
  74. X509_STORE_CTX_cert_crl_fn cert_crl);
  75. X509_STORE_CTX_cert_crl_fn X509_STORE_get_cert_crl(X509_STORE_CTX *ctx);
  76. void X509_STORE_set_check_policy(X509_STORE *ctx,
  77. X509_STORE_CTX_check_policy_fn check_policy);
  78. X509_STORE_CTX_check_policy_fn X509_STORE_get_check_policy(X509_STORE_CTX *ctx);
  79. void X509_STORE_set_lookup_certs(X509_STORE *ctx,
  80. X509_STORE_CTX_lookup_certs_fn lookup_certs);
  81. X509_STORE_CTX_lookup_certs_fn X509_STORE_get_lookup_certs(X509_STORE_CTX *ctx);
  82. void X509_STORE_set_lookup_crls(X509_STORE *ctx,
  83. X509_STORE_CTX_lookup_crls_fn lookup_crls);
  84. X509_STORE_CTX_lookup_crls_fn X509_STORE_get_lookup_crls(X509_STORE_CTX *ctx);
  85. void X509_STORE_set_cleanup(X509_STORE *ctx,
  86. X509_STORE_CTX_cleanup_fn cleanup);
  87. X509_STORE_CTX_cleanup_fn X509_STORE_get_cleanup(X509_STORE_CTX *ctx);
  88. /* Aliases */
  89. void X509_STORE_set_verify_cb_func(X509_STORE *st,
  90. X509_STORE_CTX_verify_cb verify_cb);
  91. void X509_STORE_set_verify_func(X509_STORE *ctx,
  92. X509_STORE_CTX_verify_fn verify);
  93. void X509_STORE_set_lookup_crls_cb(X509_STORE *ctx,
  94. X509_STORE_CTX_lookup_crls_fn lookup_crls);
  95. =head1 DESCRIPTION
  96. X509_STORE_set_verify_cb() sets the verification callback of B<ctx> to
  97. B<verify_cb> overwriting the previous callback.
  98. The callback assigned with this function becomes a default for the one
  99. that can be assigned directly to the corresponding B<X509_STORE_CTX>,
  100. please see L<X509_STORE_CTX_set_verify_cb(3)> for further information.
  101. X509_STORE_set_verify() sets the final chain verification function for
  102. B<ctx> to B<verify>.
  103. Its purpose is to go through the chain of certificates and check that
  104. all signatures are valid and that the current time is within the
  105. limits of each certificate's first and last validity time.
  106. The final chain verification functions must return 0 on failure and 1
  107. on success.
  108. I<If no chain verification function is provided, the internal default
  109. function will be used instead.>
  110. X509_STORE_set_get_issuer() sets the function to get the issuer
  111. certificate that verifies the given certificate B<x>.
  112. When found, the issuer certificate must be assigned to B<*issuer>.
  113. This function must return 0 on failure and 1 on success.
  114. I<If no function to get the issuer is provided, the internal default
  115. function will be used instead.>
  116. X509_STORE_set_check_issued() sets the function to check that a given
  117. certificate B<x> is issued with the issuer certificate B<issuer>.
  118. This function must return 0 on failure (among others if B<x> hasn't
  119. been issued with B<issuer>) and 1 on success.
  120. I<If no function to get the issuer is provided, the internal default
  121. function will be used instead.>
  122. X509_STORE_set_check_revocation() sets the revocation checking
  123. function.
  124. Its purpose is to look through the final chain and check the
  125. revocation status for each certificate.
  126. It must return 0 on failure and 1 on success.
  127. I<If no function to get the issuer is provided, the internal default
  128. function will be used instead.>
  129. X509_STORE_set_get_crl() sets the function to get the crl for a given
  130. certificate B<x>.
  131. When found, the crl must be assigned to B<*crl>.
  132. This function must return 0 on failure and 1 on success.
  133. I<If no function to get the issuer is provided, the internal default
  134. function will be used instead.>
  135. X509_STORE_set_check_crl() sets the function to check the validity of
  136. the given B<crl>.
  137. This function must return 0 on failure and 1 on success.
  138. I<If no function to get the issuer is provided, the internal default
  139. function will be used instead.>
  140. X509_STORE_set_cert_crl() sets the function to check the revocation
  141. status of the given certificate B<x> against the given B<crl>.
  142. This function must return 0 on failure and 1 on success.
  143. I<If no function to get the issuer is provided, the internal default
  144. function will be used instead.>
  145. X509_STORE_set_check_policy() sets the function to check the policies
  146. of all the certificates in the final chain..
  147. This function must return 0 on failure and 1 on success.
  148. I<If no function to get the issuer is provided, the internal default
  149. function will be used instead.>
  150. X509_STORE_set_lookup_certs() and X509_STORE_set_lookup_crls() set the
  151. functions to look up all the certs or all the CRLs that match the
  152. given name B<nm>.
  153. These functions return NULL on failure and a pointer to a stack of
  154. certificates (B<X509>) or to a stack of CRLs (B<X509_CRL>) on
  155. success.
  156. I<If no function to get the issuer is provided, the internal default
  157. function will be used instead.>
  158. X509_STORE_set_cleanup() sets the final cleanup function, which is
  159. called when the context (B<X509_STORE_CTX>) is being torn down.
  160. This function doesn't return any value.
  161. I<If no function to get the issuer is provided, the internal default
  162. function will be used instead.>
  163. X509_STORE_get_verify_cb(), X509_STORE_CTX_get_verify(),
  164. X509_STORE_get_get_issuer(), X509_STORE_get_check_issued(),
  165. X509_STORE_get_check_revocation(), X509_STORE_get_get_crl(),
  166. X509_STORE_get_check_crl(), X509_STORE_set_verify(),
  167. X509_STORE_set_get_issuer(), X509_STORE_get_cert_crl(),
  168. X509_STORE_get_check_policy(), X509_STORE_get_lookup_certs(),
  169. X509_STORE_get_lookup_crls() and X509_STORE_get_cleanup() all return
  170. the function pointer assigned with X509_STORE_set_check_issued(),
  171. X509_STORE_set_check_revocation(), X509_STORE_set_get_crl(),
  172. X509_STORE_set_check_crl(), X509_STORE_set_cert_crl(),
  173. X509_STORE_set_check_policy(), X509_STORE_set_lookup_certs(),
  174. X509_STORE_set_lookup_crls() and X509_STORE_set_cleanup(), or NULL if
  175. no assignment has been made.
  176. X509_STORE_set_verify_cb_func(), X509_STORE_set_verify_func() and
  177. X509_STORE_set_lookup_crls_cb() are aliases for
  178. X509_STORE_set_verify_cb(), X509_STORE_set_verify() and
  179. X509_STORE_set_lookup_crls, available as macros for backward
  180. compatibility.
  181. =head1 NOTES
  182. All the callbacks from a B<X509_STORE> are inherited by the
  183. corresponding B<X509_STORE_CTX> structure when it is initialized.
  184. See L<X509_STORE_CTX_set_verify_cb(3)> for further details.
  185. =head1 BUGS
  186. The macro version of this function was the only one available before
  187. OpenSSL 1.0.0.
  188. =head1 RETURN VALUES
  189. The X509_STORE_set_*() functions do not return a value.
  190. The X509_STORE_get_*() functions return a pointer of the appropriate
  191. function type.
  192. =head1 SEE ALSO
  193. L<X509_STORE_CTX_set_verify_cb(3)>, L<X509_STORE_CTX_get0_chain(3)>,
  194. L<X509_STORE_CTX_verify_cb(3)>, L<X509_STORE_CTX_verify_fn(3)>,
  195. L<CMS_verify(3)>
  196. =head1 HISTORY
  197. X509_STORE_set_verify_cb() was added to OpenSSL 1.0.0.
  198. X509_STORE_set_verify_cb(), X509_STORE_get_verify_cb(),
  199. X509_STORE_set_verify(), X509_STORE_CTX_get_verify(),
  200. X509_STORE_set_get_issuer(), X509_STORE_get_get_issuer(),
  201. X509_STORE_set_check_issued(), X509_STORE_get_check_issued(),
  202. X509_STORE_set_check_revocation(), X509_STORE_get_check_revocation(),
  203. X509_STORE_set_get_crl(), X509_STORE_get_get_crl(),
  204. X509_STORE_set_check_crl(), X509_STORE_get_check_crl(),
  205. X509_STORE_set_cert_crl(), X509_STORE_get_cert_crl(),
  206. X509_STORE_set_check_policy(), X509_STORE_get_check_policy(),
  207. X509_STORE_set_lookup_certs(), X509_STORE_get_lookup_certs(),
  208. X509_STORE_set_lookup_crls(), X509_STORE_get_lookup_crls(),
  209. X509_STORE_set_cleanup() and X509_STORE_get_cleanup() were added in
  210. OpenSSL 1.1.0.
  211. =head1 COPYRIGHT
  212. Copyright 2009-2016 The OpenSSL Project Authors. All Rights Reserved.
  213. Licensed under the OpenSSL license (the "License"). You may not use
  214. this file except in compliance with the License. You can obtain a copy
  215. in the file LICENSE in the source distribution or at
  216. L<https://www.openssl.org/source/license.html>.
  217. =cut