OpenVPN
Data Structures | Macros | Enumerations | Functions
keyingmaterialexporter.c File Reference
#include <stdio.h>
#include <string.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, ...)   plugin->log(PLOG_ERR, "SSO", fmt, ## __VA_ARGS__)
 
#define ovpn_dbg(fmt, ...)   plugin->log(PLOG_DEBUG, "SSO", fmt, ## __VA_ARGS__)
 
#define ovpn_note(fmt, ...)   plugin->log(PLOG_NOTE, "SSO", fmt, ## __VA_ARGS__)
 

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 (char *file, 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,
  ... 
)    plugin->log(PLOG_DEBUG, "SSO", fmt, ## __VA_ARGS__)

Definition at line 42 of file keyingmaterialexporter.c.

◆ ovpn_err

#define ovpn_err (   fmt,
  ... 
)    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,
  ... 
)    plugin->log(PLOG_NOTE, "SSO", fmt, ## __VA_ARGS__)

Enumeration Type Documentation

◆ endpoint

enum endpoint
Enumerator
CLIENT 
SERVER 

Definition at line 47 of file keyingmaterialexporter.c.

Function Documentation

◆ client_store()

static void client_store ( struct openvpn_plugin_args_func_in const *  args)
static

◆ file_store()

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

Definition at line 182 of file keyingmaterialexporter.c.

References http-client::f.

Referenced by client_store(), and server_store().

◆ get_env()

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

Definition at line 67 of file keyingmaterialexporter.c.

References OPENVPN_EXPORT.

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 265 of file keyingmaterialexporter.c.

References OPENVPN_EXPORT, and 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 276 of file keyingmaterialexporter.c.

References free, session::key, OPENVPN_EXPORT, and ovpn_note.

◆ openvpn_plugin_close_v1()

OPENVPN_EXPORT void openvpn_plugin_close_v1 ( openvpn_plugin_handle_t  handle)

Definition at line 288 of file keyingmaterialexporter.c.

References free.

◆ 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 
)

◆ 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()

static void server_store ( struct openvpn_plugin_args_func_in const *  args)
static

◆ session_user_set()

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

Definition at line 110 of file keyingmaterialexporter.c.

References snprintf, strncasecmp, and session::user.

Referenced by tls_verify().

◆ tls_final()

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

◆ tls_verify()

static int tls_verify ( struct openvpn_plugin_args_func_in const *  args)
static