Go to the documentation of this file.
37 #ifdef ENABLE_CRYPTO_OPENSSL
40 #ifdef ENABLE_CRYPTO_MBEDTLS
51 #define MAX_CERT_DEPTH 16
63 #define VERIFY_X509_NONE 0
64 #define VERIFY_X509_SUBJECT_DN 1
65 #define VERIFY_X509_SUBJECT_RDN 2
66 #define VERIFY_X509_SUBJECT_RDN_PREFIX 3
109 #define TLS_AUTHENTICATED(multi, ks) ((ks)->state >= (S_GOT_KEY - (multi)->opt.server))
218 #define XT_FULL_CHAIN (1<<0)
227 #define NS_CERT_CHECK_NONE (0)
229 #define NS_CERT_CHECK_SERVER (1<<0)
231 #define NS_CERT_CHECK_CLIENT (1<<1)
234 #define OPENVPN_KU_REQUIRED (0xFFFF)
239 #ifdef ENABLE_MANAGEMENT
253 static inline const char *
#define MAX_CERT_DEPTH
Maximum certificate depth we will allow.
void cert_hash_free(struct cert_hash_set *chs)
Frees the given set of certificate hashes.
struct cert_hash * ch[MAX_CERT_DEPTH]
Array of certificate hashes.
unsigned char sha256_hash[256/8]
@ TLS_AUTHENTICATION_SUCCEEDED
const char * tls_username(const struct tls_multi *multi, const bool null)
Returns the username field for the given tunnel.
static const char * tls_client_reason(struct tls_multi *multi)
enum tls_auth_status tls_authentication_status(struct tls_multi *multi)
Return current session authentication state of the tls_multi structure This will return TLS_AUTHENTIC...
bool tls_authenticate_key(struct tls_multi *multi, const unsigned int mda_key_id, const bool auth, const char *client_reason)
Security parameter state for a single VPN tunnel.
void tls_lock_cert_hash_set(struct tls_multi *multi)
Locks the certificate hash set used in the given tunnel.
void verify_crresponse_script(struct tls_multi *multi, const char *cr_response)
Runs the –client-crresponse script if one is defined.
@ TLS_AUTHENTICATION_FAILED
const char * tls_common_name(const struct tls_multi *multi, const bool null)
Returns the common name field for the given tunnel.
void verify_crresponse_plugin(struct tls_multi *multi, const char *cr_response)
Call the plugin OPENVPN_PLUGIN_CLIENT_CRRESPONSE.
const struct x509_track * next
Security parameter state of a single session within a VPN tunnel.
Structure containing the hashes for a full certificate chain.
void verify_final_auth_checks(struct tls_multi *multi, struct tls_session *session)
Perform final authentication checks, including locking of the cn, the allowed certificate hashes,...
Structure containing the hash for a single certificate.
void tls_lock_common_name(struct tls_multi *multi)
Locks the common name field for the given tunnel.
void verify_user_pass(struct user_pass *up, struct tls_multi *multi, struct tls_session *session)
Verify the given username and password, using either an external script, a plugin,...
void auth_set_client_reason(struct tls_multi *multi, const char *client_reason)
Sets the reason why authentication of a client failed.
void tls_x509_clear_env(struct env_set *es)
Remove any X509_ env variables from env_set es.
void key_state_rm_auth_control_files(struct auth_deferred_status *ads)
Remove the given key state's auth deferred status auth control file, if it exists.
@ TLS_AUTHENTICATION_DEFERRED
bool cert_hash_compare(const struct cert_hash_set *chs1, const struct cert_hash_set *chs2)
Compares certificates hashes, returns true if hashes are equal.