11cb0ef41Sopenharmony_ci/* 21cb0ef41Sopenharmony_ci * {- join("\n * ", @autowarntext) -} 31cb0ef41Sopenharmony_ci * 41cb0ef41Sopenharmony_ci * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. 51cb0ef41Sopenharmony_ci * 61cb0ef41Sopenharmony_ci * Licensed under the Apache License 2.0 (the "License"). You may not use 71cb0ef41Sopenharmony_ci * this file except in compliance with the License. You can obtain a copy 81cb0ef41Sopenharmony_ci * in the file LICENSE in the source distribution or at 91cb0ef41Sopenharmony_ci * https://www.openssl.org/source/license.html 101cb0ef41Sopenharmony_ci */ 111cb0ef41Sopenharmony_ci 121cb0ef41Sopenharmony_ci{- 131cb0ef41Sopenharmony_ciuse OpenSSL::stackhash qw(generate_stack_macros); 141cb0ef41Sopenharmony_ci-} 151cb0ef41Sopenharmony_ci 161cb0ef41Sopenharmony_ci#ifndef OPENSSL_X509_VFY_H 171cb0ef41Sopenharmony_ci# define OPENSSL_X509_VFY_H 181cb0ef41Sopenharmony_ci# pragma once 191cb0ef41Sopenharmony_ci 201cb0ef41Sopenharmony_ci# include <openssl/macros.h> 211cb0ef41Sopenharmony_ci# ifndef OPENSSL_NO_DEPRECATED_3_0 221cb0ef41Sopenharmony_ci# define HEADER_X509_VFY_H 231cb0ef41Sopenharmony_ci# endif 241cb0ef41Sopenharmony_ci 251cb0ef41Sopenharmony_ci/* 261cb0ef41Sopenharmony_ci * Protect against recursion, x509.h and x509_vfy.h each include the other. 271cb0ef41Sopenharmony_ci */ 281cb0ef41Sopenharmony_ci# ifndef OPENSSL_X509_H 291cb0ef41Sopenharmony_ci# include <openssl/x509.h> 301cb0ef41Sopenharmony_ci# endif 311cb0ef41Sopenharmony_ci 321cb0ef41Sopenharmony_ci# include <openssl/opensslconf.h> 331cb0ef41Sopenharmony_ci# include <openssl/lhash.h> 341cb0ef41Sopenharmony_ci# include <openssl/bio.h> 351cb0ef41Sopenharmony_ci# include <openssl/crypto.h> 361cb0ef41Sopenharmony_ci# include <openssl/symhacks.h> 371cb0ef41Sopenharmony_ci 381cb0ef41Sopenharmony_ci#ifdef __cplusplus 391cb0ef41Sopenharmony_ciextern "C" { 401cb0ef41Sopenharmony_ci#endif 411cb0ef41Sopenharmony_ci 421cb0ef41Sopenharmony_ci/*- 431cb0ef41Sopenharmony_ciSSL_CTX -> X509_STORE 441cb0ef41Sopenharmony_ci -> X509_LOOKUP 451cb0ef41Sopenharmony_ci ->X509_LOOKUP_METHOD 461cb0ef41Sopenharmony_ci -> X509_LOOKUP 471cb0ef41Sopenharmony_ci ->X509_LOOKUP_METHOD 481cb0ef41Sopenharmony_ci 491cb0ef41Sopenharmony_ciSSL -> X509_STORE_CTX 501cb0ef41Sopenharmony_ci ->X509_STORE 511cb0ef41Sopenharmony_ci 521cb0ef41Sopenharmony_ciThe X509_STORE holds the tables etc for verification stuff. 531cb0ef41Sopenharmony_ciA X509_STORE_CTX is used while validating a single certificate. 541cb0ef41Sopenharmony_ciThe X509_STORE has X509_LOOKUPs for looking up certs. 551cb0ef41Sopenharmony_ciThe X509_STORE then calls a function to actually verify the 561cb0ef41Sopenharmony_cicertificate chain. 571cb0ef41Sopenharmony_ci*/ 581cb0ef41Sopenharmony_ci 591cb0ef41Sopenharmony_citypedef enum { 601cb0ef41Sopenharmony_ci X509_LU_NONE = 0, 611cb0ef41Sopenharmony_ci X509_LU_X509, X509_LU_CRL 621cb0ef41Sopenharmony_ci} X509_LOOKUP_TYPE; 631cb0ef41Sopenharmony_ci 641cb0ef41Sopenharmony_ci#ifndef OPENSSL_NO_DEPRECATED_1_1_0 651cb0ef41Sopenharmony_ci#define X509_LU_RETRY -1 661cb0ef41Sopenharmony_ci#define X509_LU_FAIL 0 671cb0ef41Sopenharmony_ci#endif 681cb0ef41Sopenharmony_ci 691cb0ef41Sopenharmony_ci{- 701cb0ef41Sopenharmony_ci generate_stack_macros("X509_LOOKUP") 711cb0ef41Sopenharmony_ci .generate_stack_macros("X509_OBJECT") 721cb0ef41Sopenharmony_ci .generate_stack_macros("X509_VERIFY_PARAM"); 731cb0ef41Sopenharmony_ci-} 741cb0ef41Sopenharmony_ci 751cb0ef41Sopenharmony_ci/* This is used for a table of trust checking functions */ 761cb0ef41Sopenharmony_citypedef struct x509_trust_st { 771cb0ef41Sopenharmony_ci int trust; 781cb0ef41Sopenharmony_ci int flags; 791cb0ef41Sopenharmony_ci int (*check_trust) (struct x509_trust_st *, X509 *, int); 801cb0ef41Sopenharmony_ci char *name; 811cb0ef41Sopenharmony_ci int arg1; 821cb0ef41Sopenharmony_ci void *arg2; 831cb0ef41Sopenharmony_ci} X509_TRUST; 841cb0ef41Sopenharmony_ci{- 851cb0ef41Sopenharmony_ci generate_stack_macros("X509_TRUST"); 861cb0ef41Sopenharmony_ci-} 871cb0ef41Sopenharmony_ci 881cb0ef41Sopenharmony_ci/* standard trust ids */ 891cb0ef41Sopenharmony_ci# define X509_TRUST_DEFAULT 0 /* Only valid in purpose settings */ 901cb0ef41Sopenharmony_ci# define X509_TRUST_COMPAT 1 911cb0ef41Sopenharmony_ci# define X509_TRUST_SSL_CLIENT 2 921cb0ef41Sopenharmony_ci# define X509_TRUST_SSL_SERVER 3 931cb0ef41Sopenharmony_ci# define X509_TRUST_EMAIL 4 941cb0ef41Sopenharmony_ci# define X509_TRUST_OBJECT_SIGN 5 951cb0ef41Sopenharmony_ci# define X509_TRUST_OCSP_SIGN 6 961cb0ef41Sopenharmony_ci# define X509_TRUST_OCSP_REQUEST 7 971cb0ef41Sopenharmony_ci# define X509_TRUST_TSA 8 981cb0ef41Sopenharmony_ci/* Keep these up to date! */ 991cb0ef41Sopenharmony_ci# define X509_TRUST_MIN 1 1001cb0ef41Sopenharmony_ci# define X509_TRUST_MAX 8 1011cb0ef41Sopenharmony_ci 1021cb0ef41Sopenharmony_ci/* trust_flags values */ 1031cb0ef41Sopenharmony_ci# define X509_TRUST_DYNAMIC (1U << 0) 1041cb0ef41Sopenharmony_ci# define X509_TRUST_DYNAMIC_NAME (1U << 1) 1051cb0ef41Sopenharmony_ci/* No compat trust if self-signed, preempts "DO_SS" */ 1061cb0ef41Sopenharmony_ci# define X509_TRUST_NO_SS_COMPAT (1U << 2) 1071cb0ef41Sopenharmony_ci/* Compat trust if no explicit accepted trust EKUs */ 1081cb0ef41Sopenharmony_ci# define X509_TRUST_DO_SS_COMPAT (1U << 3) 1091cb0ef41Sopenharmony_ci/* Accept "anyEKU" as a wildcard rejection OID and as a wildcard trust OID */ 1101cb0ef41Sopenharmony_ci# define X509_TRUST_OK_ANY_EKU (1U << 4) 1111cb0ef41Sopenharmony_ci 1121cb0ef41Sopenharmony_ci/* check_trust return codes */ 1131cb0ef41Sopenharmony_ci# define X509_TRUST_TRUSTED 1 1141cb0ef41Sopenharmony_ci# define X509_TRUST_REJECTED 2 1151cb0ef41Sopenharmony_ci# define X509_TRUST_UNTRUSTED 3 1161cb0ef41Sopenharmony_ci 1171cb0ef41Sopenharmony_ciint X509_TRUST_set(int *t, int trust); 1181cb0ef41Sopenharmony_ciint X509_TRUST_get_count(void); 1191cb0ef41Sopenharmony_ciX509_TRUST *X509_TRUST_get0(int idx); 1201cb0ef41Sopenharmony_ciint X509_TRUST_get_by_id(int id); 1211cb0ef41Sopenharmony_ciint X509_TRUST_add(int id, int flags, int (*ck) (X509_TRUST *, X509 *, int), 1221cb0ef41Sopenharmony_ci const char *name, int arg1, void *arg2); 1231cb0ef41Sopenharmony_civoid X509_TRUST_cleanup(void); 1241cb0ef41Sopenharmony_ciint X509_TRUST_get_flags(const X509_TRUST *xp); 1251cb0ef41Sopenharmony_cichar *X509_TRUST_get0_name(const X509_TRUST *xp); 1261cb0ef41Sopenharmony_ciint X509_TRUST_get_trust(const X509_TRUST *xp); 1271cb0ef41Sopenharmony_ci 1281cb0ef41Sopenharmony_ciint X509_trusted(const X509 *x); 1291cb0ef41Sopenharmony_ciint X509_add1_trust_object(X509 *x, const ASN1_OBJECT *obj); 1301cb0ef41Sopenharmony_ciint X509_add1_reject_object(X509 *x, const ASN1_OBJECT *obj); 1311cb0ef41Sopenharmony_civoid X509_trust_clear(X509 *x); 1321cb0ef41Sopenharmony_civoid X509_reject_clear(X509 *x); 1331cb0ef41Sopenharmony_ciSTACK_OF(ASN1_OBJECT) *X509_get0_trust_objects(X509 *x); 1341cb0ef41Sopenharmony_ciSTACK_OF(ASN1_OBJECT) *X509_get0_reject_objects(X509 *x); 1351cb0ef41Sopenharmony_ci 1361cb0ef41Sopenharmony_ciint (*X509_TRUST_set_default(int (*trust) (int, X509 *, int))) (int, X509 *, 1371cb0ef41Sopenharmony_ci int); 1381cb0ef41Sopenharmony_ciint X509_check_trust(X509 *x, int id, int flags); 1391cb0ef41Sopenharmony_ci 1401cb0ef41Sopenharmony_ciint X509_verify_cert(X509_STORE_CTX *ctx); 1411cb0ef41Sopenharmony_ciint X509_STORE_CTX_verify(X509_STORE_CTX *ctx); 1421cb0ef41Sopenharmony_ciSTACK_OF(X509) *X509_build_chain(X509 *target, STACK_OF(X509) *certs, 1431cb0ef41Sopenharmony_ci X509_STORE *store, int with_self_signed, 1441cb0ef41Sopenharmony_ci OSSL_LIB_CTX *libctx, const char *propq); 1451cb0ef41Sopenharmony_ci 1461cb0ef41Sopenharmony_ciint X509_STORE_set_depth(X509_STORE *store, int depth); 1471cb0ef41Sopenharmony_ci 1481cb0ef41Sopenharmony_citypedef int (*X509_STORE_CTX_verify_cb)(int, X509_STORE_CTX *); 1491cb0ef41Sopenharmony_ciint X509_STORE_CTX_print_verify_cb(int ok, X509_STORE_CTX *ctx); 1501cb0ef41Sopenharmony_citypedef int (*X509_STORE_CTX_verify_fn)(X509_STORE_CTX *); 1511cb0ef41Sopenharmony_citypedef int (*X509_STORE_CTX_get_issuer_fn)(X509 **issuer, 1521cb0ef41Sopenharmony_ci X509_STORE_CTX *ctx, X509 *x); 1531cb0ef41Sopenharmony_citypedef int (*X509_STORE_CTX_check_issued_fn)(X509_STORE_CTX *ctx, 1541cb0ef41Sopenharmony_ci X509 *x, X509 *issuer); 1551cb0ef41Sopenharmony_citypedef int (*X509_STORE_CTX_check_revocation_fn)(X509_STORE_CTX *ctx); 1561cb0ef41Sopenharmony_citypedef int (*X509_STORE_CTX_get_crl_fn)(X509_STORE_CTX *ctx, 1571cb0ef41Sopenharmony_ci X509_CRL **crl, X509 *x); 1581cb0ef41Sopenharmony_citypedef int (*X509_STORE_CTX_check_crl_fn)(X509_STORE_CTX *ctx, X509_CRL *crl); 1591cb0ef41Sopenharmony_citypedef int (*X509_STORE_CTX_cert_crl_fn)(X509_STORE_CTX *ctx, 1601cb0ef41Sopenharmony_ci X509_CRL *crl, X509 *x); 1611cb0ef41Sopenharmony_citypedef int (*X509_STORE_CTX_check_policy_fn)(X509_STORE_CTX *ctx); 1621cb0ef41Sopenharmony_citypedef STACK_OF(X509) 1631cb0ef41Sopenharmony_ci *(*X509_STORE_CTX_lookup_certs_fn)(X509_STORE_CTX *ctx, 1641cb0ef41Sopenharmony_ci const X509_NAME *nm); 1651cb0ef41Sopenharmony_citypedef STACK_OF(X509_CRL) 1661cb0ef41Sopenharmony_ci *(*X509_STORE_CTX_lookup_crls_fn)(const X509_STORE_CTX *ctx, 1671cb0ef41Sopenharmony_ci const X509_NAME *nm); 1681cb0ef41Sopenharmony_citypedef int (*X509_STORE_CTX_cleanup_fn)(X509_STORE_CTX *ctx); 1691cb0ef41Sopenharmony_ci 1701cb0ef41Sopenharmony_civoid X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth); 1711cb0ef41Sopenharmony_ci 1721cb0ef41Sopenharmony_ci# define X509_STORE_CTX_set_app_data(ctx,data) \ 1731cb0ef41Sopenharmony_ci X509_STORE_CTX_set_ex_data(ctx,0,data) 1741cb0ef41Sopenharmony_ci# define X509_STORE_CTX_get_app_data(ctx) \ 1751cb0ef41Sopenharmony_ci X509_STORE_CTX_get_ex_data(ctx,0) 1761cb0ef41Sopenharmony_ci 1771cb0ef41Sopenharmony_ci# define X509_L_FILE_LOAD 1 1781cb0ef41Sopenharmony_ci# define X509_L_ADD_DIR 2 1791cb0ef41Sopenharmony_ci# define X509_L_ADD_STORE 3 1801cb0ef41Sopenharmony_ci# define X509_L_LOAD_STORE 4 1811cb0ef41Sopenharmony_ci 1821cb0ef41Sopenharmony_ci# define X509_LOOKUP_load_file(x,name,type) \ 1831cb0ef41Sopenharmony_ci X509_LOOKUP_ctrl((x),X509_L_FILE_LOAD,(name),(long)(type),NULL) 1841cb0ef41Sopenharmony_ci 1851cb0ef41Sopenharmony_ci# define X509_LOOKUP_add_dir(x,name,type) \ 1861cb0ef41Sopenharmony_ci X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(long)(type),NULL) 1871cb0ef41Sopenharmony_ci 1881cb0ef41Sopenharmony_ci# define X509_LOOKUP_add_store(x,name) \ 1891cb0ef41Sopenharmony_ci X509_LOOKUP_ctrl((x),X509_L_ADD_STORE,(name),0,NULL) 1901cb0ef41Sopenharmony_ci 1911cb0ef41Sopenharmony_ci# define X509_LOOKUP_load_store(x,name) \ 1921cb0ef41Sopenharmony_ci X509_LOOKUP_ctrl((x),X509_L_LOAD_STORE,(name),0,NULL) 1931cb0ef41Sopenharmony_ci 1941cb0ef41Sopenharmony_ci# define X509_LOOKUP_load_file_ex(x, name, type, libctx, propq) \ 1951cb0ef41Sopenharmony_ciX509_LOOKUP_ctrl_ex((x), X509_L_FILE_LOAD, (name), (long)(type), NULL,\ 1961cb0ef41Sopenharmony_ci (libctx), (propq)) 1971cb0ef41Sopenharmony_ci 1981cb0ef41Sopenharmony_ci# define X509_LOOKUP_load_store_ex(x, name, libctx, propq) \ 1991cb0ef41Sopenharmony_ciX509_LOOKUP_ctrl_ex((x), X509_L_LOAD_STORE, (name), 0, NULL, \ 2001cb0ef41Sopenharmony_ci (libctx), (propq)) 2011cb0ef41Sopenharmony_ci 2021cb0ef41Sopenharmony_ci# define X509_LOOKUP_add_store_ex(x, name, libctx, propq) \ 2031cb0ef41Sopenharmony_ciX509_LOOKUP_ctrl_ex((x), X509_L_ADD_STORE, (name), 0, NULL, \ 2041cb0ef41Sopenharmony_ci (libctx), (propq)) 2051cb0ef41Sopenharmony_ci 2061cb0ef41Sopenharmony_ci# define X509_V_OK 0 2071cb0ef41Sopenharmony_ci# define X509_V_ERR_UNSPECIFIED 1 2081cb0ef41Sopenharmony_ci# define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT 2 2091cb0ef41Sopenharmony_ci# define X509_V_ERR_UNABLE_TO_GET_CRL 3 2101cb0ef41Sopenharmony_ci# define X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE 4 2111cb0ef41Sopenharmony_ci# define X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE 5 2121cb0ef41Sopenharmony_ci# define X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY 6 2131cb0ef41Sopenharmony_ci# define X509_V_ERR_CERT_SIGNATURE_FAILURE 7 2141cb0ef41Sopenharmony_ci# define X509_V_ERR_CRL_SIGNATURE_FAILURE 8 2151cb0ef41Sopenharmony_ci# define X509_V_ERR_CERT_NOT_YET_VALID 9 2161cb0ef41Sopenharmony_ci# define X509_V_ERR_CERT_HAS_EXPIRED 10 2171cb0ef41Sopenharmony_ci# define X509_V_ERR_CRL_NOT_YET_VALID 11 2181cb0ef41Sopenharmony_ci# define X509_V_ERR_CRL_HAS_EXPIRED 12 2191cb0ef41Sopenharmony_ci# define X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD 13 2201cb0ef41Sopenharmony_ci# define X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD 14 2211cb0ef41Sopenharmony_ci# define X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD 15 2221cb0ef41Sopenharmony_ci# define X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD 16 2231cb0ef41Sopenharmony_ci# define X509_V_ERR_OUT_OF_MEM 17 2241cb0ef41Sopenharmony_ci# define X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT 18 2251cb0ef41Sopenharmony_ci# define X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN 19 2261cb0ef41Sopenharmony_ci# define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY 20 2271cb0ef41Sopenharmony_ci# define X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE 21 2281cb0ef41Sopenharmony_ci# define X509_V_ERR_CERT_CHAIN_TOO_LONG 22 2291cb0ef41Sopenharmony_ci# define X509_V_ERR_CERT_REVOKED 23 2301cb0ef41Sopenharmony_ci# define X509_V_ERR_NO_ISSUER_PUBLIC_KEY 24 2311cb0ef41Sopenharmony_ci# define X509_V_ERR_PATH_LENGTH_EXCEEDED 25 2321cb0ef41Sopenharmony_ci# define X509_V_ERR_INVALID_PURPOSE 26 2331cb0ef41Sopenharmony_ci# define X509_V_ERR_CERT_UNTRUSTED 27 2341cb0ef41Sopenharmony_ci# define X509_V_ERR_CERT_REJECTED 28 2351cb0ef41Sopenharmony_ci 2361cb0ef41Sopenharmony_ci/* These are 'informational' when looking for issuer cert */ 2371cb0ef41Sopenharmony_ci# define X509_V_ERR_SUBJECT_ISSUER_MISMATCH 29 2381cb0ef41Sopenharmony_ci# define X509_V_ERR_AKID_SKID_MISMATCH 30 2391cb0ef41Sopenharmony_ci# define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH 31 2401cb0ef41Sopenharmony_ci# define X509_V_ERR_KEYUSAGE_NO_CERTSIGN 32 2411cb0ef41Sopenharmony_ci# define X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER 33 2421cb0ef41Sopenharmony_ci# define X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION 34 2431cb0ef41Sopenharmony_ci# define X509_V_ERR_KEYUSAGE_NO_CRL_SIGN 35 2441cb0ef41Sopenharmony_ci# define X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION 36 2451cb0ef41Sopenharmony_ci# define X509_V_ERR_INVALID_NON_CA 37 2461cb0ef41Sopenharmony_ci# define X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED 38 2471cb0ef41Sopenharmony_ci# define X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE 39 2481cb0ef41Sopenharmony_ci# define X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED 40 2491cb0ef41Sopenharmony_ci# define X509_V_ERR_INVALID_EXTENSION 41 2501cb0ef41Sopenharmony_ci# define X509_V_ERR_INVALID_POLICY_EXTENSION 42 2511cb0ef41Sopenharmony_ci# define X509_V_ERR_NO_EXPLICIT_POLICY 43 2521cb0ef41Sopenharmony_ci# define X509_V_ERR_DIFFERENT_CRL_SCOPE 44 2531cb0ef41Sopenharmony_ci# define X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE 45 2541cb0ef41Sopenharmony_ci# define X509_V_ERR_UNNESTED_RESOURCE 46 2551cb0ef41Sopenharmony_ci# define X509_V_ERR_PERMITTED_VIOLATION 47 2561cb0ef41Sopenharmony_ci# define X509_V_ERR_EXCLUDED_VIOLATION 48 2571cb0ef41Sopenharmony_ci# define X509_V_ERR_SUBTREE_MINMAX 49 2581cb0ef41Sopenharmony_ci/* The application is not happy */ 2591cb0ef41Sopenharmony_ci# define X509_V_ERR_APPLICATION_VERIFICATION 50 2601cb0ef41Sopenharmony_ci# define X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE 51 2611cb0ef41Sopenharmony_ci# define X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX 52 2621cb0ef41Sopenharmony_ci# define X509_V_ERR_UNSUPPORTED_NAME_SYNTAX 53 2631cb0ef41Sopenharmony_ci# define X509_V_ERR_CRL_PATH_VALIDATION_ERROR 54 2641cb0ef41Sopenharmony_ci/* Another issuer check debug option */ 2651cb0ef41Sopenharmony_ci# define X509_V_ERR_PATH_LOOP 55 2661cb0ef41Sopenharmony_ci/* Suite B mode algorithm violation */ 2671cb0ef41Sopenharmony_ci# define X509_V_ERR_SUITE_B_INVALID_VERSION 56 2681cb0ef41Sopenharmony_ci# define X509_V_ERR_SUITE_B_INVALID_ALGORITHM 57 2691cb0ef41Sopenharmony_ci# define X509_V_ERR_SUITE_B_INVALID_CURVE 58 2701cb0ef41Sopenharmony_ci# define X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM 59 2711cb0ef41Sopenharmony_ci# define X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED 60 2721cb0ef41Sopenharmony_ci# define X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256 61 2731cb0ef41Sopenharmony_ci/* Host, email and IP check errors */ 2741cb0ef41Sopenharmony_ci# define X509_V_ERR_HOSTNAME_MISMATCH 62 2751cb0ef41Sopenharmony_ci# define X509_V_ERR_EMAIL_MISMATCH 63 2761cb0ef41Sopenharmony_ci# define X509_V_ERR_IP_ADDRESS_MISMATCH 64 2771cb0ef41Sopenharmony_ci/* DANE TLSA errors */ 2781cb0ef41Sopenharmony_ci# define X509_V_ERR_DANE_NO_MATCH 65 2791cb0ef41Sopenharmony_ci/* security level errors */ 2801cb0ef41Sopenharmony_ci# define X509_V_ERR_EE_KEY_TOO_SMALL 66 2811cb0ef41Sopenharmony_ci# define X509_V_ERR_CA_KEY_TOO_SMALL 67 2821cb0ef41Sopenharmony_ci# define X509_V_ERR_CA_MD_TOO_WEAK 68 2831cb0ef41Sopenharmony_ci/* Caller error */ 2841cb0ef41Sopenharmony_ci# define X509_V_ERR_INVALID_CALL 69 2851cb0ef41Sopenharmony_ci/* Issuer lookup error */ 2861cb0ef41Sopenharmony_ci# define X509_V_ERR_STORE_LOOKUP 70 2871cb0ef41Sopenharmony_ci/* Certificate transparency */ 2881cb0ef41Sopenharmony_ci# define X509_V_ERR_NO_VALID_SCTS 71 2891cb0ef41Sopenharmony_ci 2901cb0ef41Sopenharmony_ci# define X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION 72 2911cb0ef41Sopenharmony_ci/* OCSP status errors */ 2921cb0ef41Sopenharmony_ci# define X509_V_ERR_OCSP_VERIFY_NEEDED 73 /* Need OCSP verification */ 2931cb0ef41Sopenharmony_ci# define X509_V_ERR_OCSP_VERIFY_FAILED 74 /* Couldn't verify cert through OCSP */ 2941cb0ef41Sopenharmony_ci# define X509_V_ERR_OCSP_CERT_UNKNOWN 75 /* Certificate wasn't recognized by the OCSP responder */ 2951cb0ef41Sopenharmony_ci 2961cb0ef41Sopenharmony_ci# define X509_V_ERR_UNSUPPORTED_SIGNATURE_ALGORITHM 76 2971cb0ef41Sopenharmony_ci# define X509_V_ERR_SIGNATURE_ALGORITHM_MISMATCH 77 2981cb0ef41Sopenharmony_ci 2991cb0ef41Sopenharmony_ci/* Errors in case a check in X509_V_FLAG_X509_STRICT mode fails */ 3001cb0ef41Sopenharmony_ci# define X509_V_ERR_SIGNATURE_ALGORITHM_INCONSISTENCY 78 3011cb0ef41Sopenharmony_ci# define X509_V_ERR_INVALID_CA 79 3021cb0ef41Sopenharmony_ci# define X509_V_ERR_PATHLEN_INVALID_FOR_NON_CA 80 3031cb0ef41Sopenharmony_ci# define X509_V_ERR_PATHLEN_WITHOUT_KU_KEY_CERT_SIGN 81 3041cb0ef41Sopenharmony_ci# define X509_V_ERR_KU_KEY_CERT_SIGN_INVALID_FOR_NON_CA 82 3051cb0ef41Sopenharmony_ci# define X509_V_ERR_ISSUER_NAME_EMPTY 83 3061cb0ef41Sopenharmony_ci# define X509_V_ERR_SUBJECT_NAME_EMPTY 84 3071cb0ef41Sopenharmony_ci# define X509_V_ERR_MISSING_AUTHORITY_KEY_IDENTIFIER 85 3081cb0ef41Sopenharmony_ci# define X509_V_ERR_MISSING_SUBJECT_KEY_IDENTIFIER 86 3091cb0ef41Sopenharmony_ci# define X509_V_ERR_EMPTY_SUBJECT_ALT_NAME 87 3101cb0ef41Sopenharmony_ci# define X509_V_ERR_EMPTY_SUBJECT_SAN_NOT_CRITICAL 88 3111cb0ef41Sopenharmony_ci# define X509_V_ERR_CA_BCONS_NOT_CRITICAL 89 3121cb0ef41Sopenharmony_ci# define X509_V_ERR_AUTHORITY_KEY_IDENTIFIER_CRITICAL 90 3131cb0ef41Sopenharmony_ci# define X509_V_ERR_SUBJECT_KEY_IDENTIFIER_CRITICAL 91 3141cb0ef41Sopenharmony_ci# define X509_V_ERR_CA_CERT_MISSING_KEY_USAGE 92 3151cb0ef41Sopenharmony_ci# define X509_V_ERR_EXTENSIONS_REQUIRE_VERSION_3 93 3161cb0ef41Sopenharmony_ci# define X509_V_ERR_EC_KEY_EXPLICIT_PARAMS 94 3171cb0ef41Sopenharmony_ci 3181cb0ef41Sopenharmony_ci/* Certificate verify flags */ 3191cb0ef41Sopenharmony_ci# ifndef OPENSSL_NO_DEPRECATED_1_1_0 3201cb0ef41Sopenharmony_ci# define X509_V_FLAG_CB_ISSUER_CHECK 0x0 /* Deprecated */ 3211cb0ef41Sopenharmony_ci# endif 3221cb0ef41Sopenharmony_ci/* Use check time instead of current time */ 3231cb0ef41Sopenharmony_ci# define X509_V_FLAG_USE_CHECK_TIME 0x2 3241cb0ef41Sopenharmony_ci/* Lookup CRLs */ 3251cb0ef41Sopenharmony_ci# define X509_V_FLAG_CRL_CHECK 0x4 3261cb0ef41Sopenharmony_ci/* Lookup CRLs for whole chain */ 3271cb0ef41Sopenharmony_ci# define X509_V_FLAG_CRL_CHECK_ALL 0x8 3281cb0ef41Sopenharmony_ci/* Ignore unhandled critical extensions */ 3291cb0ef41Sopenharmony_ci# define X509_V_FLAG_IGNORE_CRITICAL 0x10 3301cb0ef41Sopenharmony_ci/* Disable workarounds for broken certificates */ 3311cb0ef41Sopenharmony_ci# define X509_V_FLAG_X509_STRICT 0x20 3321cb0ef41Sopenharmony_ci/* Enable proxy certificate validation */ 3331cb0ef41Sopenharmony_ci# define X509_V_FLAG_ALLOW_PROXY_CERTS 0x40 3341cb0ef41Sopenharmony_ci/* Enable policy checking */ 3351cb0ef41Sopenharmony_ci# define X509_V_FLAG_POLICY_CHECK 0x80 3361cb0ef41Sopenharmony_ci/* Policy variable require-explicit-policy */ 3371cb0ef41Sopenharmony_ci# define X509_V_FLAG_EXPLICIT_POLICY 0x100 3381cb0ef41Sopenharmony_ci/* Policy variable inhibit-any-policy */ 3391cb0ef41Sopenharmony_ci# define X509_V_FLAG_INHIBIT_ANY 0x200 3401cb0ef41Sopenharmony_ci/* Policy variable inhibit-policy-mapping */ 3411cb0ef41Sopenharmony_ci# define X509_V_FLAG_INHIBIT_MAP 0x400 3421cb0ef41Sopenharmony_ci/* Notify callback that policy is OK */ 3431cb0ef41Sopenharmony_ci# define X509_V_FLAG_NOTIFY_POLICY 0x800 3441cb0ef41Sopenharmony_ci/* Extended CRL features such as indirect CRLs, alternate CRL signing keys */ 3451cb0ef41Sopenharmony_ci# define X509_V_FLAG_EXTENDED_CRL_SUPPORT 0x1000 3461cb0ef41Sopenharmony_ci/* Delta CRL support */ 3471cb0ef41Sopenharmony_ci# define X509_V_FLAG_USE_DELTAS 0x2000 3481cb0ef41Sopenharmony_ci/* Check self-signed CA signature */ 3491cb0ef41Sopenharmony_ci# define X509_V_FLAG_CHECK_SS_SIGNATURE 0x4000 3501cb0ef41Sopenharmony_ci/* Use trusted store first */ 3511cb0ef41Sopenharmony_ci# define X509_V_FLAG_TRUSTED_FIRST 0x8000 3521cb0ef41Sopenharmony_ci/* Suite B 128 bit only mode: not normally used */ 3531cb0ef41Sopenharmony_ci# define X509_V_FLAG_SUITEB_128_LOS_ONLY 0x10000 3541cb0ef41Sopenharmony_ci/* Suite B 192 bit only mode */ 3551cb0ef41Sopenharmony_ci# define X509_V_FLAG_SUITEB_192_LOS 0x20000 3561cb0ef41Sopenharmony_ci/* Suite B 128 bit mode allowing 192 bit algorithms */ 3571cb0ef41Sopenharmony_ci# define X509_V_FLAG_SUITEB_128_LOS 0x30000 3581cb0ef41Sopenharmony_ci/* Allow partial chains if at least one certificate is in trusted store */ 3591cb0ef41Sopenharmony_ci# define X509_V_FLAG_PARTIAL_CHAIN 0x80000 3601cb0ef41Sopenharmony_ci/* 3611cb0ef41Sopenharmony_ci * If the initial chain is not trusted, do not attempt to build an alternative 3621cb0ef41Sopenharmony_ci * chain. Alternate chain checking was introduced in 1.1.0. Setting this flag 3631cb0ef41Sopenharmony_ci * will force the behaviour to match that of previous versions. 3641cb0ef41Sopenharmony_ci */ 3651cb0ef41Sopenharmony_ci# define X509_V_FLAG_NO_ALT_CHAINS 0x100000 3661cb0ef41Sopenharmony_ci/* Do not check certificate/CRL validity against current time */ 3671cb0ef41Sopenharmony_ci# define X509_V_FLAG_NO_CHECK_TIME 0x200000 3681cb0ef41Sopenharmony_ci 3691cb0ef41Sopenharmony_ci# define X509_VP_FLAG_DEFAULT 0x1 3701cb0ef41Sopenharmony_ci# define X509_VP_FLAG_OVERWRITE 0x2 3711cb0ef41Sopenharmony_ci# define X509_VP_FLAG_RESET_FLAGS 0x4 3721cb0ef41Sopenharmony_ci# define X509_VP_FLAG_LOCKED 0x8 3731cb0ef41Sopenharmony_ci# define X509_VP_FLAG_ONCE 0x10 3741cb0ef41Sopenharmony_ci 3751cb0ef41Sopenharmony_ci/* Internal use: mask of policy related options */ 3761cb0ef41Sopenharmony_ci# define X509_V_FLAG_POLICY_MASK (X509_V_FLAG_POLICY_CHECK \ 3771cb0ef41Sopenharmony_ci | X509_V_FLAG_EXPLICIT_POLICY \ 3781cb0ef41Sopenharmony_ci | X509_V_FLAG_INHIBIT_ANY \ 3791cb0ef41Sopenharmony_ci | X509_V_FLAG_INHIBIT_MAP) 3801cb0ef41Sopenharmony_ci 3811cb0ef41Sopenharmony_ciint X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, X509_LOOKUP_TYPE type, 3821cb0ef41Sopenharmony_ci const X509_NAME *name); 3831cb0ef41Sopenharmony_ciX509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h, 3841cb0ef41Sopenharmony_ci X509_LOOKUP_TYPE type, 3851cb0ef41Sopenharmony_ci const X509_NAME *name); 3861cb0ef41Sopenharmony_ciX509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, 3871cb0ef41Sopenharmony_ci X509_OBJECT *x); 3881cb0ef41Sopenharmony_ciint X509_OBJECT_up_ref_count(X509_OBJECT *a); 3891cb0ef41Sopenharmony_ciX509_OBJECT *X509_OBJECT_new(void); 3901cb0ef41Sopenharmony_civoid X509_OBJECT_free(X509_OBJECT *a); 3911cb0ef41Sopenharmony_ciX509_LOOKUP_TYPE X509_OBJECT_get_type(const X509_OBJECT *a); 3921cb0ef41Sopenharmony_ciX509 *X509_OBJECT_get0_X509(const X509_OBJECT *a); 3931cb0ef41Sopenharmony_ciint X509_OBJECT_set1_X509(X509_OBJECT *a, X509 *obj); 3941cb0ef41Sopenharmony_ciX509_CRL *X509_OBJECT_get0_X509_CRL(const X509_OBJECT *a); 3951cb0ef41Sopenharmony_ciint X509_OBJECT_set1_X509_CRL(X509_OBJECT *a, X509_CRL *obj); 3961cb0ef41Sopenharmony_ciX509_STORE *X509_STORE_new(void); 3971cb0ef41Sopenharmony_civoid X509_STORE_free(X509_STORE *v); 3981cb0ef41Sopenharmony_ciint X509_STORE_lock(X509_STORE *ctx); 3991cb0ef41Sopenharmony_ciint X509_STORE_unlock(X509_STORE *ctx); 4001cb0ef41Sopenharmony_ciint X509_STORE_up_ref(X509_STORE *v); 4011cb0ef41Sopenharmony_ciSTACK_OF(X509_OBJECT) *X509_STORE_get0_objects(const X509_STORE *v); 4021cb0ef41Sopenharmony_ciSTACK_OF(X509) *X509_STORE_get1_all_certs(X509_STORE *st); 4031cb0ef41Sopenharmony_ciSTACK_OF(X509) *X509_STORE_CTX_get1_certs(X509_STORE_CTX *st, 4041cb0ef41Sopenharmony_ci const X509_NAME *nm); 4051cb0ef41Sopenharmony_ciSTACK_OF(X509_CRL) *X509_STORE_CTX_get1_crls(const X509_STORE_CTX *st, 4061cb0ef41Sopenharmony_ci const X509_NAME *nm); 4071cb0ef41Sopenharmony_ciint X509_STORE_set_flags(X509_STORE *ctx, unsigned long flags); 4081cb0ef41Sopenharmony_ciint X509_STORE_set_purpose(X509_STORE *ctx, int purpose); 4091cb0ef41Sopenharmony_ciint X509_STORE_set_trust(X509_STORE *ctx, int trust); 4101cb0ef41Sopenharmony_ciint X509_STORE_set1_param(X509_STORE *ctx, const X509_VERIFY_PARAM *pm); 4111cb0ef41Sopenharmony_ciX509_VERIFY_PARAM *X509_STORE_get0_param(const X509_STORE *ctx); 4121cb0ef41Sopenharmony_ci 4131cb0ef41Sopenharmony_civoid X509_STORE_set_verify(X509_STORE *ctx, X509_STORE_CTX_verify_fn verify); 4141cb0ef41Sopenharmony_ci#define X509_STORE_set_verify_func(ctx, func) \ 4151cb0ef41Sopenharmony_ci X509_STORE_set_verify((ctx),(func)) 4161cb0ef41Sopenharmony_civoid X509_STORE_CTX_set_verify(X509_STORE_CTX *ctx, 4171cb0ef41Sopenharmony_ci X509_STORE_CTX_verify_fn verify); 4181cb0ef41Sopenharmony_ciX509_STORE_CTX_verify_fn X509_STORE_get_verify(const X509_STORE *ctx); 4191cb0ef41Sopenharmony_civoid X509_STORE_set_verify_cb(X509_STORE *ctx, 4201cb0ef41Sopenharmony_ci X509_STORE_CTX_verify_cb verify_cb); 4211cb0ef41Sopenharmony_ci# define X509_STORE_set_verify_cb_func(ctx,func) \ 4221cb0ef41Sopenharmony_ci X509_STORE_set_verify_cb((ctx),(func)) 4231cb0ef41Sopenharmony_ciX509_STORE_CTX_verify_cb X509_STORE_get_verify_cb(const X509_STORE *ctx); 4241cb0ef41Sopenharmony_civoid X509_STORE_set_get_issuer(X509_STORE *ctx, 4251cb0ef41Sopenharmony_ci X509_STORE_CTX_get_issuer_fn get_issuer); 4261cb0ef41Sopenharmony_ciX509_STORE_CTX_get_issuer_fn X509_STORE_get_get_issuer(const X509_STORE *ctx); 4271cb0ef41Sopenharmony_civoid X509_STORE_set_check_issued(X509_STORE *ctx, 4281cb0ef41Sopenharmony_ci X509_STORE_CTX_check_issued_fn check_issued); 4291cb0ef41Sopenharmony_ciX509_STORE_CTX_check_issued_fn X509_STORE_get_check_issued(const X509_STORE *ctx); 4301cb0ef41Sopenharmony_civoid X509_STORE_set_check_revocation(X509_STORE *ctx, 4311cb0ef41Sopenharmony_ci X509_STORE_CTX_check_revocation_fn check_revocation); 4321cb0ef41Sopenharmony_ciX509_STORE_CTX_check_revocation_fn 4331cb0ef41Sopenharmony_ci X509_STORE_get_check_revocation(const X509_STORE *ctx); 4341cb0ef41Sopenharmony_civoid X509_STORE_set_get_crl(X509_STORE *ctx, 4351cb0ef41Sopenharmony_ci X509_STORE_CTX_get_crl_fn get_crl); 4361cb0ef41Sopenharmony_ciX509_STORE_CTX_get_crl_fn X509_STORE_get_get_crl(const X509_STORE *ctx); 4371cb0ef41Sopenharmony_civoid X509_STORE_set_check_crl(X509_STORE *ctx, 4381cb0ef41Sopenharmony_ci X509_STORE_CTX_check_crl_fn check_crl); 4391cb0ef41Sopenharmony_ciX509_STORE_CTX_check_crl_fn X509_STORE_get_check_crl(const X509_STORE *ctx); 4401cb0ef41Sopenharmony_civoid X509_STORE_set_cert_crl(X509_STORE *ctx, 4411cb0ef41Sopenharmony_ci X509_STORE_CTX_cert_crl_fn cert_crl); 4421cb0ef41Sopenharmony_ciX509_STORE_CTX_cert_crl_fn X509_STORE_get_cert_crl(const X509_STORE *ctx); 4431cb0ef41Sopenharmony_civoid X509_STORE_set_check_policy(X509_STORE *ctx, 4441cb0ef41Sopenharmony_ci X509_STORE_CTX_check_policy_fn check_policy); 4451cb0ef41Sopenharmony_ciX509_STORE_CTX_check_policy_fn X509_STORE_get_check_policy(const X509_STORE *ctx); 4461cb0ef41Sopenharmony_civoid X509_STORE_set_lookup_certs(X509_STORE *ctx, 4471cb0ef41Sopenharmony_ci X509_STORE_CTX_lookup_certs_fn lookup_certs); 4481cb0ef41Sopenharmony_ciX509_STORE_CTX_lookup_certs_fn X509_STORE_get_lookup_certs(const X509_STORE *ctx); 4491cb0ef41Sopenharmony_civoid X509_STORE_set_lookup_crls(X509_STORE *ctx, 4501cb0ef41Sopenharmony_ci X509_STORE_CTX_lookup_crls_fn lookup_crls); 4511cb0ef41Sopenharmony_ci#define X509_STORE_set_lookup_crls_cb(ctx, func) \ 4521cb0ef41Sopenharmony_ci X509_STORE_set_lookup_crls((ctx), (func)) 4531cb0ef41Sopenharmony_ciX509_STORE_CTX_lookup_crls_fn X509_STORE_get_lookup_crls(const X509_STORE *ctx); 4541cb0ef41Sopenharmony_civoid X509_STORE_set_cleanup(X509_STORE *ctx, 4551cb0ef41Sopenharmony_ci X509_STORE_CTX_cleanup_fn cleanup); 4561cb0ef41Sopenharmony_ciX509_STORE_CTX_cleanup_fn X509_STORE_get_cleanup(const X509_STORE *ctx); 4571cb0ef41Sopenharmony_ci 4581cb0ef41Sopenharmony_ci#define X509_STORE_get_ex_new_index(l, p, newf, dupf, freef) \ 4591cb0ef41Sopenharmony_ci CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE, l, p, newf, dupf, freef) 4601cb0ef41Sopenharmony_ciint X509_STORE_set_ex_data(X509_STORE *ctx, int idx, void *data); 4611cb0ef41Sopenharmony_civoid *X509_STORE_get_ex_data(const X509_STORE *ctx, int idx); 4621cb0ef41Sopenharmony_ci 4631cb0ef41Sopenharmony_ciX509_STORE_CTX *X509_STORE_CTX_new_ex(OSSL_LIB_CTX *libctx, const char *propq); 4641cb0ef41Sopenharmony_ciX509_STORE_CTX *X509_STORE_CTX_new(void); 4651cb0ef41Sopenharmony_ci 4661cb0ef41Sopenharmony_ciint X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); 4671cb0ef41Sopenharmony_ci 4681cb0ef41Sopenharmony_civoid X509_STORE_CTX_free(X509_STORE_CTX *ctx); 4691cb0ef41Sopenharmony_ciint X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *trust_store, 4701cb0ef41Sopenharmony_ci X509 *target, STACK_OF(X509) *untrusted); 4711cb0ef41Sopenharmony_civoid X509_STORE_CTX_set0_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); 4721cb0ef41Sopenharmony_civoid X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx); 4731cb0ef41Sopenharmony_ci 4741cb0ef41Sopenharmony_ciX509_STORE *X509_STORE_CTX_get0_store(const X509_STORE_CTX *ctx); 4751cb0ef41Sopenharmony_ciX509 *X509_STORE_CTX_get0_cert(const X509_STORE_CTX *ctx); 4761cb0ef41Sopenharmony_ciSTACK_OF(X509)* X509_STORE_CTX_get0_untrusted(const X509_STORE_CTX *ctx); 4771cb0ef41Sopenharmony_civoid X509_STORE_CTX_set0_untrusted(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); 4781cb0ef41Sopenharmony_civoid X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx, 4791cb0ef41Sopenharmony_ci X509_STORE_CTX_verify_cb verify); 4801cb0ef41Sopenharmony_ciX509_STORE_CTX_verify_cb X509_STORE_CTX_get_verify_cb(const X509_STORE_CTX *ctx); 4811cb0ef41Sopenharmony_ciX509_STORE_CTX_verify_fn X509_STORE_CTX_get_verify(const X509_STORE_CTX *ctx); 4821cb0ef41Sopenharmony_ciX509_STORE_CTX_get_issuer_fn X509_STORE_CTX_get_get_issuer(const X509_STORE_CTX *ctx); 4831cb0ef41Sopenharmony_ciX509_STORE_CTX_check_issued_fn X509_STORE_CTX_get_check_issued(const X509_STORE_CTX *ctx); 4841cb0ef41Sopenharmony_ciX509_STORE_CTX_check_revocation_fn X509_STORE_CTX_get_check_revocation(const X509_STORE_CTX *ctx); 4851cb0ef41Sopenharmony_ciX509_STORE_CTX_get_crl_fn X509_STORE_CTX_get_get_crl(const X509_STORE_CTX *ctx); 4861cb0ef41Sopenharmony_ciX509_STORE_CTX_check_crl_fn X509_STORE_CTX_get_check_crl(const X509_STORE_CTX *ctx); 4871cb0ef41Sopenharmony_ciX509_STORE_CTX_cert_crl_fn X509_STORE_CTX_get_cert_crl(const X509_STORE_CTX *ctx); 4881cb0ef41Sopenharmony_ciX509_STORE_CTX_check_policy_fn X509_STORE_CTX_get_check_policy(const X509_STORE_CTX *ctx); 4891cb0ef41Sopenharmony_ciX509_STORE_CTX_lookup_certs_fn X509_STORE_CTX_get_lookup_certs(const X509_STORE_CTX *ctx); 4901cb0ef41Sopenharmony_ciX509_STORE_CTX_lookup_crls_fn X509_STORE_CTX_get_lookup_crls(const X509_STORE_CTX *ctx); 4911cb0ef41Sopenharmony_ciX509_STORE_CTX_cleanup_fn X509_STORE_CTX_get_cleanup(const X509_STORE_CTX *ctx); 4921cb0ef41Sopenharmony_ci 4931cb0ef41Sopenharmony_ci#ifndef OPENSSL_NO_DEPRECATED_1_1_0 4941cb0ef41Sopenharmony_ci# define X509_STORE_CTX_get_chain X509_STORE_CTX_get0_chain 4951cb0ef41Sopenharmony_ci# define X509_STORE_CTX_set_chain X509_STORE_CTX_set0_untrusted 4961cb0ef41Sopenharmony_ci# define X509_STORE_CTX_trusted_stack X509_STORE_CTX_set0_trusted_stack 4971cb0ef41Sopenharmony_ci# define X509_STORE_get_by_subject X509_STORE_CTX_get_by_subject 4981cb0ef41Sopenharmony_ci# define X509_STORE_get1_certs X509_STORE_CTX_get1_certs 4991cb0ef41Sopenharmony_ci# define X509_STORE_get1_crls X509_STORE_CTX_get1_crls 5001cb0ef41Sopenharmony_ci/* the following macro is misspelled; use X509_STORE_get1_certs instead */ 5011cb0ef41Sopenharmony_ci# define X509_STORE_get1_cert X509_STORE_CTX_get1_certs 5021cb0ef41Sopenharmony_ci/* the following macro is misspelled; use X509_STORE_get1_crls instead */ 5031cb0ef41Sopenharmony_ci# define X509_STORE_get1_crl X509_STORE_CTX_get1_crls 5041cb0ef41Sopenharmony_ci#endif 5051cb0ef41Sopenharmony_ci 5061cb0ef41Sopenharmony_ciX509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m); 5071cb0ef41Sopenharmony_ciX509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void); 5081cb0ef41Sopenharmony_ciX509_LOOKUP_METHOD *X509_LOOKUP_file(void); 5091cb0ef41Sopenharmony_ciX509_LOOKUP_METHOD *X509_LOOKUP_store(void); 5101cb0ef41Sopenharmony_ci 5111cb0ef41Sopenharmony_citypedef int (*X509_LOOKUP_ctrl_fn)(X509_LOOKUP *ctx, int cmd, const char *argc, 5121cb0ef41Sopenharmony_ci long argl, char **ret); 5131cb0ef41Sopenharmony_citypedef int (*X509_LOOKUP_ctrl_ex_fn)( 5141cb0ef41Sopenharmony_ci X509_LOOKUP *ctx, int cmd, const char *argc, long argl, char **ret, 5151cb0ef41Sopenharmony_ci OSSL_LIB_CTX *libctx, const char *propq); 5161cb0ef41Sopenharmony_ci 5171cb0ef41Sopenharmony_citypedef int (*X509_LOOKUP_get_by_subject_fn)(X509_LOOKUP *ctx, 5181cb0ef41Sopenharmony_ci X509_LOOKUP_TYPE type, 5191cb0ef41Sopenharmony_ci const X509_NAME *name, 5201cb0ef41Sopenharmony_ci X509_OBJECT *ret); 5211cb0ef41Sopenharmony_citypedef int (*X509_LOOKUP_get_by_subject_ex_fn)(X509_LOOKUP *ctx, 5221cb0ef41Sopenharmony_ci X509_LOOKUP_TYPE type, 5231cb0ef41Sopenharmony_ci const X509_NAME *name, 5241cb0ef41Sopenharmony_ci X509_OBJECT *ret, 5251cb0ef41Sopenharmony_ci OSSL_LIB_CTX *libctx, 5261cb0ef41Sopenharmony_ci const char *propq); 5271cb0ef41Sopenharmony_citypedef int (*X509_LOOKUP_get_by_issuer_serial_fn)(X509_LOOKUP *ctx, 5281cb0ef41Sopenharmony_ci X509_LOOKUP_TYPE type, 5291cb0ef41Sopenharmony_ci const X509_NAME *name, 5301cb0ef41Sopenharmony_ci const ASN1_INTEGER *serial, 5311cb0ef41Sopenharmony_ci X509_OBJECT *ret); 5321cb0ef41Sopenharmony_citypedef int (*X509_LOOKUP_get_by_fingerprint_fn)(X509_LOOKUP *ctx, 5331cb0ef41Sopenharmony_ci X509_LOOKUP_TYPE type, 5341cb0ef41Sopenharmony_ci const unsigned char* bytes, 5351cb0ef41Sopenharmony_ci int len, 5361cb0ef41Sopenharmony_ci X509_OBJECT *ret); 5371cb0ef41Sopenharmony_citypedef int (*X509_LOOKUP_get_by_alias_fn)(X509_LOOKUP *ctx, 5381cb0ef41Sopenharmony_ci X509_LOOKUP_TYPE type, 5391cb0ef41Sopenharmony_ci const char *str, 5401cb0ef41Sopenharmony_ci int len, 5411cb0ef41Sopenharmony_ci X509_OBJECT *ret); 5421cb0ef41Sopenharmony_ci 5431cb0ef41Sopenharmony_ciX509_LOOKUP_METHOD *X509_LOOKUP_meth_new(const char *name); 5441cb0ef41Sopenharmony_civoid X509_LOOKUP_meth_free(X509_LOOKUP_METHOD *method); 5451cb0ef41Sopenharmony_ci 5461cb0ef41Sopenharmony_ciint X509_LOOKUP_meth_set_new_item(X509_LOOKUP_METHOD *method, 5471cb0ef41Sopenharmony_ci int (*new_item) (X509_LOOKUP *ctx)); 5481cb0ef41Sopenharmony_ciint (*X509_LOOKUP_meth_get_new_item(const X509_LOOKUP_METHOD* method)) 5491cb0ef41Sopenharmony_ci (X509_LOOKUP *ctx); 5501cb0ef41Sopenharmony_ci 5511cb0ef41Sopenharmony_ciint X509_LOOKUP_meth_set_free(X509_LOOKUP_METHOD *method, 5521cb0ef41Sopenharmony_ci void (*free_fn) (X509_LOOKUP *ctx)); 5531cb0ef41Sopenharmony_civoid (*X509_LOOKUP_meth_get_free(const X509_LOOKUP_METHOD* method)) 5541cb0ef41Sopenharmony_ci (X509_LOOKUP *ctx); 5551cb0ef41Sopenharmony_ci 5561cb0ef41Sopenharmony_ciint X509_LOOKUP_meth_set_init(X509_LOOKUP_METHOD *method, 5571cb0ef41Sopenharmony_ci int (*init) (X509_LOOKUP *ctx)); 5581cb0ef41Sopenharmony_ciint (*X509_LOOKUP_meth_get_init(const X509_LOOKUP_METHOD* method)) 5591cb0ef41Sopenharmony_ci (X509_LOOKUP *ctx); 5601cb0ef41Sopenharmony_ci 5611cb0ef41Sopenharmony_ciint X509_LOOKUP_meth_set_shutdown(X509_LOOKUP_METHOD *method, 5621cb0ef41Sopenharmony_ci int (*shutdown) (X509_LOOKUP *ctx)); 5631cb0ef41Sopenharmony_ciint (*X509_LOOKUP_meth_get_shutdown(const X509_LOOKUP_METHOD* method)) 5641cb0ef41Sopenharmony_ci (X509_LOOKUP *ctx); 5651cb0ef41Sopenharmony_ci 5661cb0ef41Sopenharmony_ciint X509_LOOKUP_meth_set_ctrl(X509_LOOKUP_METHOD *method, 5671cb0ef41Sopenharmony_ci X509_LOOKUP_ctrl_fn ctrl_fn); 5681cb0ef41Sopenharmony_ciX509_LOOKUP_ctrl_fn X509_LOOKUP_meth_get_ctrl(const X509_LOOKUP_METHOD *method); 5691cb0ef41Sopenharmony_ci 5701cb0ef41Sopenharmony_ciint X509_LOOKUP_meth_set_get_by_subject(X509_LOOKUP_METHOD *method, 5711cb0ef41Sopenharmony_ci X509_LOOKUP_get_by_subject_fn fn); 5721cb0ef41Sopenharmony_ciX509_LOOKUP_get_by_subject_fn X509_LOOKUP_meth_get_get_by_subject( 5731cb0ef41Sopenharmony_ci const X509_LOOKUP_METHOD *method); 5741cb0ef41Sopenharmony_ci 5751cb0ef41Sopenharmony_ciint X509_LOOKUP_meth_set_get_by_issuer_serial(X509_LOOKUP_METHOD *method, 5761cb0ef41Sopenharmony_ci X509_LOOKUP_get_by_issuer_serial_fn fn); 5771cb0ef41Sopenharmony_ciX509_LOOKUP_get_by_issuer_serial_fn X509_LOOKUP_meth_get_get_by_issuer_serial( 5781cb0ef41Sopenharmony_ci const X509_LOOKUP_METHOD *method); 5791cb0ef41Sopenharmony_ci 5801cb0ef41Sopenharmony_ciint X509_LOOKUP_meth_set_get_by_fingerprint(X509_LOOKUP_METHOD *method, 5811cb0ef41Sopenharmony_ci X509_LOOKUP_get_by_fingerprint_fn fn); 5821cb0ef41Sopenharmony_ciX509_LOOKUP_get_by_fingerprint_fn X509_LOOKUP_meth_get_get_by_fingerprint( 5831cb0ef41Sopenharmony_ci const X509_LOOKUP_METHOD *method); 5841cb0ef41Sopenharmony_ci 5851cb0ef41Sopenharmony_ciint X509_LOOKUP_meth_set_get_by_alias(X509_LOOKUP_METHOD *method, 5861cb0ef41Sopenharmony_ci X509_LOOKUP_get_by_alias_fn fn); 5871cb0ef41Sopenharmony_ciX509_LOOKUP_get_by_alias_fn X509_LOOKUP_meth_get_get_by_alias( 5881cb0ef41Sopenharmony_ci const X509_LOOKUP_METHOD *method); 5891cb0ef41Sopenharmony_ci 5901cb0ef41Sopenharmony_ci 5911cb0ef41Sopenharmony_ciint X509_STORE_add_cert(X509_STORE *ctx, X509 *x); 5921cb0ef41Sopenharmony_ciint X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x); 5931cb0ef41Sopenharmony_ci 5941cb0ef41Sopenharmony_ciint X509_STORE_CTX_get_by_subject(const X509_STORE_CTX *vs, 5951cb0ef41Sopenharmony_ci X509_LOOKUP_TYPE type, 5961cb0ef41Sopenharmony_ci const X509_NAME *name, X509_OBJECT *ret); 5971cb0ef41Sopenharmony_ciX509_OBJECT *X509_STORE_CTX_get_obj_by_subject(X509_STORE_CTX *vs, 5981cb0ef41Sopenharmony_ci X509_LOOKUP_TYPE type, 5991cb0ef41Sopenharmony_ci const X509_NAME *name); 6001cb0ef41Sopenharmony_ci 6011cb0ef41Sopenharmony_ciint X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, 6021cb0ef41Sopenharmony_ci long argl, char **ret); 6031cb0ef41Sopenharmony_ciint X509_LOOKUP_ctrl_ex(X509_LOOKUP *ctx, int cmd, const char *argc, long argl, 6041cb0ef41Sopenharmony_ci char **ret, OSSL_LIB_CTX *libctx, const char *propq); 6051cb0ef41Sopenharmony_ci 6061cb0ef41Sopenharmony_ciint X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type); 6071cb0ef41Sopenharmony_ciint X509_load_cert_file_ex(X509_LOOKUP *ctx, const char *file, int type, 6081cb0ef41Sopenharmony_ci OSSL_LIB_CTX *libctx, const char *propq); 6091cb0ef41Sopenharmony_ciint X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type); 6101cb0ef41Sopenharmony_ciint X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type); 6111cb0ef41Sopenharmony_ciint X509_load_cert_crl_file_ex(X509_LOOKUP *ctx, const char *file, int type, 6121cb0ef41Sopenharmony_ci OSSL_LIB_CTX *libctx, const char *propq); 6131cb0ef41Sopenharmony_ci 6141cb0ef41Sopenharmony_ciX509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method); 6151cb0ef41Sopenharmony_civoid X509_LOOKUP_free(X509_LOOKUP *ctx); 6161cb0ef41Sopenharmony_ciint X509_LOOKUP_init(X509_LOOKUP *ctx); 6171cb0ef41Sopenharmony_ciint X509_LOOKUP_by_subject(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, 6181cb0ef41Sopenharmony_ci const X509_NAME *name, X509_OBJECT *ret); 6191cb0ef41Sopenharmony_ciint X509_LOOKUP_by_subject_ex(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, 6201cb0ef41Sopenharmony_ci const X509_NAME *name, X509_OBJECT *ret, 6211cb0ef41Sopenharmony_ci OSSL_LIB_CTX *libctx, const char *propq); 6221cb0ef41Sopenharmony_ciint X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, 6231cb0ef41Sopenharmony_ci const X509_NAME *name, 6241cb0ef41Sopenharmony_ci const ASN1_INTEGER *serial, 6251cb0ef41Sopenharmony_ci X509_OBJECT *ret); 6261cb0ef41Sopenharmony_ciint X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, 6271cb0ef41Sopenharmony_ci const unsigned char *bytes, int len, 6281cb0ef41Sopenharmony_ci X509_OBJECT *ret); 6291cb0ef41Sopenharmony_ciint X509_LOOKUP_by_alias(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, 6301cb0ef41Sopenharmony_ci const char *str, int len, X509_OBJECT *ret); 6311cb0ef41Sopenharmony_ciint X509_LOOKUP_set_method_data(X509_LOOKUP *ctx, void *data); 6321cb0ef41Sopenharmony_civoid *X509_LOOKUP_get_method_data(const X509_LOOKUP *ctx); 6331cb0ef41Sopenharmony_ciX509_STORE *X509_LOOKUP_get_store(const X509_LOOKUP *ctx); 6341cb0ef41Sopenharmony_ciint X509_LOOKUP_shutdown(X509_LOOKUP *ctx); 6351cb0ef41Sopenharmony_ci 6361cb0ef41Sopenharmony_ciint X509_STORE_load_file(X509_STORE *ctx, const char *file); 6371cb0ef41Sopenharmony_ciint X509_STORE_load_path(X509_STORE *ctx, const char *path); 6381cb0ef41Sopenharmony_ciint X509_STORE_load_store(X509_STORE *ctx, const char *store); 6391cb0ef41Sopenharmony_ciint X509_STORE_load_locations(X509_STORE *ctx, 6401cb0ef41Sopenharmony_ci const char *file, 6411cb0ef41Sopenharmony_ci const char *dir); 6421cb0ef41Sopenharmony_ciint X509_STORE_set_default_paths(X509_STORE *ctx); 6431cb0ef41Sopenharmony_ci 6441cb0ef41Sopenharmony_ciint X509_STORE_load_file_ex(X509_STORE *ctx, const char *file, 6451cb0ef41Sopenharmony_ci OSSL_LIB_CTX *libctx, const char *propq); 6461cb0ef41Sopenharmony_ciint X509_STORE_load_store_ex(X509_STORE *ctx, const char *store, 6471cb0ef41Sopenharmony_ci OSSL_LIB_CTX *libctx, const char *propq); 6481cb0ef41Sopenharmony_ciint X509_STORE_load_locations_ex(X509_STORE *ctx, const char *file, 6491cb0ef41Sopenharmony_ci const char *dir, OSSL_LIB_CTX *libctx, 6501cb0ef41Sopenharmony_ci const char *propq); 6511cb0ef41Sopenharmony_ciint X509_STORE_set_default_paths_ex(X509_STORE *ctx, OSSL_LIB_CTX *libctx, 6521cb0ef41Sopenharmony_ci const char *propq); 6531cb0ef41Sopenharmony_ci 6541cb0ef41Sopenharmony_ci#define X509_STORE_CTX_get_ex_new_index(l, p, newf, dupf, freef) \ 6551cb0ef41Sopenharmony_ci CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE_CTX, l, p, newf, dupf, freef) 6561cb0ef41Sopenharmony_ciint X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx, int idx, void *data); 6571cb0ef41Sopenharmony_civoid *X509_STORE_CTX_get_ex_data(const X509_STORE_CTX *ctx, int idx); 6581cb0ef41Sopenharmony_ciint X509_STORE_CTX_get_error(const X509_STORE_CTX *ctx); 6591cb0ef41Sopenharmony_civoid X509_STORE_CTX_set_error(X509_STORE_CTX *ctx, int s); 6601cb0ef41Sopenharmony_ciint X509_STORE_CTX_get_error_depth(const X509_STORE_CTX *ctx); 6611cb0ef41Sopenharmony_civoid X509_STORE_CTX_set_error_depth(X509_STORE_CTX *ctx, int depth); 6621cb0ef41Sopenharmony_ciX509 *X509_STORE_CTX_get_current_cert(const X509_STORE_CTX *ctx); 6631cb0ef41Sopenharmony_civoid X509_STORE_CTX_set_current_cert(X509_STORE_CTX *ctx, X509 *x); 6641cb0ef41Sopenharmony_ciX509 *X509_STORE_CTX_get0_current_issuer(const X509_STORE_CTX *ctx); 6651cb0ef41Sopenharmony_ciX509_CRL *X509_STORE_CTX_get0_current_crl(const X509_STORE_CTX *ctx); 6661cb0ef41Sopenharmony_ciX509_STORE_CTX *X509_STORE_CTX_get0_parent_ctx(const X509_STORE_CTX *ctx); 6671cb0ef41Sopenharmony_ciSTACK_OF(X509) *X509_STORE_CTX_get0_chain(const X509_STORE_CTX *ctx); 6681cb0ef41Sopenharmony_ciSTACK_OF(X509) *X509_STORE_CTX_get1_chain(const X509_STORE_CTX *ctx); 6691cb0ef41Sopenharmony_civoid X509_STORE_CTX_set_cert(X509_STORE_CTX *ctx, X509 *target); 6701cb0ef41Sopenharmony_civoid X509_STORE_CTX_set0_verified_chain(X509_STORE_CTX *c, STACK_OF(X509) *sk); 6711cb0ef41Sopenharmony_civoid X509_STORE_CTX_set0_crls(X509_STORE_CTX *ctx, STACK_OF(X509_CRL) *sk); 6721cb0ef41Sopenharmony_ciint X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose); 6731cb0ef41Sopenharmony_ciint X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust); 6741cb0ef41Sopenharmony_ciint X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose, 6751cb0ef41Sopenharmony_ci int purpose, int trust); 6761cb0ef41Sopenharmony_civoid X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, unsigned long flags); 6771cb0ef41Sopenharmony_civoid X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags, 6781cb0ef41Sopenharmony_ci time_t t); 6791cb0ef41Sopenharmony_ci 6801cb0ef41Sopenharmony_ciX509_POLICY_TREE *X509_STORE_CTX_get0_policy_tree(const X509_STORE_CTX *ctx); 6811cb0ef41Sopenharmony_ciint X509_STORE_CTX_get_explicit_policy(const X509_STORE_CTX *ctx); 6821cb0ef41Sopenharmony_ciint X509_STORE_CTX_get_num_untrusted(const X509_STORE_CTX *ctx); 6831cb0ef41Sopenharmony_ci 6841cb0ef41Sopenharmony_ciX509_VERIFY_PARAM *X509_STORE_CTX_get0_param(const X509_STORE_CTX *ctx); 6851cb0ef41Sopenharmony_civoid X509_STORE_CTX_set0_param(X509_STORE_CTX *ctx, X509_VERIFY_PARAM *param); 6861cb0ef41Sopenharmony_ciint X509_STORE_CTX_set_default(X509_STORE_CTX *ctx, const char *name); 6871cb0ef41Sopenharmony_ci 6881cb0ef41Sopenharmony_ci/* 6891cb0ef41Sopenharmony_ci * Bridge opacity barrier between libcrypt and libssl, also needed to support 6901cb0ef41Sopenharmony_ci * offline testing in test/danetest.c 6911cb0ef41Sopenharmony_ci */ 6921cb0ef41Sopenharmony_civoid X509_STORE_CTX_set0_dane(X509_STORE_CTX *ctx, SSL_DANE *dane); 6931cb0ef41Sopenharmony_ci#define DANE_FLAG_NO_DANE_EE_NAMECHECKS (1L << 0) 6941cb0ef41Sopenharmony_ci 6951cb0ef41Sopenharmony_ci/* X509_VERIFY_PARAM functions */ 6961cb0ef41Sopenharmony_ci 6971cb0ef41Sopenharmony_ciX509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void); 6981cb0ef41Sopenharmony_civoid X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param); 6991cb0ef41Sopenharmony_ciint X509_VERIFY_PARAM_inherit(X509_VERIFY_PARAM *to, 7001cb0ef41Sopenharmony_ci const X509_VERIFY_PARAM *from); 7011cb0ef41Sopenharmony_ciint X509_VERIFY_PARAM_set1(X509_VERIFY_PARAM *to, 7021cb0ef41Sopenharmony_ci const X509_VERIFY_PARAM *from); 7031cb0ef41Sopenharmony_ciint X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name); 7041cb0ef41Sopenharmony_ciint X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param, 7051cb0ef41Sopenharmony_ci unsigned long flags); 7061cb0ef41Sopenharmony_ciint X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param, 7071cb0ef41Sopenharmony_ci unsigned long flags); 7081cb0ef41Sopenharmony_ciunsigned long X509_VERIFY_PARAM_get_flags(const X509_VERIFY_PARAM *param); 7091cb0ef41Sopenharmony_ciint X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose); 7101cb0ef41Sopenharmony_ciint X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust); 7111cb0ef41Sopenharmony_civoid X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth); 7121cb0ef41Sopenharmony_civoid X509_VERIFY_PARAM_set_auth_level(X509_VERIFY_PARAM *param, int auth_level); 7131cb0ef41Sopenharmony_citime_t X509_VERIFY_PARAM_get_time(const X509_VERIFY_PARAM *param); 7141cb0ef41Sopenharmony_civoid X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t); 7151cb0ef41Sopenharmony_ciint X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, 7161cb0ef41Sopenharmony_ci ASN1_OBJECT *policy); 7171cb0ef41Sopenharmony_ciint X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, 7181cb0ef41Sopenharmony_ci STACK_OF(ASN1_OBJECT) *policies); 7191cb0ef41Sopenharmony_ci 7201cb0ef41Sopenharmony_ciint X509_VERIFY_PARAM_set_inh_flags(X509_VERIFY_PARAM *param, 7211cb0ef41Sopenharmony_ci uint32_t flags); 7221cb0ef41Sopenharmony_ciuint32_t X509_VERIFY_PARAM_get_inh_flags(const X509_VERIFY_PARAM *param); 7231cb0ef41Sopenharmony_ci 7241cb0ef41Sopenharmony_cichar *X509_VERIFY_PARAM_get0_host(X509_VERIFY_PARAM *param, int idx); 7251cb0ef41Sopenharmony_ciint X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param, 7261cb0ef41Sopenharmony_ci const char *name, size_t namelen); 7271cb0ef41Sopenharmony_ciint X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param, 7281cb0ef41Sopenharmony_ci const char *name, size_t namelen); 7291cb0ef41Sopenharmony_civoid X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param, 7301cb0ef41Sopenharmony_ci unsigned int flags); 7311cb0ef41Sopenharmony_ciunsigned int X509_VERIFY_PARAM_get_hostflags(const X509_VERIFY_PARAM *param); 7321cb0ef41Sopenharmony_cichar *X509_VERIFY_PARAM_get0_peername(const X509_VERIFY_PARAM *param); 7331cb0ef41Sopenharmony_civoid X509_VERIFY_PARAM_move_peername(X509_VERIFY_PARAM *, X509_VERIFY_PARAM *); 7341cb0ef41Sopenharmony_cichar *X509_VERIFY_PARAM_get0_email(X509_VERIFY_PARAM *param); 7351cb0ef41Sopenharmony_ciint X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param, 7361cb0ef41Sopenharmony_ci const char *email, size_t emaillen); 7371cb0ef41Sopenharmony_cichar *X509_VERIFY_PARAM_get1_ip_asc(X509_VERIFY_PARAM *param); 7381cb0ef41Sopenharmony_ciint X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param, 7391cb0ef41Sopenharmony_ci const unsigned char *ip, size_t iplen); 7401cb0ef41Sopenharmony_ciint X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param, 7411cb0ef41Sopenharmony_ci const char *ipasc); 7421cb0ef41Sopenharmony_ci 7431cb0ef41Sopenharmony_ciint X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param); 7441cb0ef41Sopenharmony_ciint X509_VERIFY_PARAM_get_auth_level(const X509_VERIFY_PARAM *param); 7451cb0ef41Sopenharmony_ciconst char *X509_VERIFY_PARAM_get0_name(const X509_VERIFY_PARAM *param); 7461cb0ef41Sopenharmony_ci 7471cb0ef41Sopenharmony_ciint X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param); 7481cb0ef41Sopenharmony_ciint X509_VERIFY_PARAM_get_count(void); 7491cb0ef41Sopenharmony_ciconst X509_VERIFY_PARAM *X509_VERIFY_PARAM_get0(int id); 7501cb0ef41Sopenharmony_ciconst X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name); 7511cb0ef41Sopenharmony_civoid X509_VERIFY_PARAM_table_cleanup(void); 7521cb0ef41Sopenharmony_ci 7531cb0ef41Sopenharmony_ci/* Non positive return values are errors */ 7541cb0ef41Sopenharmony_ci#define X509_PCY_TREE_FAILURE -2 /* Failure to satisfy explicit policy */ 7551cb0ef41Sopenharmony_ci#define X509_PCY_TREE_INVALID -1 /* Inconsistent or invalid extensions */ 7561cb0ef41Sopenharmony_ci#define X509_PCY_TREE_INTERNAL 0 /* Internal error, most likely malloc */ 7571cb0ef41Sopenharmony_ci 7581cb0ef41Sopenharmony_ci/* 7591cb0ef41Sopenharmony_ci * Positive return values form a bit mask, all but the first are internal to 7601cb0ef41Sopenharmony_ci * the library and don't appear in results from X509_policy_check(). 7611cb0ef41Sopenharmony_ci */ 7621cb0ef41Sopenharmony_ci#define X509_PCY_TREE_VALID 1 /* The policy tree is valid */ 7631cb0ef41Sopenharmony_ci#define X509_PCY_TREE_EMPTY 2 /* The policy tree is empty */ 7641cb0ef41Sopenharmony_ci#define X509_PCY_TREE_EXPLICIT 4 /* Explicit policy required */ 7651cb0ef41Sopenharmony_ci 7661cb0ef41Sopenharmony_ciint X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy, 7671cb0ef41Sopenharmony_ci STACK_OF(X509) *certs, 7681cb0ef41Sopenharmony_ci STACK_OF(ASN1_OBJECT) *policy_oids, unsigned int flags); 7691cb0ef41Sopenharmony_ci 7701cb0ef41Sopenharmony_civoid X509_policy_tree_free(X509_POLICY_TREE *tree); 7711cb0ef41Sopenharmony_ci 7721cb0ef41Sopenharmony_ciint X509_policy_tree_level_count(const X509_POLICY_TREE *tree); 7731cb0ef41Sopenharmony_ciX509_POLICY_LEVEL *X509_policy_tree_get0_level(const X509_POLICY_TREE *tree, 7741cb0ef41Sopenharmony_ci int i); 7751cb0ef41Sopenharmony_ci 7761cb0ef41Sopenharmony_ciSTACK_OF(X509_POLICY_NODE) 7771cb0ef41Sopenharmony_ci *X509_policy_tree_get0_policies(const X509_POLICY_TREE *tree); 7781cb0ef41Sopenharmony_ci 7791cb0ef41Sopenharmony_ciSTACK_OF(X509_POLICY_NODE) 7801cb0ef41Sopenharmony_ci *X509_policy_tree_get0_user_policies(const X509_POLICY_TREE *tree); 7811cb0ef41Sopenharmony_ci 7821cb0ef41Sopenharmony_ciint X509_policy_level_node_count(X509_POLICY_LEVEL *level); 7831cb0ef41Sopenharmony_ci 7841cb0ef41Sopenharmony_ciX509_POLICY_NODE *X509_policy_level_get0_node(const X509_POLICY_LEVEL *level, 7851cb0ef41Sopenharmony_ci int i); 7861cb0ef41Sopenharmony_ci 7871cb0ef41Sopenharmony_ciconst ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node); 7881cb0ef41Sopenharmony_ci 7891cb0ef41Sopenharmony_ciSTACK_OF(POLICYQUALINFO) 7901cb0ef41Sopenharmony_ci *X509_policy_node_get0_qualifiers(const X509_POLICY_NODE *node); 7911cb0ef41Sopenharmony_ciconst X509_POLICY_NODE 7921cb0ef41Sopenharmony_ci *X509_policy_node_get0_parent(const X509_POLICY_NODE *node); 7931cb0ef41Sopenharmony_ci 7941cb0ef41Sopenharmony_ci#ifdef __cplusplus 7951cb0ef41Sopenharmony_ci} 7961cb0ef41Sopenharmony_ci#endif 7971cb0ef41Sopenharmony_ci#endif 798