Ruby 2.0.0p353(2013-11-22revision43784)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Functions | Variables
ossl_x509store.c File Reference
`#include "ossl.h"`
Include dependency graph for ossl_x509store.c:

Go to the source code of this file.

## Macros
#define | WrapX509Store(klass, obj, st)
#define | GetX509Store(obj, st)
#define | SafeGetX509Store(obj, st)
#define | WrapX509StCtx(klass, obj, ctx)
#define | GetX509StCtx(obj, ctx)
#define | SafeGetX509StCtx(obj, storep)

## Functions
VALUE | ossl_x509store_new (X509_STORE *store)
X509_STORE * | GetX509StorePtr (VALUE obj)
X509_STORE * | DupX509StorePtr (VALUE obj)
static VALUE | ossl_x509store_alloc (VALUE klass)
static VALUE | ossl_x509store_set_vfy_cb (VALUE self, VALUE cb)
static VALUE | ossl_x509store_initialize (int argc, VALUE *argv, VALUE self)
static VALUE | ossl_x509store_set_flags (VALUE self, VALUE flags)
static VALUE | ossl_x509store_set_purpose (VALUE self, VALUE purpose)
static VALUE | ossl_x509store_set_trust (VALUE self, VALUE trust)
static VALUE | ossl_x509store_set_time (VALUE self, VALUE time)
static VALUE | ossl_x509store_add_file (VALUE self, VALUE file)
static VALUE | ossl_x509store_add_path (VALUE self, VALUE dir)
static VALUE | ossl_x509store_set_default_paths (VALUE self)
static VALUE | ossl_x509store_add_cert (VALUE self, VALUE arg)
static VALUE | ossl_x509store_add_crl (VALUE self, VALUE arg)
static VALUE | ossl_x509stctx_get_err (VALUE)
static VALUE | ossl_x509stctx_get_err_string (VALUE)
static VALUE | ossl_x509stctx_get_chain (VALUE)
static VALUE | ossl_x509store_verify (int argc, VALUE *argv, VALUE self)
static void | ossl_x509stctx_free (X509_STORE_CTX *)
VALUE | ossl_x509stctx_new (X509_STORE_CTX *ctx)
VALUE | ossl_x509stctx_clear_ptr (VALUE obj)
static VALUE | ossl_x509stctx_alloc (VALUE klass)
static VALUE | ossl_x509stctx_set_flags (VALUE, VALUE)
static VALUE | ossl_x509stctx_set_purpose (VALUE, VALUE)
static VALUE | ossl_x509stctx_set_trust (VALUE, VALUE)
static VALUE | ossl_x509stctx_set_time (VALUE, VALUE)
static VALUE | ossl_x509stctx_initialize (int argc, VALUE *argv, VALUE self)
static VALUE | ossl_x509stctx_verify (VALUE self)
static VALUE | ossl_x509stctx_set_error (VALUE self, VALUE err)
static VALUE | ossl_x509stctx_get_err_depth (VALUE self)
static VALUE | ossl_x509stctx_get_curr_cert (VALUE self)
static VALUE | ossl_x509stctx_get_curr_crl (VALUE self)
void | Init_ossl_x509store ()

## Variables
VALUE | cX509Store
VALUE | cX509StoreContext
VALUE | eX509StoreError

## Macro Definition Documentation

#define GetX509StCtx | ( |  | obj,
|  |  | ctx
| ) |  |

Value:
do { \
Data_Get_Struct((obj), X509_STORE_CTX, (ctx)); \
if (!(ctx)) { \
ossl_raise(rb_eRuntimeError, "STORE_CTX is out of scope!"); \
} \
} while (0)
rb_eRuntimeError
VALUE rb_eRuntimeError
Definition: error.c:510
obj
static VALUE VALUE obj
Definition: tcltklib.c:3158
if
if(RB_TYPE_P(r, T_FLOAT))
Definition: bigdecimal.c:1186
Data_Get_Struct
#define Data_Get_Struct(obj, type, sval)
ossl_raise
void ossl_raise(VALUE exc, const char *fmt,...)
Definition: ossl.c:328

Definition at line 36 of file ossl_x509store.c.

