Defines | Functions | Variables

ext/openssl/ossl_x509ext.c File Reference

#include "ossl.h"
Include dependency graph for ossl_x509ext.c:

Go to the source code of this file.

Defines

#define WrapX509Ext(klass, obj, ext)
#define GetX509Ext(obj, ext)
#define SafeGetX509Ext(obj, ext)
#define MakeX509ExtFactory(klass, obj, ctx)
#define GetX509ExtFactory(obj, ctx)
#define ossl_x509extfactory_set_config   rb_f_notimplement

Functions

VALUE ossl_x509ext_new (X509_EXTENSION *ext)
X509_EXTENSION * GetX509ExtPtr (VALUE obj)
X509_EXTENSION * DupX509ExtPtr (VALUE obj)
static void ossl_x509extfactory_free (X509V3_CTX *ctx)
static VALUE ossl_x509extfactory_alloc (VALUE klass)
static VALUE ossl_x509extfactory_set_issuer_cert (VALUE self, VALUE cert)
static VALUE ossl_x509extfactory_set_subject_cert (VALUE self, VALUE cert)
static VALUE ossl_x509extfactory_set_subject_req (VALUE self, VALUE req)
static VALUE ossl_x509extfactory_set_crl (VALUE self, VALUE crl)
static VALUE ossl_x509extfactory_initialize (int argc, VALUE *argv, VALUE self)
static VALUE ossl_x509extfactory_create_ext (int argc, VALUE *argv, VALUE self)
static VALUE ossl_x509ext_alloc (VALUE klass)
static VALUE ossl_x509ext_initialize (int argc, VALUE *argv, VALUE self)
static VALUE ossl_x509ext_set_oid (VALUE self, VALUE oid)
static VALUE ossl_x509ext_set_value (VALUE self, VALUE data)
static VALUE ossl_x509ext_set_critical (VALUE self, VALUE flag)
static VALUE ossl_x509ext_get_oid (VALUE obj)
static VALUE ossl_x509ext_get_value (VALUE obj)
static VALUE ossl_x509ext_get_critical (VALUE obj)
static VALUE ossl_x509ext_to_der (VALUE obj)
void Init_ossl_x509ext ()

Variables

VALUE cX509Ext
VALUE cX509ExtFactory
VALUE eX509ExtError

Define Documentation

#define GetX509Ext (   obj,
  ext 
)
Value:
do { \
    Data_Get_Struct(obj, X509_EXTENSION, ext); \
    if (!ext) { \
        ossl_raise(rb_eRuntimeError, "EXT wasn't initialized!"); \
    } \
} while (0)

Definition at line 19 of file ossl_x509ext.c.

Referenced by ossl_x509ext_get_critical(), ossl_x509ext_get_oid(), ossl_x509ext_get_value(), ossl_x509ext_initialize(), ossl_x509ext_set_critical(), ossl_x509ext_set_oid(), ossl_x509ext_set_value(), and ossl_x509ext_to_der().

#define GetX509ExtFactory (   obj,
  ctx 
)
Value:
do { \
    Data_Get_Struct(obj, X509V3_CTX, ctx); \
    if (!ctx) { \
        ossl_raise(rb_eRuntimeError, "CTX wasn't initialized!"); \
    } \
} while (0)

Definition at line 35 of file ossl_x509ext.c.

Referenced by ossl_x509extfactory_create_ext(), ossl_x509extfactory_set_crl(), ossl_x509extfactory_set_issuer_cert(), ossl_x509extfactory_set_subject_cert(), and ossl_x509extfactory_set_subject_req().

#define MakeX509ExtFactory (   klass,
  obj,
  ctx 
)
Value:
do { \
    if (!(ctx = OPENSSL_malloc(sizeof(X509V3_CTX)))) \
        ossl_raise(rb_eRuntimeError, "CTX wasn't allocated!"); \
    X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, 0); \
    obj = Data_Wrap_Struct(klass, 0, ossl_x509extfactory_free, ctx); \
} while (0)

Definition at line 29 of file ossl_x509ext.c.

Referenced by ossl_x509extfactory_alloc().

#define ossl_x509extfactory_set_config   rb_f_notimplement

Definition at line 181 of file ossl_x509ext.c.

Referenced by Init_ossl_x509ext().

#define SafeGetX509Ext (   obj,
  ext 
)
Value:
do { \
    OSSL_Check_Kind(obj, cX509Ext); \
    GetX509Ext(obj, ext); \
} while (0)

Definition at line 25 of file ossl_x509ext.c.

Referenced by DupX509ExtPtr(), and GetX509ExtPtr().

