x509_vfy.h 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894
  1. /*
  2. * WARNING: do not edit!
  3. * Generated by Makefile from include/openssl/x509_vfy.h.in
  4. *
  5. * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
  6. *
  7. * Licensed under the Apache License 2.0 (the "License"). You may not use
  8. * this file except in compliance with the License. You can obtain a copy
  9. * in the file LICENSE in the source distribution or at
  10. * https://www.openssl.org/source/license.html
  11. */
  12. #ifndef OPENSSL_X509_VFY_H
  13. # define OPENSSL_X509_VFY_H
  14. # pragma once
  15. # include <openssl/macros.h>
  16. # ifndef OPENSSL_NO_DEPRECATED_3_0
  17. # define HEADER_X509_VFY_H
  18. # endif
  19. /*
  20. * Protect against recursion, x509.h and x509_vfy.h each include the other.
  21. */
  22. # ifndef OPENSSL_X509_H
  23. # include <openssl/x509.h>
  24. # endif
  25. # include <openssl/opensslconf.h>
  26. # include <openssl/lhash.h>
  27. # include <openssl/bio.h>
  28. # include <openssl/crypto.h>
  29. # include <openssl/symhacks.h>
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. /*-
  34. SSL_CTX -> X509_STORE
  35. -> X509_LOOKUP
  36. ->X509_LOOKUP_METHOD
  37. -> X509_LOOKUP
  38. ->X509_LOOKUP_METHOD
  39. SSL -> X509_STORE_CTX
  40. ->X509_STORE
  41. The X509_STORE holds the tables etc for verification stuff.
  42. A X509_STORE_CTX is used while validating a single certificate.
  43. The X509_STORE has X509_LOOKUPs for looking up certs.
  44. The X509_STORE then calls a function to actually verify the
  45. certificate chain.
  46. */
  47. typedef enum {
  48. X509_LU_NONE = 0,
  49. X509_LU_X509, X509_LU_CRL
  50. } X509_LOOKUP_TYPE;
  51. #ifndef OPENSSL_NO_DEPRECATED_1_1_0
  52. #define X509_LU_RETRY -1
  53. #define X509_LU_FAIL 0
  54. #endif
  55. SKM_DEFINE_STACK_OF_INTERNAL(X509_LOOKUP, X509_LOOKUP, X509_LOOKUP)
  56. #define sk_X509_LOOKUP_num(sk) OPENSSL_sk_num(ossl_check_const_X509_LOOKUP_sk_type(sk))
  57. #define sk_X509_LOOKUP_value(sk, idx) ((X509_LOOKUP *)OPENSSL_sk_value(ossl_check_const_X509_LOOKUP_sk_type(sk), (idx)))
  58. #define sk_X509_LOOKUP_new(cmp) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_new(ossl_check_X509_LOOKUP_compfunc_type(cmp)))
  59. #define sk_X509_LOOKUP_new_null() ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_new_null())
  60. #define sk_X509_LOOKUP_new_reserve(cmp, n) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_new_reserve(ossl_check_X509_LOOKUP_compfunc_type(cmp), (n)))
  61. #define sk_X509_LOOKUP_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_LOOKUP_sk_type(sk), (n))
  62. #define sk_X509_LOOKUP_free(sk) OPENSSL_sk_free(ossl_check_X509_LOOKUP_sk_type(sk))
  63. #define sk_X509_LOOKUP_zero(sk) OPENSSL_sk_zero(ossl_check_X509_LOOKUP_sk_type(sk))
  64. #define sk_X509_LOOKUP_delete(sk, i) ((X509_LOOKUP *)OPENSSL_sk_delete(ossl_check_X509_LOOKUP_sk_type(sk), (i)))
  65. #define sk_X509_LOOKUP_delete_ptr(sk, ptr) ((X509_LOOKUP *)OPENSSL_sk_delete_ptr(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr)))
  66. #define sk_X509_LOOKUP_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr))
  67. #define sk_X509_LOOKUP_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr))
  68. #define sk_X509_LOOKUP_pop(sk) ((X509_LOOKUP *)OPENSSL_sk_pop(ossl_check_X509_LOOKUP_sk_type(sk)))
  69. #define sk_X509_LOOKUP_shift(sk) ((X509_LOOKUP *)OPENSSL_sk_shift(ossl_check_X509_LOOKUP_sk_type(sk)))
  70. #define sk_X509_LOOKUP_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_LOOKUP_sk_type(sk),ossl_check_X509_LOOKUP_freefunc_type(freefunc))
  71. #define sk_X509_LOOKUP_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr), (idx))
  72. #define sk_X509_LOOKUP_set(sk, idx, ptr) ((X509_LOOKUP *)OPENSSL_sk_set(ossl_check_X509_LOOKUP_sk_type(sk), (idx), ossl_check_X509_LOOKUP_type(ptr)))
  73. #define sk_X509_LOOKUP_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr))
  74. #define sk_X509_LOOKUP_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr))
  75. #define sk_X509_LOOKUP_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr), pnum)
  76. #define sk_X509_LOOKUP_sort(sk) OPENSSL_sk_sort(ossl_check_X509_LOOKUP_sk_type(sk))
  77. #define sk_X509_LOOKUP_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_LOOKUP_sk_type(sk))
  78. #define sk_X509_LOOKUP_dup(sk) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_dup(ossl_check_const_X509_LOOKUP_sk_type(sk)))
  79. #define sk_X509_LOOKUP_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_copyfunc_type(copyfunc), ossl_check_X509_LOOKUP_freefunc_type(freefunc)))
  80. #define sk_X509_LOOKUP_set_cmp_func(sk, cmp) ((sk_X509_LOOKUP_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_compfunc_type(cmp)))
  81. SKM_DEFINE_STACK_OF_INTERNAL(X509_OBJECT, X509_OBJECT, X509_OBJECT)
  82. #define sk_X509_OBJECT_num(sk) OPENSSL_sk_num(ossl_check_const_X509_OBJECT_sk_type(sk))
  83. #define sk_X509_OBJECT_value(sk, idx) ((X509_OBJECT *)OPENSSL_sk_value(ossl_check_const_X509_OBJECT_sk_type(sk), (idx)))
  84. #define sk_X509_OBJECT_new(cmp) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_new(ossl_check_X509_OBJECT_compfunc_type(cmp)))
  85. #define sk_X509_OBJECT_new_null() ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_new_null())
  86. #define sk_X509_OBJECT_new_reserve(cmp, n) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_new_reserve(ossl_check_X509_OBJECT_compfunc_type(cmp), (n)))
  87. #define sk_X509_OBJECT_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_OBJECT_sk_type(sk), (n))
  88. #define sk_X509_OBJECT_free(sk) OPENSSL_sk_free(ossl_check_X509_OBJECT_sk_type(sk))
  89. #define sk_X509_OBJECT_zero(sk) OPENSSL_sk_zero(ossl_check_X509_OBJECT_sk_type(sk))
  90. #define sk_X509_OBJECT_delete(sk, i) ((X509_OBJECT *)OPENSSL_sk_delete(ossl_check_X509_OBJECT_sk_type(sk), (i)))
  91. #define sk_X509_OBJECT_delete_ptr(sk, ptr) ((X509_OBJECT *)OPENSSL_sk_delete_ptr(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr)))
  92. #define sk_X509_OBJECT_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))
  93. #define sk_X509_OBJECT_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))
  94. #define sk_X509_OBJECT_pop(sk) ((X509_OBJECT *)OPENSSL_sk_pop(ossl_check_X509_OBJECT_sk_type(sk)))
  95. #define sk_X509_OBJECT_shift(sk) ((X509_OBJECT *)OPENSSL_sk_shift(ossl_check_X509_OBJECT_sk_type(sk)))
  96. #define sk_X509_OBJECT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_OBJECT_sk_type(sk),ossl_check_X509_OBJECT_freefunc_type(freefunc))
  97. #define sk_X509_OBJECT_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr), (idx))
  98. #define sk_X509_OBJECT_set(sk, idx, ptr) ((X509_OBJECT *)OPENSSL_sk_set(ossl_check_X509_OBJECT_sk_type(sk), (idx), ossl_check_X509_OBJECT_type(ptr)))
  99. #define sk_X509_OBJECT_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))
  100. #define sk_X509_OBJECT_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))
  101. #define sk_X509_OBJECT_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr), pnum)
  102. #define sk_X509_OBJECT_sort(sk) OPENSSL_sk_sort(ossl_check_X509_OBJECT_sk_type(sk))
  103. #define sk_X509_OBJECT_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_OBJECT_sk_type(sk))
  104. #define sk_X509_OBJECT_dup(sk) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_dup(ossl_check_const_X509_OBJECT_sk_type(sk)))
  105. #define sk_X509_OBJECT_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_copyfunc_type(copyfunc), ossl_check_X509_OBJECT_freefunc_type(freefunc)))
  106. #define sk_X509_OBJECT_set_cmp_func(sk, cmp) ((sk_X509_OBJECT_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_compfunc_type(cmp)))
  107. SKM_DEFINE_STACK_OF_INTERNAL(X509_VERIFY_PARAM, X509_VERIFY_PARAM, X509_VERIFY_PARAM)
  108. #define sk_X509_VERIFY_PARAM_num(sk) OPENSSL_sk_num(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk))
  109. #define sk_X509_VERIFY_PARAM_value(sk, idx) ((X509_VERIFY_PARAM *)OPENSSL_sk_value(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk), (idx)))
  110. #define sk_X509_VERIFY_PARAM_new(cmp) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_new(ossl_check_X509_VERIFY_PARAM_compfunc_type(cmp)))
  111. #define sk_X509_VERIFY_PARAM_new_null() ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_new_null())
  112. #define sk_X509_VERIFY_PARAM_new_reserve(cmp, n) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_new_reserve(ossl_check_X509_VERIFY_PARAM_compfunc_type(cmp), (n)))
  113. #define sk_X509_VERIFY_PARAM_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_VERIFY_PARAM_sk_type(sk), (n))
  114. #define sk_X509_VERIFY_PARAM_free(sk) OPENSSL_sk_free(ossl_check_X509_VERIFY_PARAM_sk_type(sk))
  115. #define sk_X509_VERIFY_PARAM_zero(sk) OPENSSL_sk_zero(ossl_check_X509_VERIFY_PARAM_sk_type(sk))
  116. #define sk_X509_VERIFY_PARAM_delete(sk, i) ((X509_VERIFY_PARAM *)OPENSSL_sk_delete(ossl_check_X509_VERIFY_PARAM_sk_type(sk), (i)))
  117. #define sk_X509_VERIFY_PARAM_delete_ptr(sk, ptr) ((X509_VERIFY_PARAM *)OPENSSL_sk_delete_ptr(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr)))
  118. #define sk_X509_VERIFY_PARAM_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr))
  119. #define sk_X509_VERIFY_PARAM_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr))
  120. #define sk_X509_VERIFY_PARAM_pop(sk) ((X509_VERIFY_PARAM *)OPENSSL_sk_pop(ossl_check_X509_VERIFY_PARAM_sk_type(sk)))
  121. #define sk_X509_VERIFY_PARAM_shift(sk) ((X509_VERIFY_PARAM *)OPENSSL_sk_shift(ossl_check_X509_VERIFY_PARAM_sk_type(sk)))
  122. #define sk_X509_VERIFY_PARAM_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_VERIFY_PARAM_sk_type(sk),ossl_check_X509_VERIFY_PARAM_freefunc_type(freefunc))
  123. #define sk_X509_VERIFY_PARAM_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr), (idx))
  124. #define sk_X509_VERIFY_PARAM_set(sk, idx, ptr) ((X509_VERIFY_PARAM *)OPENSSL_sk_set(ossl_check_X509_VERIFY_PARAM_sk_type(sk), (idx), ossl_check_X509_VERIFY_PARAM_type(ptr)))
  125. #define sk_X509_VERIFY_PARAM_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr))
  126. #define sk_X509_VERIFY_PARAM_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr))
  127. #define sk_X509_VERIFY_PARAM_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr), pnum)
  128. #define sk_X509_VERIFY_PARAM_sort(sk) OPENSSL_sk_sort(ossl_check_X509_VERIFY_PARAM_sk_type(sk))
  129. #define sk_X509_VERIFY_PARAM_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk))
  130. #define sk_X509_VERIFY_PARAM_dup(sk) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_dup(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk)))
  131. #define sk_X509_VERIFY_PARAM_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_copyfunc_type(copyfunc), ossl_check_X509_VERIFY_PARAM_freefunc_type(freefunc)))
  132. #define sk_X509_VERIFY_PARAM_set_cmp_func(sk, cmp) ((sk_X509_VERIFY_PARAM_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_compfunc_type(cmp)))
  133. /* This is used for a table of trust checking functions */
  134. typedef struct x509_trust_st {
  135. int trust;
  136. int flags;
  137. int (*check_trust) (struct x509_trust_st *, X509 *, int);
  138. char *name;
  139. int arg1;
  140. void *arg2;
  141. } X509_TRUST;
  142. SKM_DEFINE_STACK_OF_INTERNAL(X509_TRUST, X509_TRUST, X509_TRUST)
  143. #define sk_X509_TRUST_num(sk) OPENSSL_sk_num(ossl_check_const_X509_TRUST_sk_type(sk))
  144. #define sk_X509_TRUST_value(sk, idx) ((X509_TRUST *)OPENSSL_sk_value(ossl_check_const_X509_TRUST_sk_type(sk), (idx)))
  145. #define sk_X509_TRUST_new(cmp) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_new(ossl_check_X509_TRUST_compfunc_type(cmp)))
  146. #define sk_X509_TRUST_new_null() ((STACK_OF(X509_TRUST) *)OPENSSL_sk_new_null())
  147. #define sk_X509_TRUST_new_reserve(cmp, n) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_new_reserve(ossl_check_X509_TRUST_compfunc_type(cmp), (n)))
  148. #define sk_X509_TRUST_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_TRUST_sk_type(sk), (n))
  149. #define sk_X509_TRUST_free(sk) OPENSSL_sk_free(ossl_check_X509_TRUST_sk_type(sk))
  150. #define sk_X509_TRUST_zero(sk) OPENSSL_sk_zero(ossl_check_X509_TRUST_sk_type(sk))
  151. #define sk_X509_TRUST_delete(sk, i) ((X509_TRUST *)OPENSSL_sk_delete(ossl_check_X509_TRUST_sk_type(sk), (i)))
  152. #define sk_X509_TRUST_delete_ptr(sk, ptr) ((X509_TRUST *)OPENSSL_sk_delete_ptr(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr)))
  153. #define sk_X509_TRUST_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr))
  154. #define sk_X509_TRUST_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr))
  155. #define sk_X509_TRUST_pop(sk) ((X509_TRUST *)OPENSSL_sk_pop(ossl_check_X509_TRUST_sk_type(sk)))
  156. #define sk_X509_TRUST_shift(sk) ((X509_TRUST *)OPENSSL_sk_shift(ossl_check_X509_TRUST_sk_type(sk)))
  157. #define sk_X509_TRUST_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_TRUST_sk_type(sk),ossl_check_X509_TRUST_freefunc_type(freefunc))
  158. #define sk_X509_TRUST_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr), (idx))
  159. #define sk_X509_TRUST_set(sk, idx, ptr) ((X509_TRUST *)OPENSSL_sk_set(ossl_check_X509_TRUST_sk_type(sk), (idx), ossl_check_X509_TRUST_type(ptr)))
  160. #define sk_X509_TRUST_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr))
  161. #define sk_X509_TRUST_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr))
  162. #define sk_X509_TRUST_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr), pnum)
  163. #define sk_X509_TRUST_sort(sk) OPENSSL_sk_sort(ossl_check_X509_TRUST_sk_type(sk))
  164. #define sk_X509_TRUST_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_TRUST_sk_type(sk))
  165. #define sk_X509_TRUST_dup(sk) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_dup(ossl_check_const_X509_TRUST_sk_type(sk)))
  166. #define sk_X509_TRUST_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_copyfunc_type(copyfunc), ossl_check_X509_TRUST_freefunc_type(freefunc)))
  167. #define sk_X509_TRUST_set_cmp_func(sk, cmp) ((sk_X509_TRUST_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_compfunc_type(cmp)))
  168. /* standard trust ids */
  169. # define X509_TRUST_DEFAULT 0 /* Only valid in purpose settings */
  170. # define X509_TRUST_COMPAT 1
  171. # define X509_TRUST_SSL_CLIENT 2
  172. # define X509_TRUST_SSL_SERVER 3
  173. # define X509_TRUST_EMAIL 4
  174. # define X509_TRUST_OBJECT_SIGN 5
  175. # define X509_TRUST_OCSP_SIGN 6
  176. # define X509_TRUST_OCSP_REQUEST 7
  177. # define X509_TRUST_TSA 8
  178. /* Keep these up to date! */
  179. # define X509_TRUST_MIN 1
  180. # define X509_TRUST_MAX 8
  181. /* trust_flags values */
  182. # define X509_TRUST_DYNAMIC (1U << 0)
  183. # define X509_TRUST_DYNAMIC_NAME (1U << 1)
  184. /* No compat trust if self-signed, preempts "DO_SS" */
  185. # define X509_TRUST_NO_SS_COMPAT (1U << 2)
  186. /* Compat trust if no explicit accepted trust EKUs */
  187. # define X509_TRUST_DO_SS_COMPAT (1U << 3)
  188. /* Accept "anyEKU" as a wildcard rejection OID and as a wildcard trust OID */
  189. # define X509_TRUST_OK_ANY_EKU (1U << 4)
  190. /* check_trust return codes */
  191. # define X509_TRUST_TRUSTED 1
  192. # define X509_TRUST_REJECTED 2
  193. # define X509_TRUST_UNTRUSTED 3
  194. int X509_TRUST_set(int *t, int trust);
  195. int X509_TRUST_get_count(void);
  196. X509_TRUST *X509_TRUST_get0(int idx);
  197. int X509_TRUST_get_by_id(int id);
  198. int X509_TRUST_add(int id, int flags, int (*ck) (X509_TRUST *, X509 *, int),
  199. const char *name, int arg1, void *arg2);
  200. void X509_TRUST_cleanup(void);
  201. int X509_TRUST_get_flags(const X509_TRUST *xp);
  202. char *X509_TRUST_get0_name(const X509_TRUST *xp);
  203. int X509_TRUST_get_trust(const X509_TRUST *xp);
  204. int X509_trusted(const X509 *x);
  205. int X509_add1_trust_object(X509 *x, const ASN1_OBJECT *obj);
  206. int X509_add1_reject_object(X509 *x, const ASN1_OBJECT *obj);
  207. void X509_trust_clear(X509 *x);
  208. void X509_reject_clear(X509 *x);
  209. STACK_OF(ASN1_OBJECT) *X509_get0_trust_objects(X509 *x);
  210. STACK_OF(ASN1_OBJECT) *X509_get0_reject_objects(X509 *x);
  211. int (*X509_TRUST_set_default(int (*trust) (int, X509 *, int))) (int, X509 *,
  212. int);
  213. int X509_check_trust(X509 *x, int id, int flags);
  214. int X509_verify_cert(X509_STORE_CTX *ctx);
  215. int X509_STORE_CTX_verify(X509_STORE_CTX *ctx);
  216. STACK_OF(X509) *X509_build_chain(X509 *target, STACK_OF(X509) *certs,
  217. X509_STORE *store, int with_self_signed,
  218. OSSL_LIB_CTX *libctx, const char *propq);
  219. int X509_STORE_set_depth(X509_STORE *store, int depth);
  220. typedef int (*X509_STORE_CTX_verify_cb)(int, X509_STORE_CTX *);
  221. int X509_STORE_CTX_print_verify_cb(int ok, X509_STORE_CTX *ctx);
  222. typedef int (*X509_STORE_CTX_verify_fn)(X509_STORE_CTX *);
  223. typedef int (*X509_STORE_CTX_get_issuer_fn)(X509 **issuer,
  224. X509_STORE_CTX *ctx, X509 *x);
  225. typedef int (*X509_STORE_CTX_check_issued_fn)(X509_STORE_CTX *ctx,
  226. X509 *x, X509 *issuer);
  227. typedef int (*X509_STORE_CTX_check_revocation_fn)(X509_STORE_CTX *ctx);
  228. typedef int (*X509_STORE_CTX_get_crl_fn)(X509_STORE_CTX *ctx,
  229. X509_CRL **crl, X509 *x);
  230. typedef int (*X509_STORE_CTX_check_crl_fn)(X509_STORE_CTX *ctx, X509_CRL *crl);
  231. typedef int (*X509_STORE_CTX_cert_crl_fn)(X509_STORE_CTX *ctx,
  232. X509_CRL *crl, X509 *x);
  233. typedef int (*X509_STORE_CTX_check_policy_fn)(X509_STORE_CTX *ctx);
  234. typedef STACK_OF(X509)
  235. *(*X509_STORE_CTX_lookup_certs_fn)(X509_STORE_CTX *ctx,
  236. const X509_NAME *nm);
  237. typedef STACK_OF(X509_CRL)
  238. *(*X509_STORE_CTX_lookup_crls_fn)(const X509_STORE_CTX *ctx,
  239. const X509_NAME *nm);
  240. typedef int (*X509_STORE_CTX_cleanup_fn)(X509_STORE_CTX *ctx);
  241. void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth);
  242. # define X509_STORE_CTX_set_app_data(ctx,data) \
  243. X509_STORE_CTX_set_ex_data(ctx,0,data)
  244. # define X509_STORE_CTX_get_app_data(ctx) \
  245. X509_STORE_CTX_get_ex_data(ctx,0)
  246. # define X509_L_FILE_LOAD 1
  247. # define X509_L_ADD_DIR 2
  248. # define X509_L_ADD_STORE 3
  249. # define X509_L_LOAD_STORE 4
  250. # define X509_LOOKUP_load_file(x,name,type) \
  251. X509_LOOKUP_ctrl((x),X509_L_FILE_LOAD,(name),(long)(type),NULL)
  252. # define X509_LOOKUP_add_dir(x,name,type) \
  253. X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(long)(type),NULL)
  254. # define X509_LOOKUP_add_store(x,name) \
  255. X509_LOOKUP_ctrl((x),X509_L_ADD_STORE,(name),0,NULL)
  256. # define X509_LOOKUP_load_store(x,name) \
  257. X509_LOOKUP_ctrl((x),X509_L_LOAD_STORE,(name),0,NULL)
  258. # define X509_LOOKUP_load_file_ex(x, name, type, libctx, propq) \
  259. X509_LOOKUP_ctrl_ex((x), X509_L_FILE_LOAD, (name), (long)(type), NULL,\
  260. (libctx), (propq))
  261. # define X509_LOOKUP_load_store_ex(x, name, libctx, propq) \
  262. X509_LOOKUP_ctrl_ex((x), X509_L_LOAD_STORE, (name), 0, NULL, \
  263. (libctx), (propq))
  264. # define X509_LOOKUP_add_store_ex(x, name, libctx, propq) \
  265. X509_LOOKUP_ctrl_ex((x), X509_L_ADD_STORE, (name), 0, NULL, \
  266. (libctx), (propq))
  267. # define X509_V_OK 0
  268. # define X509_V_ERR_UNSPECIFIED 1
  269. # define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT 2
  270. # define X509_V_ERR_UNABLE_TO_GET_CRL 3
  271. # define X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE 4
  272. # define X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE 5
  273. # define X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY 6
  274. # define X509_V_ERR_CERT_SIGNATURE_FAILURE 7
  275. # define X509_V_ERR_CRL_SIGNATURE_FAILURE 8
  276. # define X509_V_ERR_CERT_NOT_YET_VALID 9
  277. # define X509_V_ERR_CERT_HAS_EXPIRED 10
  278. # define X509_V_ERR_CRL_NOT_YET_VALID 11
  279. # define X509_V_ERR_CRL_HAS_EXPIRED 12
  280. # define X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD 13
  281. # define X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD 14
  282. # define X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD 15
  283. # define X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD 16
  284. # define X509_V_ERR_OUT_OF_MEM 17
  285. # define X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT 18
  286. # define X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN 19
  287. # define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY 20
  288. # define X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE 21
  289. # define X509_V_ERR_CERT_CHAIN_TOO_LONG 22
  290. # define X509_V_ERR_CERT_REVOKED 23
  291. # define X509_V_ERR_NO_ISSUER_PUBLIC_KEY 24
  292. # define X509_V_ERR_PATH_LENGTH_EXCEEDED 25
  293. # define X509_V_ERR_INVALID_PURPOSE 26
  294. # define X509_V_ERR_CERT_UNTRUSTED 27
  295. # define X509_V_ERR_CERT_REJECTED 28
  296. /* These are 'informational' when looking for issuer cert */
  297. # define X509_V_ERR_SUBJECT_ISSUER_MISMATCH 29
  298. # define X509_V_ERR_AKID_SKID_MISMATCH 30
  299. # define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH 31
  300. # define X509_V_ERR_KEYUSAGE_NO_CERTSIGN 32
  301. # define X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER 33
  302. # define X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION 34
  303. # define X509_V_ERR_KEYUSAGE_NO_CRL_SIGN 35
  304. # define X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION 36
  305. # define X509_V_ERR_INVALID_NON_CA 37
  306. # define X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED 38
  307. # define X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE 39
  308. # define X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED 40
  309. # define X509_V_ERR_INVALID_EXTENSION 41
  310. # define X509_V_ERR_INVALID_POLICY_EXTENSION 42
  311. # define X509_V_ERR_NO_EXPLICIT_POLICY 43
  312. # define X509_V_ERR_DIFFERENT_CRL_SCOPE 44
  313. # define X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE 45
  314. # define X509_V_ERR_UNNESTED_RESOURCE 46
  315. # define X509_V_ERR_PERMITTED_VIOLATION 47
  316. # define X509_V_ERR_EXCLUDED_VIOLATION 48
  317. # define X509_V_ERR_SUBTREE_MINMAX 49
  318. /* The application is not happy */
  319. # define X509_V_ERR_APPLICATION_VERIFICATION 50
  320. # define X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE 51
  321. # define X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX 52
  322. # define X509_V_ERR_UNSUPPORTED_NAME_SYNTAX 53
  323. # define X509_V_ERR_CRL_PATH_VALIDATION_ERROR 54
  324. /* Another issuer check debug option */
  325. # define X509_V_ERR_PATH_LOOP 55
  326. /* Suite B mode algorithm violation */
  327. # define X509_V_ERR_SUITE_B_INVALID_VERSION 56
  328. # define X509_V_ERR_SUITE_B_INVALID_ALGORITHM 57
  329. # define X509_V_ERR_SUITE_B_INVALID_CURVE 58
  330. # define X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM 59
  331. # define X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED 60
  332. # define X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256 61
  333. /* Host, email and IP check errors */
  334. # define X509_V_ERR_HOSTNAME_MISMATCH 62
  335. # define X509_V_ERR_EMAIL_MISMATCH 63
  336. # define X509_V_ERR_IP_ADDRESS_MISMATCH 64
  337. /* DANE TLSA errors */
  338. # define X509_V_ERR_DANE_NO_MATCH 65
  339. /* security level errors */
  340. # define X509_V_ERR_EE_KEY_TOO_SMALL 66
  341. # define X509_V_ERR_CA_KEY_TOO_SMALL 67
  342. # define X509_V_ERR_CA_MD_TOO_WEAK 68
  343. /* Caller error */
  344. # define X509_V_ERR_INVALID_CALL 69
  345. /* Issuer lookup error */
  346. # define X509_V_ERR_STORE_LOOKUP 70
  347. /* Certificate transparency */
  348. # define X509_V_ERR_NO_VALID_SCTS 71
  349. # define X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION 72
  350. /* OCSP status errors */
  351. # define X509_V_ERR_OCSP_VERIFY_NEEDED 73 /* Need OCSP verification */
  352. # define X509_V_ERR_OCSP_VERIFY_FAILED 74 /* Couldn't verify cert through OCSP */
  353. # define X509_V_ERR_OCSP_CERT_UNKNOWN 75 /* Certificate wasn't recognized by the OCSP responder */
  354. # define X509_V_ERR_UNSUPPORTED_SIGNATURE_ALGORITHM 76
  355. # define X509_V_ERR_SIGNATURE_ALGORITHM_MISMATCH 77
  356. /* Errors in case a check in X509_V_FLAG_X509_STRICT mode fails */
  357. # define X509_V_ERR_SIGNATURE_ALGORITHM_INCONSISTENCY 78
  358. # define X509_V_ERR_INVALID_CA 79
  359. # define X509_V_ERR_PATHLEN_INVALID_FOR_NON_CA 80
  360. # define X509_V_ERR_PATHLEN_WITHOUT_KU_KEY_CERT_SIGN 81
  361. # define X509_V_ERR_KU_KEY_CERT_SIGN_INVALID_FOR_NON_CA 82
  362. # define X509_V_ERR_ISSUER_NAME_EMPTY 83
  363. # define X509_V_ERR_SUBJECT_NAME_EMPTY 84
  364. # define X509_V_ERR_MISSING_AUTHORITY_KEY_IDENTIFIER 85
  365. # define X509_V_ERR_MISSING_SUBJECT_KEY_IDENTIFIER 86
  366. # define X509_V_ERR_EMPTY_SUBJECT_ALT_NAME 87
  367. # define X509_V_ERR_EMPTY_SUBJECT_SAN_NOT_CRITICAL 88
  368. # define X509_V_ERR_CA_BCONS_NOT_CRITICAL 89
  369. # define X509_V_ERR_AUTHORITY_KEY_IDENTIFIER_CRITICAL 90
  370. # define X509_V_ERR_SUBJECT_KEY_IDENTIFIER_CRITICAL 91
  371. # define X509_V_ERR_CA_CERT_MISSING_KEY_USAGE 92
  372. # define X509_V_ERR_EXTENSIONS_REQUIRE_VERSION_3 93
  373. # define X509_V_ERR_EC_KEY_EXPLICIT_PARAMS 94
  374. /* Certificate verify flags */
  375. # ifndef OPENSSL_NO_DEPRECATED_1_1_0
  376. # define X509_V_FLAG_CB_ISSUER_CHECK 0x0 /* Deprecated */
  377. # endif
  378. /* Use check time instead of current time */
  379. # define X509_V_FLAG_USE_CHECK_TIME 0x2
  380. /* Lookup CRLs */
  381. # define X509_V_FLAG_CRL_CHECK 0x4
  382. /* Lookup CRLs for whole chain */
  383. # define X509_V_FLAG_CRL_CHECK_ALL 0x8
  384. /* Ignore unhandled critical extensions */
  385. # define X509_V_FLAG_IGNORE_CRITICAL 0x10
  386. /* Disable workarounds for broken certificates */
  387. # define X509_V_FLAG_X509_STRICT 0x20
  388. /* Enable proxy certificate validation */
  389. # define X509_V_FLAG_ALLOW_PROXY_CERTS 0x40
  390. /* Enable policy checking */
  391. # define X509_V_FLAG_POLICY_CHECK 0x80
  392. /* Policy variable require-explicit-policy */
  393. # define X509_V_FLAG_EXPLICIT_POLICY 0x100
  394. /* Policy variable inhibit-any-policy */
  395. # define X509_V_FLAG_INHIBIT_ANY 0x200
  396. /* Policy variable inhibit-policy-mapping */
  397. # define X509_V_FLAG_INHIBIT_MAP 0x400
  398. /* Notify callback that policy is OK */
  399. # define X509_V_FLAG_NOTIFY_POLICY 0x800
  400. /* Extended CRL features such as indirect CRLs, alternate CRL signing keys */
  401. # define X509_V_FLAG_EXTENDED_CRL_SUPPORT 0x1000
  402. /* Delta CRL support */
  403. # define X509_V_FLAG_USE_DELTAS 0x2000
  404. /* Check self-signed CA signature */
  405. # define X509_V_FLAG_CHECK_SS_SIGNATURE 0x4000
  406. /* Use trusted store first */
  407. # define X509_V_FLAG_TRUSTED_FIRST 0x8000
  408. /* Suite B 128 bit only mode: not normally used */
  409. # define X509_V_FLAG_SUITEB_128_LOS_ONLY 0x10000
  410. /* Suite B 192 bit only mode */
  411. # define X509_V_FLAG_SUITEB_192_LOS 0x20000
  412. /* Suite B 128 bit mode allowing 192 bit algorithms */
  413. # define X509_V_FLAG_SUITEB_128_LOS 0x30000
  414. /* Allow partial chains if at least one certificate is in trusted store */
  415. # define X509_V_FLAG_PARTIAL_CHAIN 0x80000
  416. /*
  417. * If the initial chain is not trusted, do not attempt to build an alternative
  418. * chain. Alternate chain checking was introduced in 1.1.0. Setting this flag
  419. * will force the behaviour to match that of previous versions.
  420. */
  421. # define X509_V_FLAG_NO_ALT_CHAINS 0x100000
  422. /* Do not check certificate/CRL validity against current time */
  423. # define X509_V_FLAG_NO_CHECK_TIME 0x200000
  424. # define X509_VP_FLAG_DEFAULT 0x1
  425. # define X509_VP_FLAG_OVERWRITE 0x2
  426. # define X509_VP_FLAG_RESET_FLAGS 0x4
  427. # define X509_VP_FLAG_LOCKED 0x8
  428. # define X509_VP_FLAG_ONCE 0x10
  429. /* Internal use: mask of policy related options */
  430. # define X509_V_FLAG_POLICY_MASK (X509_V_FLAG_POLICY_CHECK \
  431. | X509_V_FLAG_EXPLICIT_POLICY \
  432. | X509_V_FLAG_INHIBIT_ANY \
  433. | X509_V_FLAG_INHIBIT_MAP)
  434. int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, X509_LOOKUP_TYPE type,
  435. const X509_NAME *name);
  436. X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h,
  437. X509_LOOKUP_TYPE type,
  438. const X509_NAME *name);
  439. X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h,
  440. X509_OBJECT *x);
  441. int X509_OBJECT_up_ref_count(X509_OBJECT *a);
  442. X509_OBJECT *X509_OBJECT_new(void);
  443. void X509_OBJECT_free(X509_OBJECT *a);
  444. X509_LOOKUP_TYPE X509_OBJECT_get_type(const X509_OBJECT *a);
  445. X509 *X509_OBJECT_get0_X509(const X509_OBJECT *a);
  446. int X509_OBJECT_set1_X509(X509_OBJECT *a, X509 *obj);
  447. X509_CRL *X509_OBJECT_get0_X509_CRL(const X509_OBJECT *a);
  448. int X509_OBJECT_set1_X509_CRL(X509_OBJECT *a, X509_CRL *obj);
  449. X509_STORE *X509_STORE_new(void);
  450. void X509_STORE_free(X509_STORE *v);
  451. int X509_STORE_lock(X509_STORE *ctx);
  452. int X509_STORE_unlock(X509_STORE *ctx);
  453. int X509_STORE_up_ref(X509_STORE *v);
  454. STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(const X509_STORE *v);
  455. STACK_OF(X509) *X509_STORE_get1_all_certs(X509_STORE *st);
  456. STACK_OF(X509) *X509_STORE_CTX_get1_certs(X509_STORE_CTX *st,
  457. const X509_NAME *nm);
  458. STACK_OF(X509_CRL) *X509_STORE_CTX_get1_crls(const X509_STORE_CTX *st,
  459. const X509_NAME *nm);
  460. int X509_STORE_set_flags(X509_STORE *ctx, unsigned long flags);
  461. int X509_STORE_set_purpose(X509_STORE *ctx, int purpose);
  462. int X509_STORE_set_trust(X509_STORE *ctx, int trust);
  463. int X509_STORE_set1_param(X509_STORE *ctx, const X509_VERIFY_PARAM *pm);
  464. X509_VERIFY_PARAM *X509_STORE_get0_param(const X509_STORE *ctx);
  465. void X509_STORE_set_verify(X509_STORE *ctx, X509_STORE_CTX_verify_fn verify);
  466. #define X509_STORE_set_verify_func(ctx, func) \
  467. X509_STORE_set_verify((ctx),(func))
  468. void X509_STORE_CTX_set_verify(X509_STORE_CTX *ctx,
  469. X509_STORE_CTX_verify_fn verify);
  470. X509_STORE_CTX_verify_fn X509_STORE_get_verify(const X509_STORE *ctx);
  471. void X509_STORE_set_verify_cb(X509_STORE *ctx,
  472. X509_STORE_CTX_verify_cb verify_cb);
  473. # define X509_STORE_set_verify_cb_func(ctx,func) \
  474. X509_STORE_set_verify_cb((ctx),(func))
  475. X509_STORE_CTX_verify_cb X509_STORE_get_verify_cb(const X509_STORE *ctx);
  476. void X509_STORE_set_get_issuer(X509_STORE *ctx,
  477. X509_STORE_CTX_get_issuer_fn get_issuer);
  478. X509_STORE_CTX_get_issuer_fn X509_STORE_get_get_issuer(const X509_STORE *ctx);
  479. void X509_STORE_set_check_issued(X509_STORE *ctx,
  480. X509_STORE_CTX_check_issued_fn check_issued);
  481. X509_STORE_CTX_check_issued_fn X509_STORE_get_check_issued(const X509_STORE *ctx);
  482. void X509_STORE_set_check_revocation(X509_STORE *ctx,
  483. X509_STORE_CTX_check_revocation_fn check_revocation);
  484. X509_STORE_CTX_check_revocation_fn
  485. X509_STORE_get_check_revocation(const X509_STORE *ctx);
  486. void X509_STORE_set_get_crl(X509_STORE *ctx,
  487. X509_STORE_CTX_get_crl_fn get_crl);
  488. X509_STORE_CTX_get_crl_fn X509_STORE_get_get_crl(const X509_STORE *ctx);
  489. void X509_STORE_set_check_crl(X509_STORE *ctx,
  490. X509_STORE_CTX_check_crl_fn check_crl);
  491. X509_STORE_CTX_check_crl_fn X509_STORE_get_check_crl(const X509_STORE *ctx);
  492. void X509_STORE_set_cert_crl(X509_STORE *ctx,
  493. X509_STORE_CTX_cert_crl_fn cert_crl);
  494. X509_STORE_CTX_cert_crl_fn X509_STORE_get_cert_crl(const X509_STORE *ctx);
  495. void X509_STORE_set_check_policy(X509_STORE *ctx,
  496. X509_STORE_CTX_check_policy_fn check_policy);
  497. X509_STORE_CTX_check_policy_fn X509_STORE_get_check_policy(const X509_STORE *ctx);
  498. void X509_STORE_set_lookup_certs(X509_STORE *ctx,
  499. X509_STORE_CTX_lookup_certs_fn lookup_certs);
  500. X509_STORE_CTX_lookup_certs_fn X509_STORE_get_lookup_certs(const X509_STORE *ctx);
  501. void X509_STORE_set_lookup_crls(X509_STORE *ctx,
  502. X509_STORE_CTX_lookup_crls_fn lookup_crls);
  503. #define X509_STORE_set_lookup_crls_cb(ctx, func) \
  504. X509_STORE_set_lookup_crls((ctx), (func))
  505. X509_STORE_CTX_lookup_crls_fn X509_STORE_get_lookup_crls(const X509_STORE *ctx);
  506. void X509_STORE_set_cleanup(X509_STORE *ctx,
  507. X509_STORE_CTX_cleanup_fn cleanup);
  508. X509_STORE_CTX_cleanup_fn X509_STORE_get_cleanup(const X509_STORE *ctx);
  509. #define X509_STORE_get_ex_new_index(l, p, newf, dupf, freef) \
  510. CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE, l, p, newf, dupf, freef)
  511. int X509_STORE_set_ex_data(X509_STORE *ctx, int idx, void *data);
  512. void *X509_STORE_get_ex_data(const X509_STORE *ctx, int idx);
  513. X509_STORE_CTX *X509_STORE_CTX_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
  514. X509_STORE_CTX *X509_STORE_CTX_new(void);
  515. int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x);
  516. void X509_STORE_CTX_free(X509_STORE_CTX *ctx);
  517. int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *trust_store,
  518. X509 *target, STACK_OF(X509) *untrusted);
  519. void X509_STORE_CTX_set0_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);
  520. void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx);
  521. X509_STORE *X509_STORE_CTX_get0_store(const X509_STORE_CTX *ctx);
  522. X509 *X509_STORE_CTX_get0_cert(const X509_STORE_CTX *ctx);
  523. STACK_OF(X509)* X509_STORE_CTX_get0_untrusted(const X509_STORE_CTX *ctx);
  524. void X509_STORE_CTX_set0_untrusted(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);
  525. void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx,
  526. X509_STORE_CTX_verify_cb verify);
  527. X509_STORE_CTX_verify_cb X509_STORE_CTX_get_verify_cb(const X509_STORE_CTX *ctx);
  528. X509_STORE_CTX_verify_fn X509_STORE_CTX_get_verify(const X509_STORE_CTX *ctx);
  529. X509_STORE_CTX_get_issuer_fn X509_STORE_CTX_get_get_issuer(const X509_STORE_CTX *ctx);
  530. X509_STORE_CTX_check_issued_fn X509_STORE_CTX_get_check_issued(const X509_STORE_CTX *ctx);
  531. X509_STORE_CTX_check_revocation_fn X509_STORE_CTX_get_check_revocation(const X509_STORE_CTX *ctx);
  532. X509_STORE_CTX_get_crl_fn X509_STORE_CTX_get_get_crl(const X509_STORE_CTX *ctx);
  533. X509_STORE_CTX_check_crl_fn X509_STORE_CTX_get_check_crl(const X509_STORE_CTX *ctx);
  534. X509_STORE_CTX_cert_crl_fn X509_STORE_CTX_get_cert_crl(const X509_STORE_CTX *ctx);
  535. X509_STORE_CTX_check_policy_fn X509_STORE_CTX_get_check_policy(const X509_STORE_CTX *ctx);
  536. X509_STORE_CTX_lookup_certs_fn X509_STORE_CTX_get_lookup_certs(const X509_STORE_CTX *ctx);
  537. X509_STORE_CTX_lookup_crls_fn X509_STORE_CTX_get_lookup_crls(const X509_STORE_CTX *ctx);
  538. X509_STORE_CTX_cleanup_fn X509_STORE_CTX_get_cleanup(const X509_STORE_CTX *ctx);
  539. #ifndef OPENSSL_NO_DEPRECATED_1_1_0
  540. # define X509_STORE_CTX_get_chain X509_STORE_CTX_get0_chain
  541. # define X509_STORE_CTX_set_chain X509_STORE_CTX_set0_untrusted
  542. # define X509_STORE_CTX_trusted_stack X509_STORE_CTX_set0_trusted_stack
  543. # define X509_STORE_get_by_subject X509_STORE_CTX_get_by_subject
  544. # define X509_STORE_get1_certs X509_STORE_CTX_get1_certs
  545. # define X509_STORE_get1_crls X509_STORE_CTX_get1_crls
  546. /* the following macro is misspelled; use X509_STORE_get1_certs instead */
  547. # define X509_STORE_get1_cert X509_STORE_CTX_get1_certs
  548. /* the following macro is misspelled; use X509_STORE_get1_crls instead */
  549. # define X509_STORE_get1_crl X509_STORE_CTX_get1_crls
  550. #endif
  551. X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m);
  552. X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void);
  553. X509_LOOKUP_METHOD *X509_LOOKUP_file(void);
  554. X509_LOOKUP_METHOD *X509_LOOKUP_store(void);
  555. typedef int (*X509_LOOKUP_ctrl_fn)(X509_LOOKUP *ctx, int cmd, const char *argc,
  556. long argl, char **ret);
  557. typedef int (*X509_LOOKUP_ctrl_ex_fn)(
  558. X509_LOOKUP *ctx, int cmd, const char *argc, long argl, char **ret,
  559. OSSL_LIB_CTX *libctx, const char *propq);
  560. typedef int (*X509_LOOKUP_get_by_subject_fn)(X509_LOOKUP *ctx,
  561. X509_LOOKUP_TYPE type,
  562. const X509_NAME *name,
  563. X509_OBJECT *ret);
  564. typedef int (*X509_LOOKUP_get_by_subject_ex_fn)(X509_LOOKUP *ctx,
  565. X509_LOOKUP_TYPE type,
  566. const X509_NAME *name,
  567. X509_OBJECT *ret,
  568. OSSL_LIB_CTX *libctx,
  569. const char *propq);
  570. typedef int (*X509_LOOKUP_get_by_issuer_serial_fn)(X509_LOOKUP *ctx,
  571. X509_LOOKUP_TYPE type,
  572. const X509_NAME *name,
  573. const ASN1_INTEGER *serial,
  574. X509_OBJECT *ret);
  575. typedef int (*X509_LOOKUP_get_by_fingerprint_fn)(X509_LOOKUP *ctx,
  576. X509_LOOKUP_TYPE type,
  577. const unsigned char* bytes,
  578. int len,
  579. X509_OBJECT *ret);
  580. typedef int (*X509_LOOKUP_get_by_alias_fn)(X509_LOOKUP *ctx,
  581. X509_LOOKUP_TYPE type,
  582. const char *str,
  583. int len,
  584. X509_OBJECT *ret);
  585. X509_LOOKUP_METHOD *X509_LOOKUP_meth_new(const char *name);
  586. void X509_LOOKUP_meth_free(X509_LOOKUP_METHOD *method);
  587. int X509_LOOKUP_meth_set_new_item(X509_LOOKUP_METHOD *method,
  588. int (*new_item) (X509_LOOKUP *ctx));
  589. int (*X509_LOOKUP_meth_get_new_item(const X509_LOOKUP_METHOD* method))
  590. (X509_LOOKUP *ctx);
  591. int X509_LOOKUP_meth_set_free(X509_LOOKUP_METHOD *method,
  592. void (*free_fn) (X509_LOOKUP *ctx));
  593. void (*X509_LOOKUP_meth_get_free(const X509_LOOKUP_METHOD* method))
  594. (X509_LOOKUP *ctx);
  595. int X509_LOOKUP_meth_set_init(X509_LOOKUP_METHOD *method,
  596. int (*init) (X509_LOOKUP *ctx));
  597. int (*X509_LOOKUP_meth_get_init(const X509_LOOKUP_METHOD* method))
  598. (X509_LOOKUP *ctx);
  599. int X509_LOOKUP_meth_set_shutdown(X509_LOOKUP_METHOD *method,
  600. int (*shutdown) (X509_LOOKUP *ctx));
  601. int (*X509_LOOKUP_meth_get_shutdown(const X509_LOOKUP_METHOD* method))
  602. (X509_LOOKUP *ctx);
  603. int X509_LOOKUP_meth_set_ctrl(X509_LOOKUP_METHOD *method,
  604. X509_LOOKUP_ctrl_fn ctrl_fn);
  605. X509_LOOKUP_ctrl_fn X509_LOOKUP_meth_get_ctrl(const X509_LOOKUP_METHOD *method);
  606. int X509_LOOKUP_meth_set_get_by_subject(X509_LOOKUP_METHOD *method,
  607. X509_LOOKUP_get_by_subject_fn fn);
  608. X509_LOOKUP_get_by_subject_fn X509_LOOKUP_meth_get_get_by_subject(
  609. const X509_LOOKUP_METHOD *method);
  610. int X509_LOOKUP_meth_set_get_by_issuer_serial(X509_LOOKUP_METHOD *method,
  611. X509_LOOKUP_get_by_issuer_serial_fn fn);
  612. X509_LOOKUP_get_by_issuer_serial_fn X509_LOOKUP_meth_get_get_by_issuer_serial(
  613. const X509_LOOKUP_METHOD *method);
  614. int X509_LOOKUP_meth_set_get_by_fingerprint(X509_LOOKUP_METHOD *method,
  615. X509_LOOKUP_get_by_fingerprint_fn fn);
  616. X509_LOOKUP_get_by_fingerprint_fn X509_LOOKUP_meth_get_get_by_fingerprint(
  617. const X509_LOOKUP_METHOD *method);
  618. int X509_LOOKUP_meth_set_get_by_alias(X509_LOOKUP_METHOD *method,
  619. X509_LOOKUP_get_by_alias_fn fn);
  620. X509_LOOKUP_get_by_alias_fn X509_LOOKUP_meth_get_get_by_alias(
  621. const X509_LOOKUP_METHOD *method);
  622. int X509_STORE_add_cert(X509_STORE *ctx, X509 *x);
  623. int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x);
  624. int X509_STORE_CTX_get_by_subject(const X509_STORE_CTX *vs,
  625. X509_LOOKUP_TYPE type,
  626. const X509_NAME *name, X509_OBJECT *ret);
  627. X509_OBJECT *X509_STORE_CTX_get_obj_by_subject(X509_STORE_CTX *vs,
  628. X509_LOOKUP_TYPE type,
  629. const X509_NAME *name);
  630. int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
  631. long argl, char **ret);
  632. int X509_LOOKUP_ctrl_ex(X509_LOOKUP *ctx, int cmd, const char *argc, long argl,
  633. char **ret, OSSL_LIB_CTX *libctx, const char *propq);
  634. int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type);
  635. int X509_load_cert_file_ex(X509_LOOKUP *ctx, const char *file, int type,
  636. OSSL_LIB_CTX *libctx, const char *propq);
  637. int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type);
  638. int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type);
  639. int X509_load_cert_crl_file_ex(X509_LOOKUP *ctx, const char *file, int type,
  640. OSSL_LIB_CTX *libctx, const char *propq);
  641. X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method);
  642. void X509_LOOKUP_free(X509_LOOKUP *ctx);
  643. int X509_LOOKUP_init(X509_LOOKUP *ctx);
  644. int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
  645. const X509_NAME *name, X509_OBJECT *ret);
  646. int X509_LOOKUP_by_subject_ex(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
  647. const X509_NAME *name, X509_OBJECT *ret,
  648. OSSL_LIB_CTX *libctx, const char *propq);
  649. int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
  650. const X509_NAME *name,
  651. const ASN1_INTEGER *serial,
  652. X509_OBJECT *ret);
  653. int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
  654. const unsigned char *bytes, int len,
  655. X509_OBJECT *ret);
  656. int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
  657. const char *str, int len, X509_OBJECT *ret);
  658. int X509_LOOKUP_set_method_data(X509_LOOKUP *ctx, void *data);
  659. void *X509_LOOKUP_get_method_data(const X509_LOOKUP *ctx);
  660. X509_STORE *X509_LOOKUP_get_store(const X509_LOOKUP *ctx);
  661. int X509_LOOKUP_shutdown(X509_LOOKUP *ctx);
  662. int X509_STORE_load_file(X509_STORE *ctx, const char *file);
  663. int X509_STORE_load_path(X509_STORE *ctx, const char *path);
  664. int X509_STORE_load_store(X509_STORE *ctx, const char *store);
  665. int X509_STORE_load_locations(X509_STORE *ctx,
  666. const char *file,
  667. const char *dir);
  668. int X509_STORE_set_default_paths(X509_STORE *ctx);
  669. int X509_STORE_load_file_ex(X509_STORE *ctx, const char *file,
  670. OSSL_LIB_CTX *libctx, const char *propq);
  671. int X509_STORE_load_store_ex(X509_STORE *ctx, const char *store,
  672. OSSL_LIB_CTX *libctx, const char *propq);
  673. int X509_STORE_load_locations_ex(X509_STORE *ctx, const char *file,
  674. const char *dir, OSSL_LIB_CTX *libctx,
  675. const char *propq);
  676. int X509_STORE_set_default_paths_ex(X509_STORE *ctx, OSSL_LIB_CTX *libctx,
  677. const char *propq);
  678. #define X509_STORE_CTX_get_ex_new_index(l, p, newf, dupf, freef) \
  679. CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE_CTX, l, p, newf, dupf, freef)
  680. int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx, int idx, void *data);
  681. void *X509_STORE_CTX_get_ex_data(const X509_STORE_CTX *ctx, int idx);
  682. int X509_STORE_CTX_get_error(const X509_STORE_CTX *ctx);
  683. void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx, int s);
  684. int X509_STORE_CTX_get_error_depth(const X509_STORE_CTX *ctx);
  685. void X509_STORE_CTX_set_error_depth(X509_STORE_CTX *ctx, int depth);
  686. X509 *X509_STORE_CTX_get_current_cert(const X509_STORE_CTX *ctx);
  687. void X509_STORE_CTX_set_current_cert(X509_STORE_CTX *ctx, X509 *x);
  688. X509 *X509_STORE_CTX_get0_current_issuer(const X509_STORE_CTX *ctx);
  689. X509_CRL *X509_STORE_CTX_get0_current_crl(const X509_STORE_CTX *ctx);
  690. X509_STORE_CTX *X509_STORE_CTX_get0_parent_ctx(const X509_STORE_CTX *ctx);
  691. STACK_OF(X509) *X509_STORE_CTX_get0_chain(const X509_STORE_CTX *ctx);
  692. STACK_OF(X509) *X509_STORE_CTX_get1_chain(const X509_STORE_CTX *ctx);
  693. void X509_STORE_CTX_set_cert(X509_STORE_CTX *ctx, X509 *target);
  694. void X509_STORE_CTX_set0_verified_chain(X509_STORE_CTX *c, STACK_OF(X509) *sk);
  695. void X509_STORE_CTX_set0_crls(X509_STORE_CTX *ctx, STACK_OF(X509_CRL) *sk);
  696. int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose);
  697. int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust);
  698. int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose,
  699. int purpose, int trust);
  700. void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, unsigned long flags);
  701. void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags,
  702. time_t t);
  703. X509_POLICY_TREE *X509_STORE_CTX_get0_policy_tree(const X509_STORE_CTX *ctx);
  704. int X509_STORE_CTX_get_explicit_policy(const X509_STORE_CTX *ctx);
  705. int X509_STORE_CTX_get_num_untrusted(const X509_STORE_CTX *ctx);
  706. X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(const X509_STORE_CTX *ctx);
  707. void X509_STORE_CTX_set0_param(X509_STORE_CTX *ctx, X509_VERIFY_PARAM *param);
  708. int X509_STORE_CTX_set_default(X509_STORE_CTX *ctx, const char *name);
  709. /*
  710. * Bridge opacity barrier between libcrypt and libssl, also needed to support
  711. * offline testing in test/danetest.c
  712. */
  713. void X509_STORE_CTX_set0_dane(X509_STORE_CTX *ctx, SSL_DANE *dane);
  714. #define DANE_FLAG_NO_DANE_EE_NAMECHECKS (1L << 0)
  715. /* X509_VERIFY_PARAM functions */
  716. X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void);
  717. void X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param);
  718. int X509_VERIFY_PARAM_inherit(X509_VERIFY_PARAM *to,
  719. const X509_VERIFY_PARAM *from);
  720. int X509_VERIFY_PARAM_set1(X509_VERIFY_PARAM *to,
  721. const X509_VERIFY_PARAM *from);
  722. int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name);
  723. int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param,
  724. unsigned long flags);
  725. int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param,
  726. unsigned long flags);
  727. unsigned long X509_VERIFY_PARAM_get_flags(const X509_VERIFY_PARAM *param);
  728. int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose);
  729. int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust);
  730. void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth);
  731. void X509_VERIFY_PARAM_set_auth_level(X509_VERIFY_PARAM *param, int auth_level);
  732. time_t X509_VERIFY_PARAM_get_time(const X509_VERIFY_PARAM *param);
  733. void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t);
  734. int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param,
  735. ASN1_OBJECT *policy);
  736. int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param,
  737. STACK_OF(ASN1_OBJECT) *policies);
  738. int X509_VERIFY_PARAM_set_inh_flags(X509_VERIFY_PARAM *param,
  739. uint32_t flags);
  740. uint32_t X509_VERIFY_PARAM_get_inh_flags(const X509_VERIFY_PARAM *param);
  741. char *X509_VERIFY_PARAM_get0_host(X509_VERIFY_PARAM *param, int idx);
  742. int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param,
  743. const char *name, size_t namelen);
  744. int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param,
  745. const char *name, size_t namelen);
  746. void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param,
  747. unsigned int flags);
  748. unsigned int X509_VERIFY_PARAM_get_hostflags(const X509_VERIFY_PARAM *param);
  749. char *X509_VERIFY_PARAM_get0_peername(const X509_VERIFY_PARAM *param);
  750. void X509_VERIFY_PARAM_move_peername(X509_VERIFY_PARAM *, X509_VERIFY_PARAM *);
  751. char *X509_VERIFY_PARAM_get0_email(X509_VERIFY_PARAM *param);
  752. int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param,
  753. const char *email, size_t emaillen);
  754. char *X509_VERIFY_PARAM_get1_ip_asc(X509_VERIFY_PARAM *param);
  755. int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param,
  756. const unsigned char *ip, size_t iplen);
  757. int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param,
  758. const char *ipasc);
  759. int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param);
  760. int X509_VERIFY_PARAM_get_auth_level(const X509_VERIFY_PARAM *param);
  761. const char *X509_VERIFY_PARAM_get0_name(const X509_VERIFY_PARAM *param);
  762. int X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param);
  763. int X509_VERIFY_PARAM_get_count(void);
  764. const X509_VERIFY_PARAM *X509_VERIFY_PARAM_get0(int id);
  765. const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name);
  766. void X509_VERIFY_PARAM_table_cleanup(void);
  767. /* Non positive return values are errors */
  768. #define X509_PCY_TREE_FAILURE -2 /* Failure to satisfy explicit policy */
  769. #define X509_PCY_TREE_INVALID -1 /* Inconsistent or invalid extensions */
  770. #define X509_PCY_TREE_INTERNAL 0 /* Internal error, most likely malloc */
  771. /*
  772. * Positive return values form a bit mask, all but the first are internal to
  773. * the library and don't appear in results from X509_policy_check().
  774. */
  775. #define X509_PCY_TREE_VALID 1 /* The policy tree is valid */
  776. #define X509_PCY_TREE_EMPTY 2 /* The policy tree is empty */
  777. #define X509_PCY_TREE_EXPLICIT 4 /* Explicit policy required */
  778. int X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy,
  779. STACK_OF(X509) *certs,
  780. STACK_OF(ASN1_OBJECT) *policy_oids, unsigned int flags);
  781. void X509_policy_tree_free(X509_POLICY_TREE *tree);
  782. int X509_policy_tree_level_count(const X509_POLICY_TREE *tree);
  783. X509_POLICY_LEVEL *X509_policy_tree_get0_level(const X509_POLICY_TREE *tree,
  784. int i);
  785. STACK_OF(X509_POLICY_NODE)
  786. *X509_policy_tree_get0_policies(const X509_POLICY_TREE *tree);
  787. STACK_OF(X509_POLICY_NODE)
  788. *X509_policy_tree_get0_user_policies(const X509_POLICY_TREE *tree);
  789. int X509_policy_level_node_count(X509_POLICY_LEVEL *level);
  790. X509_POLICY_NODE *X509_policy_level_get0_node(const X509_POLICY_LEVEL *level,
  791. int i);
  792. const ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node);
  793. STACK_OF(POLICYQUALINFO)
  794. *X509_policy_node_get0_qualifiers(const X509_POLICY_NODE *node);
  795. const X509_POLICY_NODE
  796. *X509_policy_node_get0_parent(const X509_POLICY_NODE *node);
  797. #ifdef __cplusplus
  798. }
  799. #endif
  800. #endif