Referenced by ossl_x509stctx_get_chain(), ossl_x509stctx_get_curr_cert(), ossl_x509stctx_get_curr_crl(), ossl_x509stctx_get_err(), ossl_x509stctx_get_err_depth(), ossl_x509stctx_get_err_string(), ossl_x509stctx_initialize(), ossl_x509stctx_set_error(), ossl_x509stctx_set_flags(), ossl_x509stctx_set_purpose(), ossl_x509stctx_set_time(), ossl_x509stctx_set_trust(), and ossl_x509stctx_verify().

#define GetX509Store | ( |  | obj,
|  |  | st
| ) |  |

Value:
do { \
Data_Get_Struct((obj), X509_STORE, (st)); \
if (!(st)) { \
ossl_raise(rb_eRuntimeError, "STORE wasn't initialized!"); \
} \
} while (0)
rb_eRuntimeError
VALUE rb_eRuntimeError
Definition: error.c:510
obj
static VALUE VALUE obj
Definition: tcltklib.c:3158
if
if(RB_TYPE_P(r, T_FLOAT))
Definition: bigdecimal.c:1186
Data_Get_Struct
#define Data_Get_Struct(obj, type, sval)
ossl_raise
void ossl_raise(VALUE exc, const char *fmt,...)
Definition: ossl.c:328
st
Tcl_Interp *int * st
Definition: stubs.c:510

Definition at line 19 of file ossl_x509store.c.

Referenced by ossl_x509store_add_cert(), ossl_x509store_add_crl(), ossl_x509store_add_file(), ossl_x509store_add_path(), ossl_x509store_initialize(), ossl_x509store_set_default_paths(), ossl_x509store_set_flags(), ossl_x509store_set_purpose(), ossl_x509store_set_trust(), and ossl_x509store_set_vfy_cb().

#define SafeGetX509StCtx | ( |  | obj,
|  |  | storep
| ) |  |

Value:
do { \
OSSL_Check_Kind((obj), cX509StoreContext); \
GetX509Store((obj), (ctx)); \
} while (0)
GetX509Store
#define GetX509Store(obj, st)
Definition: ossl_x509store.c:19
obj
static VALUE VALUE obj
Definition: tcltklib.c:3158
cX509StoreContext
VALUE cX509StoreContext
Definition: ossl_x509store.c:51
OSSL_Check_Kind
#define OSSL_Check_Kind(obj, klass)
Definition: ossl.h:96

Definition at line 42 of file ossl_x509store.c.

#define SafeGetX509Store | ( |  | obj,
|  |  | st
| ) |  |

Value:
do { \
OSSL_Check_Kind((obj), cX509Store); \
GetX509Store((obj), (st)); \
} while (0)
GetX509Store
#define GetX509Store(obj, st)
Definition: ossl_x509store.c:19
obj
static VALUE VALUE obj
Definition: tcltklib.c:3158
cX509Store
VALUE cX509Store
Definition: ossl_x509store.c:50
OSSL_Check_Kind
#define OSSL_Check_Kind(obj, klass)
Definition: ossl.h:96
st
Tcl_Interp *int * st
Definition: stubs.c:510

Definition at line 25 of file ossl_x509store.c.

Referenced by DupX509StorePtr(), GetX509StorePtr(), and ossl_x509stctx_initialize().

#define WrapX509StCtx | ( |  | klass,
|  |  | obj,
|  |  | ctx
| ) |  |

Value:
do { \
if (!(ctx)) { \
ossl_raise(rb_eRuntimeError, "STORE_CTX wasn't initialized!"); \
} \
(obj) = Data_Wrap_Struct((klass), 0, ossl_x509stctx_free, (ctx)); \
} while (0)
Data_Wrap_Struct
return Data_Wrap_Struct(CLASS_OF(interp), 0, ip_free, slave)
rb_eRuntimeError
VALUE rb_eRuntimeError
Definition: error.c:510
obj
static VALUE VALUE obj
Definition: tcltklib.c:3158
if
if(RB_TYPE_P(r, T_FLOAT))
Definition: bigdecimal.c:1186
ossl_x509stctx_free
static void ossl_x509stctx_free(X509_STORE_CTX *)
Definition: ossl_x509store.c:370
klass
klass
Definition: tcltklib.c:3504
ossl_raise
void ossl_raise(VALUE exc, const char *fmt,...)
Definition: ossl.c:328

Definition at line 30 of file ossl_x509store.c.

Referenced by ossl_x509stctx_alloc(), and ossl_x509stctx_new().

#define WrapX509Store | ( |  | klass,
|  |  | obj,
|  |  | st
| ) |  |