#define WrapX509Ext (   klass,
  obj,
  ext 
)
Value:
do { \
    if (!ext) { \
        ossl_raise(rb_eRuntimeError, "EXT wasn't initialized!"); \
    } \
    obj = Data_Wrap_Struct(klass, 0, X509_EXTENSION_free, ext); \
} while (0)

Definition at line 13 of file ossl_x509ext.c.

Referenced by ossl_x509ext_alloc(), ossl_x509ext_new(), and ossl_x509extfactory_create_ext().


Function Documentation

X509_EXTENSION* DupX509ExtPtr ( VALUE  obj  ) 
X509_EXTENSION* GetX509ExtPtr ( VALUE  obj  ) 

Definition at line 72 of file ossl_x509ext.c.

References SafeGetX509Ext.

void Init_ossl_x509ext ( void   ) 
static VALUE ossl_x509ext_alloc ( VALUE  klass  )  [static]

Definition at line 260 of file ossl_x509ext.c.

References eX509ExtError, NULL, ossl_raise(), and WrapX509Ext.

Referenced by Init_ossl_x509ext().

static VALUE ossl_x509ext_get_critical ( VALUE  obj  )  [static]

Definition at line 395 of file ossl_x509ext.c.

References GetX509Ext, and Qtrue.

Referenced by Init_ossl_x509ext().

static VALUE ossl_x509ext_get_oid ( VALUE  obj  )  [static]

Definition at line 355 of file ossl_x509ext.c.

References eX509ExtError, GetX509Ext, NULL, ossl_membio2str(), ossl_raise(), and rb_str_new2().

Referenced by Init_ossl_x509ext().

static VALUE ossl_x509ext_get_value ( VALUE  obj  )  [static]

Definition at line 378 of file ossl_x509ext.c.

References eX509ExtError, GetX509Ext, NULL, ossl_membio2str(), and ossl_raise().

Referenced by Init_ossl_x509ext().

static VALUE ossl_x509ext_initialize ( int  argc,
VALUE argv,
VALUE  self 
) [static]
VALUE ossl_x509ext_new ( X509_EXTENSION *  ext  ) 
static VALUE ossl_x509ext_set_critical ( VALUE  self,
VALUE  flag 
) [static]

Definition at line 344 of file ossl_x509ext.c.

References GetX509Ext, and RTEST.

Referenced by Init_ossl_x509ext().

static VALUE ossl_x509ext_set_oid ( VALUE  self,
VALUE  oid 
) [static]

Definition at line 299 of file ossl_x509ext.c.

References eX509ExtError, GetX509Ext, NULL, ossl_raise(), and StringValuePtr.

Referenced by Init_ossl_x509ext().

static VALUE ossl_x509ext_set_value ( VALUE  self,
VALUE  data 
) [static]
static VALUE ossl_x509ext_to_der ( VALUE  obj  )  [static]

Definition at line 404 of file ossl_x509ext.c.

References eX509ExtError, GetX509Ext, len, NULL, ossl_raise(), ossl_str_adjust, rb_str_new(), and RSTRING_PTR.

Referenced by Init_ossl_x509ext().

static VALUE ossl_x509extfactory_alloc ( VALUE  klass  )  [static]

Definition at line 107 of file ossl_x509ext.c.

References MakeX509ExtFactory, Qnil, and rb_iv_set().

Referenced by Init_ossl_x509ext().

static VALUE ossl_x509extfactory_create_ext ( int  argc,
VALUE argv,
VALUE  self 
) [static]
static void ossl_x509extfactory_free ( X509V3_CTX *  ctx  )  [static]

Definition at line 101 of file ossl_x509ext.c.

static VALUE ossl_x509extfactory_initialize ( int  argc,
VALUE argv,
VALUE  self 
) [static]
static VALUE ossl_x509extfactory_set_crl ( VALUE  self,
VALUE  crl 
) [static]

Definition at line 155 of file ossl_x509ext.c.

References GetX509CRLPtr(), GetX509ExtFactory, and rb_iv_set().

Referenced by Init_ossl_x509ext(), and ossl_x509extfactory_initialize().

static VALUE ossl_x509extfactory_set_issuer_cert ( VALUE  self,
VALUE  cert 
) [static]
static VALUE ossl_x509extfactory_set_subject_cert ( VALUE  self,
VALUE  cert 
) [static]
static VALUE ossl_x509extfactory_set_subject_req ( VALUE  self,
VALUE  req 
) [static]

Definition at line 143 of file ossl_x509ext.c.

References GetX509ExtFactory, GetX509ReqPtr(), and rb_iv_set().

Referenced by Init_ossl_x509ext(), and ossl_x509extfactory_initialize().


Variable Documentation

Definition at line 46 of file ossl_x509ext.c.

Referenced by Init_ossl_x509ext().