OpenVPN
keyingmaterialexporter.c File Reference
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <stdlib.h>
#include "openvpn-plugin.h"
Include dependency graph for keyingmaterialexporter.c:

Go to the source code of this file.

Data Structures

struct  plugin
struct  session

Macros

#define MAXPATH   1024
#define ovpn_err(fmt, ...)
#define ovpn_dbg(fmt, ...)
#define ovpn_note(fmt, ...)

Enumerations

enum  endpoint { CLIENT = 1 , SERVER = 2 }

Functions

static const char * get_env (const char *name, const char *envp[])
OPENVPN_EXPORT int openvpn_plugin_open_v3 (const int version, struct openvpn_plugin_args_open_in const *args, struct openvpn_plugin_args_open_return *rv)
static void session_user_set (struct session *sess, X509 *x509)
static int tls_verify (struct openvpn_plugin_args_func_in const *args)
static void file_store (const char *file, const char *content)
static void server_store (struct openvpn_plugin_args_func_in const *args)
static void client_store (struct openvpn_plugin_args_func_in const *args)
static int tls_final (struct openvpn_plugin_args_func_in const *args, struct openvpn_plugin_args_func_return *rv)
OPENVPN_EXPORT int openvpn_plugin_func_v3 (const int version, struct openvpn_plugin_args_func_in const *args, struct openvpn_plugin_args_func_return *rv)
OPENVPN_EXPORT void * openvpn_plugin_client_constructor_v1 (openvpn_plugin_handle_t handle)
OPENVPN_EXPORT void openvpn_plugin_client_destructor_v1 (openvpn_plugin_handle_t handle, void *ctx)
OPENVPN_EXPORT void openvpn_plugin_close_v1 (openvpn_plugin_handle_t handle)

Macro Definition Documentation

◆ MAXPATH

#define MAXPATH   1024

Definition at line 37 of file keyingmaterialexporter.c.

Referenced by server_store().

◆ ovpn_dbg

#define ovpn_dbg ( fmt,
... )
Value:
plugin->log(PLOG_DEBUG, "SSO", fmt, ##__VA_ARGS__)
plugin_log_t log

Definition at line 41 of file keyingmaterialexporter.c.

◆ ovpn_err

#define ovpn_err ( fmt,
... )
Value:
plugin->log(PLOG_ERR, "SSO", fmt, ##__VA_ARGS__)

Definition at line 40 of file keyingmaterialexporter.c.

Referenced by tls_verify().

◆ ovpn_note

#define ovpn_note ( fmt,
... )

Enumeration Type Documentation

◆ endpoint

enum endpoint
Enumerator
CLIENT 
SERVER 

Definition at line 44 of file keyingmaterialexporter.c.

Function Documentation

◆ client_store()

void client_store ( struct openvpn_plugin_args_func_in const * args)
static

Definition at line 215 of file keyingmaterialexporter.c.

References file_store(), session::key, and ovpn_note.

Referenced by tls_final().

◆ file_store()

void file_store ( const char * file,
const char * content )
static

Definition at line 190 of file keyingmaterialexporter.c.

Referenced by client_store(), and server_store().

◆ get_env()

const char * get_env ( const char * name,
const char * envp[] )
static

Definition at line 70 of file keyingmaterialexporter.c.

Referenced by openvpn_plugin_open_v3(), and tls_final().

◆ openvpn_plugin_client_constructor_v1()

OPENVPN_EXPORT void * openvpn_plugin_client_constructor_v1 ( openvpn_plugin_handle_t handle)

Definition at line 272 of file keyingmaterialexporter.c.

References ovpn_note.

◆ openvpn_plugin_client_destructor_v1()

OPENVPN_EXPORT void openvpn_plugin_client_destructor_v1 ( openvpn_plugin_handle_t handle,
void * ctx )

Definition at line 283 of file keyingmaterialexporter.c.

References session::key, and ovpn_note.

◆ openvpn_plugin_close_v1()

OPENVPN_EXPORT void openvpn_plugin_close_v1 ( openvpn_plugin_handle_t handle)

Definition at line 295 of file keyingmaterialexporter.c.

◆ openvpn_plugin_func_v3()

OPENVPN_EXPORT int openvpn_plugin_func_v3 ( const int version,
struct openvpn_plugin_args_func_in const * args,
struct openvpn_plugin_args_func_return * rv )

Definition at line 257 of file keyingmaterialexporter.c.

References tls_final(), and tls_verify().

◆ openvpn_plugin_open_v3()

OPENVPN_EXPORT int openvpn_plugin_open_v3 ( const int version,
struct openvpn_plugin_args_open_in const * args,
struct openvpn_plugin_args_open_return * rv )

◆ server_store()

void server_store ( struct openvpn_plugin_args_func_in const * args)
static

Definition at line 203 of file keyingmaterialexporter.c.

References file_store(), session::key, MAXPATH, ovpn_note, and session::user.

Referenced by tls_final().

◆ session_user_set()

void session_user_set ( struct session * sess,
X509 * x509 )
static

Definition at line 117 of file keyingmaterialexporter.c.

References session::user.

Referenced by tls_verify().

◆ tls_final()

int tls_final ( struct openvpn_plugin_args_func_in const * args,
struct openvpn_plugin_args_func_return * rv )
static

◆ tls_verify()

int tls_verify ( struct openvpn_plugin_args_func_in const * args)
static