Value:
do { \
if (!(st)) { \
ossl_raise(rb_eRuntimeError, "STORE wasn't initialized!"); \
} \
(obj) = Data_Wrap_Struct((klass), 0, X509_STORE_free, (st)); \
} while (0)
Data_Wrap_Struct
return Data_Wrap_Struct(CLASS_OF(interp), 0, ip_free, slave)
rb_eRuntimeError
VALUE rb_eRuntimeError
Definition: error.c:510
obj
static VALUE VALUE obj
Definition: tcltklib.c:3158
if
if(RB_TYPE_P(r, T_FLOAT))
Definition: bigdecimal.c:1186
klass
klass
Definition: tcltklib.c:3504
ossl_raise
void ossl_raise(VALUE exc, const char *fmt,...)
Definition: ossl.c:328
st
Tcl_Interp *int * st
Definition: stubs.c:510

Definition at line 13 of file ossl_x509store.c.

Referenced by ossl_x509store_alloc(), and ossl_x509store_new().

## Function Documentation

X509_STORE* DupX509StorePtr | ( | VALUE | obj | ) |

Definition at line 78 of file ossl_x509store.c.

References SafeGetX509Store.

X509_STORE* GetX509StorePtr | ( | VALUE | obj | ) |

Definition at line 68 of file ossl_x509store.c.

References SafeGetX509Store.

Referenced by ossl_pkcs7_verify(), and ossl_sslctx_setup().

void Init_ossl_x509store | ( | void |  | ) |

Definition at line 596 of file ossl_x509store.c.

References cX509Store, cX509StoreContext, eOSSLError, eX509StoreError, mOSSL, mX509, ossl_x509stctx_alloc(), ossl_x509stctx_get_chain(), ossl_x509stctx_get_curr_cert(), ossl_x509stctx_get_curr_crl(), ossl_x509stctx_get_err(), ossl_x509stctx_get_err_depth(), ossl_x509stctx_get_err_string(), ossl_x509stctx_initialize(), ossl_x509stctx_set_error(), ossl_x509stctx_set_flags(), ossl_x509stctx_set_purpose(), ossl_x509stctx_set_time(), ossl_x509stctx_set_trust(), ossl_x509stctx_verify(), ossl_x509store_add_cert(), ossl_x509store_add_crl(), ossl_x509store_add_file(), ossl_x509store_add_path(), ossl_x509store_alloc(), ossl_x509store_initialize(), ossl_x509store_set_default_paths(), ossl_x509store_set_flags(), ossl_x509store_set_purpose(), ossl_x509store_set_time(), ossl_x509store_set_trust(), ossl_x509store_set_vfy_cb(), ossl_x509store_verify(), Qfalse, rb_attr(), rb_cObject, rb_define_alloc_func(), rb_define_class_under(), rb_define_method(), rb_define_module(), rb_define_module_under(), and rb_intern.

Referenced by Init_ossl_x509().

static VALUE ossl_x509stctx_alloc | ( | VALUE | klass | ) |
| static

Definition at line 380 of file ossl_x509store.c.

References eX509StoreError, NULL, obj, ossl_raise(), and WrapX509StCtx.

Referenced by Init_ossl_x509store().

VALUE ossl_x509stctx_clear_ptr | ( | VALUE | obj | ) |

Definition at line 358 of file ossl_x509store.c.

References cX509StoreContext, NULL, obj, OSSL_Check_Kind, and RDATA.

Referenced by ossl_verify_cb().

static void ossl_x509stctx_free | ( | X509_STORE_CTX * | ctx | ) |
| static

Definition at line 370 of file ossl_x509store.c.

static VALUE ossl_x509stctx_get_chain | ( | VALUE | self | ) |
| static

Definition at line 446 of file ossl_x509store.c.

References ary, GetX509StCtx, i, NULL, OSSL_Debug, ossl_x509_new(), Qnil, rb_ary_new(), rb_ary_new2(), rb_ary_push(), and STACK_OF().

Referenced by Init_ossl_x509store(), and ossl_x509store_verify().

static VALUE ossl_x509stctx_get_curr_cert | ( | VALUE | self | ) |
| static

Definition at line 515 of file ossl_x509store.c.

References GetX509StCtx, and ossl_x509_new().

Referenced by Init_ossl_x509store().

static VALUE ossl_x509stctx_get_curr_crl | ( | VALUE | self | ) |
| static

Definition at line 525 of file ossl_x509store.c.

