Ruby  2.5.0dev(2017-10-22revision60238)
Macros | Functions | Variables
ossl_x509ext.c File Reference
#include "ossl.h"

Go to the source code of this file.

Macros

#define NewX509Ext(klass)   TypedData_Wrap_Struct((klass), &ossl_x509ext_type, 0)
 
#define SetX509Ext(obj, ext)
 
#define GetX509Ext(obj, ext)
 
#define MakeX509ExtFactory(klass, obj, ctx)
 
#define GetX509ExtFactory(obj, ctx)
 

Functions

VALUE ossl_x509ext_new (X509_EXTENSION *ext)
 
X509_EXTENSION * GetX509ExtPtr (VALUE obj)
 
void Init_ossl_x509ext (void)
 

Variables

VALUE cX509Ext
 
VALUE cX509ExtFactory
 
VALUE eX509ExtError
 

Macro Definition Documentation

◆ GetX509Ext

#define GetX509Ext (   obj,
  ext 
)
Value:
do { \
TypedData_Get_Struct((obj), X509_EXTENSION, &ossl_x509ext_type, (ext)); \
if (!(ext)) { \
ossl_raise(rb_eRuntimeError, "EXT wasn't initialized!"); \
} \
} while (0)
VALUE rb_eRuntimeError
Definition: error.c:800

Definition at line 20 of file ossl_x509ext.c.

Referenced by GetX509ExtPtr().

◆ GetX509ExtFactory

#define GetX509ExtFactory (   obj,
  ctx 
)
Value:
do { \
TypedData_Get_Struct((obj), X509V3_CTX, &ossl_x509extfactory_type, (ctx)); \
if (!(ctx)) { \
ossl_raise(rb_eRuntimeError, "CTX wasn't initialized!"); \
} \
} while (0)
VALUE rb_eRuntimeError
Definition: error.c:800

Definition at line 33 of file ossl_x509ext.c.

◆ MakeX509ExtFactory

#define MakeX509ExtFactory (   klass,
  obj,
  ctx 
)
Value:
do { \
(obj) = TypedData_Wrap_Struct((klass), &ossl_x509extfactory_type, 0); \
if (!((ctx) = OPENSSL_malloc(sizeof(X509V3_CTX)))) \
ossl_raise(rb_eRuntimeError, "CTX wasn't allocated!"); \
X509V3_set_ctx((ctx), NULL, NULL, NULL, NULL, 0); \
RTYPEDDATA_DATA(obj) = (ctx); \
} while (0)
#define TypedData_Wrap_Struct(klass, data_type, sval)
Definition: ruby.h:1162
VALUE rb_eRuntimeError
Definition: error.c:800
#define NULL
Definition: _sdbm.c:102

Definition at line 26 of file ossl_x509ext.c.

◆ NewX509Ext

#define NewX509Ext (   klass)    TypedData_Wrap_Struct((klass), &ossl_x509ext_type, 0)

Definition at line 12 of file ossl_x509ext.c.

Referenced by ossl_x509ext_new().

◆ SetX509Ext

#define SetX509Ext (   obj,
  ext 
)
Value:
do { \
if (!(ext)) { \
ossl_raise(rb_eRuntimeError, "EXT wasn't initialized!"); \
} \
RTYPEDDATA_DATA(obj) = (ext); \
} while (0)
VALUE rb_eRuntimeError
Definition: error.c:800

Definition at line 14 of file ossl_x509ext.c.

Referenced by ossl_x509ext_new().

Function Documentation

◆ GetX509ExtPtr()

X509_EXTENSION* GetX509ExtPtr ( VALUE  obj)

Definition at line 85 of file ossl_x509ext.c.

References GetX509Ext.

◆ Init_ossl_x509ext()

void Init_ossl_x509ext ( void  )

◆ ossl_x509ext_new()

VALUE ossl_x509ext_new ( X509_EXTENSION *  ext)

Definition at line 65 of file ossl_x509ext.c.

References cX509Ext, eX509ExtError, NewX509Ext, NULL, ossl_raise(), and SetX509Ext.

Variable Documentation

◆ cX509Ext

VALUE cX509Ext

Definition at line 43 of file ossl_x509ext.c.

Referenced by ossl_x509ext_new().

◆ cX509ExtFactory

VALUE cX509ExtFactory

Definition at line 44 of file ossl_x509ext.c.

Referenced by Init_ossl_x509ext().

◆ eX509ExtError

VALUE eX509ExtError

Definition at line 45 of file ossl_x509ext.c.

Referenced by Init_ossl_x509ext(), and ossl_x509ext_new().