Ruby  2.4.2p198(2017-09-14revision59899)
Macros | Functions | Variables
ossl_x509attr.c File Reference
#include "ossl.h"
Include dependency graph for ossl_x509attr.c:

Go to the source code of this file.

Macros

#define NewX509Attr(klass)   TypedData_Wrap_Struct((klass), &ossl_x509attr_type, 0)
 
#define SetX509Attr(obj, attr)
 
#define GetX509Attr(obj, attr)
 
#define SafeGetX509Attr(obj, attr)
 

Functions

static void ossl_x509attr_free (void *ptr)
 
VALUE ossl_x509attr_new (X509_ATTRIBUTE *attr)
 
X509_ATTRIBUTE * GetX509AttrPtr (VALUE obj)
 
static VALUE ossl_x509attr_alloc (VALUE klass)
 
static VALUE ossl_x509attr_initialize (int argc, VALUE *argv, VALUE self)
 
static VALUE ossl_x509attr_initialize_copy (VALUE self, VALUE other)
 
static VALUE ossl_x509attr_set_oid (VALUE self, VALUE oid)
 
static VALUE ossl_x509attr_get_oid (VALUE self)
 
static VALUE ossl_x509attr_set_value (VALUE self, VALUE value)
 
static VALUE ossl_x509attr_get_value (VALUE self)
 
static VALUE ossl_x509attr_to_der (VALUE self)
 
void Init_ossl_x509attr (void)
 

Variables

VALUE cX509Attr
 
VALUE eX509AttrError
 
static const rb_data_type_t ossl_x509attr_type
 

Macro Definition Documentation

◆ GetX509Attr

#define GetX509Attr (   obj,
  attr 
)
Value:
do { \
TypedData_Get_Struct((obj), X509_ATTRIBUTE, &ossl_x509attr_type, (attr)); \
if (!(attr)) { \
ossl_raise(rb_eRuntimeError, "ATTR wasn't initialized!"); \
} \
} while (0)
static const rb_data_type_t ossl_x509attr_type
Definition: ossl_x509attr.c:43
VALUE rb_eRuntimeError
Definition: error.c:761

Definition at line 20 of file ossl_x509attr.c.

Referenced by ossl_x509attr_get_oid(), ossl_x509attr_get_value(), ossl_x509attr_initialize(), ossl_x509attr_initialize_copy(), ossl_x509attr_set_oid(), ossl_x509attr_set_value(), and ossl_x509attr_to_der().

◆ NewX509Attr

#define NewX509Attr (   klass)    TypedData_Wrap_Struct((klass), &ossl_x509attr_type, 0)

Definition at line 12 of file ossl_x509attr.c.

Referenced by ossl_x509attr_alloc(), and ossl_x509attr_new().

◆ SafeGetX509Attr

#define SafeGetX509Attr (   obj,
  attr 
)
Value:
do { \
OSSL_Check_Kind((obj), cX509Attr); \
GetX509Attr((obj), (attr)); \
} while (0)
VALUE cX509Attr
Definition: ossl_x509attr.c:34

Definition at line 26 of file ossl_x509attr.c.

Referenced by GetX509AttrPtr(), and ossl_x509attr_initialize_copy().

◆ SetX509Attr

#define SetX509Attr (   obj,
  attr 
)
Value:
do { \
if (!(attr)) { \
ossl_raise(rb_eRuntimeError, "ATTR wasn't initialized!"); \
} \
RTYPEDDATA_DATA(obj) = (attr); \
} while (0)
VALUE rb_eRuntimeError
Definition: error.c:761

Definition at line 14 of file ossl_x509attr.c.

Referenced by ossl_x509attr_alloc(), ossl_x509attr_initialize_copy(), ossl_x509attr_new(), and ossl_x509attr_set_value().

Function Documentation

◆ GetX509AttrPtr()

X509_ATTRIBUTE* GetX509AttrPtr ( VALUE  obj)

Definition at line 75 of file ossl_x509attr.c.

References SafeGetX509Attr.

Referenced by ossl_x509req_add_attribute(), and ossl_x509req_set_attributes().

◆ Init_ossl_x509attr()

void Init_ossl_x509attr ( void  )

◆ ossl_x509attr_alloc()

static VALUE ossl_x509attr_alloc ( VALUE  klass)
static

Definition at line 88 of file ossl_x509attr.c.

References eX509AttrError, NewX509Attr, NULL, ossl_raise(), and SetX509Attr.

Referenced by Init_ossl_x509attr().

◆ ossl_x509attr_free()

static void ossl_x509attr_free ( void *  ptr)
static

Definition at line 38 of file ossl_x509attr.c.

◆ ossl_x509attr_get_oid()

static VALUE ossl_x509attr_get_oid ( VALUE  self)
static

Definition at line 178 of file ossl_x509attr.c.

References eX509AttrError, GetX509Attr, nid, NULL, ossl_membio2str(), ossl_raise(), and rb_str_new2.

Referenced by Init_ossl_x509attr().

◆ ossl_x509attr_get_value()

static VALUE ossl_x509attr_get_value ( VALUE  self)
static

◆ ossl_x509attr_initialize()

static VALUE ossl_x509attr_initialize ( int  argc,
VALUE argv,
VALUE  self 
)
static

◆ ossl_x509attr_initialize_copy()

static VALUE ossl_x509attr_initialize_copy ( VALUE  self,
VALUE  other 
)
static

◆ ossl_x509attr_new()

VALUE ossl_x509attr_new ( X509_ATTRIBUTE *  attr)

Definition at line 55 of file ossl_x509attr.c.

References cX509Attr, eX509AttrError, NewX509Attr, NULL, ossl_raise(), and SetX509Attr.

Referenced by ossl_x509req_get_attributes().

◆ ossl_x509attr_set_oid()

static VALUE ossl_x509attr_set_oid ( VALUE  self,
VALUE  oid 
)
static

Definition at line 154 of file ossl_x509attr.c.

References eX509AttrError, GetX509Attr, NULL, ossl_raise(), and StringValueCStr.

Referenced by Init_ossl_x509attr().

◆ ossl_x509attr_set_value()

static VALUE ossl_x509attr_set_value ( VALUE  self,
VALUE  value 
)
static

◆ ossl_x509attr_to_der()

static VALUE ossl_x509attr_to_der ( VALUE  self)
static

Variable Documentation

◆ cX509Attr

VALUE cX509Attr

◆ eX509AttrError

VALUE eX509AttrError

◆ ossl_x509attr_type

const rb_data_type_t ossl_x509attr_type
static
Initial value:
= {
"OpenSSL/X509/ATTRIBUTE",
{
},
}
#define RUBY_TYPED_FREE_IMMEDIATELY
Definition: ruby.h:1145
static void ossl_x509attr_free(void *ptr)
Definition: ossl_x509attr.c:38

Definition at line 43 of file ossl_x509attr.c.