References GetX509StCtx, ossl_x509crl_new(), and Qnil.

Referenced by Init_ossl_x509store().

static VALUE ossl_x509stctx_get_err | ( | VALUE | self | ) |
| static

Definition at line 472 of file ossl_x509store.c.

References GetX509StCtx, and INT2FIX.

Referenced by Init_ossl_x509store(), and ossl_x509store_verify().

static VALUE ossl_x509stctx_get_err_depth | ( | VALUE | self | ) |
| static

Definition at line 505 of file ossl_x509store.c.

References GetX509StCtx, and INT2FIX.

Referenced by Init_ossl_x509store().

static VALUE ossl_x509stctx_get_err_string | ( | VALUE | self | ) |
| static

Definition at line 493 of file ossl_x509store.c.

References err, GetX509StCtx, and rb_str_new2.

Referenced by Init_ossl_x509store(), and ossl_x509store_verify().

static VALUE ossl_x509stctx_initialize | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |
| static

Definition at line 399 of file ossl_x509store.c.

References DupX509CertPtr(), eX509StoreError, GetX509StCtx, NIL_P(), NULL, ossl_raise(), ossl_x509stctx_set_flags(), ossl_x509stctx_set_purpose(), ossl_x509stctx_set_time(), ossl_x509stctx_set_trust(), rb_iv_get(), rb_iv_set(), rb_scan_args(), SafeGetX509Store, STACK_OF(), and t.

Referenced by Init_ossl_x509store().

VALUE ossl_x509stctx_new | ( | X509_STORE_CTX * | ctx | ) |

Definition at line 348 of file ossl_x509store.c.

References cX509StoreContext, obj, and WrapX509StCtx.

Referenced by ossl_verify_cb().

static VALUE ossl_x509stctx_set_error | ( | VALUE | self,
|  | VALUE | err
| ) |  |
| static

Definition at line 482 of file ossl_x509store.c.

References err, GetX509StCtx, and NUM2INT.

Referenced by Init_ossl_x509store().

static VALUE ossl_x509stctx_set_flags | ( | VALUE | self,
|  | VALUE | flags
| ) |  |
| static

Definition at line 540 of file ossl_x509store.c.

References f, flags, GetX509StCtx, and NUM2LONG.

Referenced by Init_ossl_x509store(), and ossl_x509stctx_initialize().

static VALUE ossl_x509stctx_set_purpose | ( | VALUE | self,
|  | VALUE | purpose
| ) |  |
| static

Definition at line 552 of file ossl_x509store.c.

References GetX509StCtx, NUM2INT, and p.

Referenced by Init_ossl_x509store(), and ossl_x509stctx_initialize().

static VALUE ossl_x509stctx_set_time | ( | VALUE | self,
|  | VALUE | time
| ) |  |
| static

Definition at line 580 of file ossl_x509store.c.

References GetX509StCtx, NUM2LONG, rb_Integer(), t, and time.

Referenced by Init_ossl_x509store(), and ossl_x509stctx_initialize().

static VALUE ossl_x509stctx_set_trust | ( | VALUE | self,
|  | VALUE | trust
| ) |  |
| static

Definition at line 564 of file ossl_x509store.c.

References GetX509StCtx, NUM2INT, and t.

Referenced by Init_ossl_x509store(), and ossl_x509stctx_initialize().

static VALUE ossl_x509stctx_verify | ( | VALUE | self | ) |
| static

Definition at line 432 of file ossl_x509store.c.

References GetX509StCtx, ossl_verify_cb_idx, Qfalse, Qtrue, rb_iv_get(), and result.

Referenced by Init_ossl_x509store().

static VALUE ossl_x509store_add_cert | ( | VALUE | self,
|  | VALUE | arg
| ) |  |
| static

Definition at line 289 of file ossl_x509store.c.

References eX509StoreError, GetX509CertPtr(), GetX509Store, NULL, and ossl_raise().

Referenced by Init_ossl_x509store().

static VALUE ossl_x509store_add_crl | ( | VALUE | self,
|  | VALUE | arg
| ) |  |
| static

Definition at line 304 of file ossl_x509store.c.

References eX509StoreError, GetX509CRLPtr(), GetX509Store, NULL, and ossl_raise().

Referenced by Init_ossl_x509store().

static VALUE ossl_x509store_add_file | ( | VALUE | self,
|  | VALUE | file
| ) |  |
| static

Definition at line 217 of file ossl_x509store.c.

References eX509StoreError, GetX509Store, NULL, ossl_raise(), path, Qnil, RSTRING_PTR, and SafeStringValue.

Referenced by Init_ossl_x509store().

static VALUE ossl_x509store_add_path | ( | VALUE | self,
|  | VALUE | dir
| ) |  |
| static

Definition at line 238 of file ossl_x509store.c.

References eX509StoreError, GetX509Store, NULL, ossl_raise(), path, Qnil, RSTRING_PTR, and SafeStringValue.

Referenced by Init_ossl_x509store().

static VALUE ossl_x509store_alloc | ( | VALUE | klass | ) |
| static

Definition at line 92 of file ossl_x509store.c.

References eX509StoreError, NULL, obj, ossl_raise(), and WrapX509Store.

Referenced by Init_ossl_x509store().

static VALUE ossl_x509store_initialize | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |
| static

Definition at line 127 of file ossl_x509store.c.

References GetX509Store, INT2NUM, NULL, ossl_verify_cb(), ossl_x509store_set_vfy_cb(), Qnil, and rb_iv_set().

Referenced by Init_ossl_x509store().

VALUE ossl_x509store_new | ( | X509_STORE * | store | ) |

Definition at line 58 of file ossl_x509store.c.

References cX509Store, obj, and WrapX509Store.

static VALUE ossl_x509store_set_default_paths | ( | VALUE | self | ) |
| static

Definition at line 269 of file ossl_x509store.c.

References eX509StoreError, GetX509Store, NULL, ossl_raise(), and Qnil.

Referenced by Init_ossl_x509store().

static VALUE ossl_x509store_set_flags | ( | VALUE | self,
|  | VALUE | flags
| ) |  |
| static

Definition at line 153 of file ossl_x509store.c.

References f, flags, GetX509Store, NUM2LONG, and rb_iv_set().

Referenced by Init_ossl_x509store().

static VALUE ossl_x509store_set_purpose | ( | VALUE | self,
|  | VALUE | purpose
| ) |  |
| static

Definition at line 169 of file ossl_x509store.c.

References GetX509Store, NUM2INT, p, and rb_iv_set().

Referenced by Init_ossl_x509store().

static VALUE ossl_x509store_set_time | ( | VALUE | self,
|  | VALUE | time
| ) |  |
| static

Definition at line 201 of file ossl_x509store.c.

References rb_iv_set(), and time.

Referenced by Init_ossl_x509store().

static VALUE ossl_x509store_set_trust | ( | VALUE | self,
|  | VALUE | trust
| ) |  |
| static

Definition at line 185 of file ossl_x509store.c.

References GetX509Store, NUM2INT, rb_iv_set(), and t.

Referenced by Init_ossl_x509store().

static VALUE ossl_x509store_set_vfy_cb | ( | VALUE | self,
|  | VALUE | cb
| ) |  |
| static

Definition at line 109 of file ossl_x509store.c.

References GetX509Store, ossl_verify_cb_idx, rb_iv_set(), and X509_STORE_set_ex_data().

Referenced by Init_ossl_x509store(), and ossl_x509store_initialize().

static VALUE ossl_x509store_verify | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |
| static

Definition at line 323 of file ossl_x509store.c.

References cX509StoreContext, ossl_x509stctx_get_chain(), ossl_x509stctx_get_err(), ossl_x509stctx_get_err_string(), proc, rb_block_given_p(), rb_block_proc(), rb_funcall(), rb_intern, rb_iv_get(), rb_iv_set(), rb_scan_args(), and result.

Referenced by Init_ossl_x509store().

## Variable Documentation

VALUE cX509Store

Definition at line 50 of file ossl_x509store.c.

Referenced by Init_ossl_x509store(), and ossl_x509store_new().

VALUE cX509StoreContext

Definition at line 51 of file ossl_x509store.c.

Referenced by Init_ossl_x509store(), ossl_x509stctx_clear_ptr(), ossl_x509stctx_new(), and ossl_x509store_verify().

VALUE eX509StoreError

Definition at line 52 of file ossl_x509store.c.

Referenced by Init_ossl_x509store(), ossl_x509stctx_alloc(), ossl_x509stctx_initialize(), ossl_x509store_add_cert(), ossl_x509store_add_crl(), ossl_x509store_add_file(), ossl_x509store_add_path(), ossl_x509store_alloc(), and ossl_x509store_set_default_paths().