ext/openssl/ossl_ocsp.c File Reference

#include "ossl.h"

Go to the source code of this file.

Defines

#define WrapOCSPReq(klass, obj, req)
#define GetOCSPReq(obj, req)
#define SafeGetOCSPReq(obj, req)
#define WrapOCSPRes(klass, obj, res)
#define GetOCSPRes(obj, res)
#define SafeGetOCSPRes(obj, res)
#define WrapOCSPBasicRes(klass, obj, res)
#define GetOCSPBasicRes(obj, res)
#define SafeGetOCSPBasicRes(obj, res)
#define WrapOCSPCertId(klass, obj, cid)
#define GetOCSPCertId(obj, cid)
#define SafeGetOCSPCertId(obj, cid)
#define DefOCSPConst(x)   rb_define_const(mOCSP, #x, INT2NUM(OCSP_##x))
#define DefOCSPVConst(x)   rb_define_const(mOCSP, "V_" #x, INT2NUM(V_OCSP_##x))

Functions

static VALUE ossl_ocspcertid_new (OCSP_CERTID *cid)
static VALUE ossl_ocspreq_alloc (VALUE klass)
static VALUE ossl_ocspreq_initialize (int argc, VALUE *argv, VALUE self)
static VALUE ossl_ocspreq_add_nonce (int argc, VALUE *argv, VALUE self)
static VALUE ossl_ocspreq_check_nonce (VALUE self, VALUE basic_resp)
static VALUE ossl_ocspreq_add_certid (VALUE self, VALUE certid)
static VALUE ossl_ocspreq_get_certid (VALUE self)
static VALUE ossl_ocspreq_sign (int argc, VALUE *argv, VALUE self)
static VALUE ossl_ocspreq_verify (int argc, VALUE *argv, VALUE self)
static VALUE ossl_ocspreq_to_der (VALUE self)
static VALUE ossl_ocspres_s_create (VALUE klass, VALUE status, VALUE basic_resp)
static VALUE ossl_ocspres_alloc (VALUE klass)
static VALUE ossl_ocspres_initialize (int argc, VALUE *argv, VALUE self)
static VALUE ossl_ocspres_status (VALUE self)
static VALUE ossl_ocspres_status_string (VALUE self)
static VALUE ossl_ocspres_get_basic (VALUE self)
static VALUE ossl_ocspres_to_der (VALUE self)
static VALUE ossl_ocspbres_alloc (VALUE klass)
static VALUE ossl_ocspbres_initialize (int argc, VALUE *argv, VALUE self)
static VALUE ossl_ocspbres_copy_nonce (VALUE self, VALUE request)
static VALUE ossl_ocspbres_add_nonce (int argc, VALUE *argv, VALUE self)
static VALUE ossl_ocspbres_add_status (VALUE self, VALUE cid, VALUE status, VALUE reason, VALUE revtime, VALUE thisupd, VALUE nextupd, VALUE ext)
static VALUE ossl_ocspbres_get_status (VALUE self)
static VALUE ossl_ocspbres_sign (int argc, VALUE *argv, VALUE self)
static VALUE ossl_ocspbres_verify (int argc, VALUE *argv, VALUE self)
static VALUE ossl_ocspcid_alloc (VALUE klass)
static VALUE ossl_ocspcid_initialize (int argc, VALUE *argv, VALUE self)
static VALUE ossl_ocspcid_cmp (VALUE self, VALUE other)
static VALUE ossl_ocspcid_cmp_issuer (VALUE self, VALUE other)
static VALUE ossl_ocspcid_get_serial (VALUE self)
void Init_ossl_ocsp ()

Variables

VALUE mOCSP
VALUE eOCSPError
VALUE cOCSPReq
VALUE cOCSPRes
VALUE cOCSPBasicRes
VALUE cOCSPCertId

Define Documentation

#define DefOCSPConst (  )     rb_define_const(mOCSP, #x, INT2NUM(OCSP_##x))

Referenced by Init_ossl_ocsp().

#define DefOCSPVConst (  )     rb_define_const(mOCSP, "V_" #x, INT2NUM(V_OCSP_##x))

Referenced by Init_ossl_ocsp().

#define GetOCSPBasicRes ( obj,
res   ) 
Value:
do { \
    Data_Get_Struct((obj), OCSP_BASICRESP, (res)); \
    if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
} while (0)

Definition at line 46 of file ossl_ocsp.c.

Referenced by ossl_ocspbres_add_nonce(), ossl_ocspbres_add_status(), ossl_ocspbres_copy_nonce(), ossl_ocspbres_get_status(), ossl_ocspbres_sign(), ossl_ocspbres_verify(), and ossl_ocspres_s_create().

#define GetOCSPCertId ( obj,
cid   ) 
Value:
do { \
    Data_Get_Struct((obj), OCSP_CERTID, (cid)); \
    if(!(cid)) ossl_raise(rb_eRuntimeError, "Cert ID wasn't initialized!"); \
} while (0)

Definition at line 59 of file ossl_ocsp.c.

Referenced by ossl_ocspcid_cmp(), ossl_ocspcid_cmp_issuer(), ossl_ocspcid_get_serial(), ossl_ocspcid_initialize(), and ossl_ocspreq_add_certid().

#define GetOCSPReq ( obj,
req   ) 
Value:
do { \
    Data_Get_Struct((obj), OCSP_REQUEST, (req)); \
    if(!(req)) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \
} while (0)

Definition at line 20 of file ossl_ocsp.c.

Referenced by ossl_ocspreq_add_certid(), ossl_ocspreq_add_nonce(), ossl_ocspreq_check_nonce(), ossl_ocspreq_get_certid(), ossl_ocspreq_sign(), ossl_ocspreq_to_der(), and ossl_ocspreq_verify().

#define GetOCSPRes ( obj,
res   ) 
Value:
do { \
    Data_Get_Struct((obj), OCSP_RESPONSE, (res)); \
    if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
} while (0)

Definition at line 33 of file ossl_ocsp.c.

Referenced by ossl_ocspres_get_basic(), ossl_ocspres_status(), ossl_ocspres_status_string(), and ossl_ocspres_to_der().

#define SafeGetOCSPBasicRes ( obj,
res   ) 
Value:
do { \
    OSSL_Check_Kind((obj), cOCSPBasicRes); \
    GetOCSPBasicRes((obj), (res)); \
} while (0)

Definition at line 50 of file ossl_ocsp.c.

Referenced by ossl_ocspreq_check_nonce().

#define SafeGetOCSPCertId ( obj,
cid   ) 
Value:
do { \
    OSSL_Check_Kind((obj), cOCSPCertId); \
    GetOCSPCertId((obj), (cid)); \
} while (0)

Definition at line 63 of file ossl_ocsp.c.

Referenced by ossl_ocspbres_add_status(), ossl_ocspcid_cmp(), and ossl_ocspcid_cmp_issuer().

#define SafeGetOCSPReq ( obj,
req   ) 
Value:
do { \
    OSSL_Check_Kind((obj), cOCSPReq); \
    GetOCSPReq((obj), (req)); \
} while (0)

Definition at line 24 of file ossl_ocsp.c.

Referenced by ossl_ocspbres_copy_nonce().

#define SafeGetOCSPRes ( obj,
res   ) 
Value:
do { \
    OSSL_Check_Kind((obj), cOCSPRes); \
    GetOCSPRes((obj), (res)); \
} while (0)

Definition at line 37 of file ossl_ocsp.c.

#define WrapOCSPBasicRes ( klass,
obj,
res   ) 
Value:
do { \
    if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
    (obj) = Data_Wrap_Struct((klass), 0, OCSP_BASICRESP_free, (res)); \
} while (0)

Definition at line 42 of file ossl_ocsp.c.

Referenced by ossl_ocspbres_alloc(), and ossl_ocspres_get_basic().

#define WrapOCSPCertId ( klass,
obj,
cid   ) 
Value:
do { \
    if(!(cid)) ossl_raise(rb_eRuntimeError, "Cert ID wasn't initialized!"); \
    (obj) = Data_Wrap_Struct((klass), 0, OCSP_CERTID_free, (cid)); \
} while (0)

Definition at line 55 of file ossl_ocsp.c.

Referenced by ossl_ocspcertid_new(), ossl_ocspcid_alloc(), and ossl_ocspreq_get_certid().

#define WrapOCSPReq ( klass,
obj,
req   ) 
Value:
do { \
    if(!(req)) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \
    (obj) = Data_Wrap_Struct((klass), 0, OCSP_REQUEST_free, (req)); \
} while (0)

Definition at line 16 of file ossl_ocsp.c.

Referenced by ossl_ocspreq_alloc().

#define WrapOCSPRes ( klass,
obj,
res   ) 
Value:
do { \
    if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
    (obj) = Data_Wrap_Struct((klass), 0, OCSP_RESPONSE_free, (res)); \
} while (0)

Definition at line 29 of file ossl_ocsp.c.

Referenced by ossl_ocspres_alloc(), and ossl_ocspres_s_create().


Function Documentation

void Init_ossl_ocsp ( void   ) 
static VALUE ossl_ocspbres_add_nonce ( int  argc,
VALUE argv,
VALUE  self 
) [static]
static VALUE ossl_ocspbres_add_status ( VALUE  self,
VALUE  cid,
VALUE  status,
VALUE  reason,
VALUE  revtime,
VALUE  thisupd,
VALUE  nextupd,
VALUE  ext 
) [static]
static VALUE ossl_ocspbres_alloc ( VALUE  klass  )  [static]

Definition at line 396 of file ossl_ocsp.c.

References eOCSPError, NULL, ossl_raise(), and WrapOCSPBasicRes.

Referenced by Init_ossl_ocsp().

static VALUE ossl_ocspbres_copy_nonce ( VALUE  self,
VALUE  request 
) [static]

Definition at line 415 of file ossl_ocsp.c.

References GetOCSPBasicRes, INT2NUM(), and SafeGetOCSPReq.

Referenced by Init_ossl_ocsp().

static VALUE ossl_ocspbres_get_status ( VALUE  self  )  [static]
static VALUE ossl_ocspbres_initialize ( int  argc,
VALUE argv,
VALUE  self 
) [static]

Definition at line 409 of file ossl_ocsp.c.

Referenced by Init_ossl_ocsp().

static VALUE ossl_ocspbres_sign ( int  argc,
VALUE argv,
VALUE  self 
) [static]
static VALUE ossl_ocspbres_verify ( int  argc,
VALUE argv,
VALUE  self 
) [static]
static VALUE ossl_ocspcertid_new ( OCSP_CERTID *  cid  )  [static]

Definition at line 79 of file ossl_ocsp.c.

References cOCSPCertId, and WrapOCSPCertId.

Referenced by ossl_ocspbres_get_status().

static VALUE ossl_ocspcid_alloc ( VALUE  klass  )  [static]

Definition at line 618 of file ossl_ocsp.c.

References eOCSPError, id, NULL, ossl_raise(), and WrapOCSPCertId.

Referenced by Init_ossl_ocsp().

static VALUE ossl_ocspcid_cmp ( VALUE  self,
VALUE  other 
) [static]

Definition at line 661 of file ossl_ocsp.c.

References GetOCSPCertId, id, Qfalse, Qtrue, result, and SafeGetOCSPCertId.

Referenced by Init_ossl_ocsp().

static VALUE ossl_ocspcid_cmp_issuer ( VALUE  self,
VALUE  other 
) [static]

Definition at line 674 of file ossl_ocsp.c.

References GetOCSPCertId, id, Qfalse, Qtrue, result, and SafeGetOCSPCertId.

Referenced by Init_ossl_ocsp().

static VALUE ossl_ocspcid_get_serial ( VALUE  self  )  [static]

Definition at line 687 of file ossl_ocsp.c.

References asn1integer_to_num(), GetOCSPCertId, and id.

Referenced by Init_ossl_ocsp().

static VALUE ossl_ocspcid_initialize ( int  argc,
VALUE argv,
VALUE  self 
) [static]
static VALUE ossl_ocspreq_add_certid ( VALUE  self,
VALUE  certid 
) [static]

Definition at line 173 of file ossl_ocsp.c.

References eOCSPError, GetOCSPCertId, GetOCSPReq, id, NULL, and ossl_raise().

Referenced by Init_ossl_ocsp().

static VALUE ossl_ocspreq_add_nonce ( int  argc,
VALUE argv,
VALUE  self 
) [static]
static VALUE ossl_ocspreq_alloc ( VALUE  klass  )  [static]

Definition at line 90 of file ossl_ocsp.c.

References eOCSPError, NULL, ossl_raise(), and WrapOCSPReq.

Referenced by Init_ossl_ocsp().

static VALUE ossl_ocspreq_check_nonce ( VALUE  self,
VALUE  basic_resp 
) [static]

Definition at line 159 of file ossl_ocsp.c.

References GetOCSPReq, INT2NUM(), and SafeGetOCSPBasicRes.

Referenced by Init_ossl_ocsp().

static VALUE ossl_ocspreq_get_certid ( VALUE  self  )  [static]
static VALUE ossl_ocspreq_initialize ( int  argc,
VALUE argv,
VALUE  self 
) [static]
static VALUE ossl_ocspreq_sign ( int  argc,
VALUE argv,
VALUE  self 
) [static]
static VALUE ossl_ocspreq_to_der ( VALUE  self  )  [static]

Definition at line 259 of file ossl_ocsp.c.

References eOCSPError, GetOCSPReq, len, NULL, ossl_raise(), ossl_str_adjust, rb_str_new(), and RSTRING_PTR.

Referenced by Init_ossl_ocsp().

static VALUE ossl_ocspreq_verify ( int  argc,
VALUE argv,
VALUE  self 
) [static]

Definition at line 238 of file ossl_ocsp.c.

References GetOCSPReq, GetX509StorePtr(), NIL_P, NULL, NUM2INT, Qfalse, Qtrue, rb_scan_args(), rb_warn(), result, and STACK_OF().

Referenced by Init_ossl_ocsp().

static VALUE ossl_ocspres_alloc ( VALUE  klass  )  [static]

Definition at line 299 of file ossl_ocsp.c.

References eOCSPError, NULL, ossl_raise(), and WrapOCSPRes.

Referenced by Init_ossl_ocsp().

static VALUE ossl_ocspres_get_basic ( VALUE  self  )  [static]

Definition at line 358 of file ossl_ocsp.c.

References cOCSPBasicRes, GetOCSPRes, Qnil, and WrapOCSPBasicRes.

Referenced by Init_ossl_ocsp().

static VALUE ossl_ocspres_initialize ( int  argc,
VALUE argv,
VALUE  self 
) [static]
static VALUE ossl_ocspres_s_create ( VALUE  klass,
VALUE  status,
VALUE  basic_resp 
) [static]

Definition at line 282 of file ossl_ocsp.c.

References eOCSPError, GetOCSPBasicRes, NIL_P, NULL, NUM2INT, ossl_raise(), and WrapOCSPRes.

Referenced by Init_ossl_ocsp().

static VALUE ossl_ocspres_status ( VALUE  self  )  [static]

Definition at line 334 of file ossl_ocsp.c.

References GetOCSPRes, and INT2NUM().

Referenced by Init_ossl_ocsp().

static VALUE ossl_ocspres_status_string ( VALUE  self  )  [static]

Definition at line 346 of file ossl_ocsp.c.

References GetOCSPRes, and rb_str_new2.

Referenced by Init_ossl_ocsp().

static VALUE ossl_ocspres_to_der ( VALUE  self  )  [static]

Definition at line 373 of file ossl_ocsp.c.

References eOCSPError, GetOCSPRes, len, NULL, ossl_raise(), ossl_str_adjust, rb_str_new(), and RSTRING_PTR.

Referenced by Init_ossl_ocsp().


Variable Documentation

Definition at line 72 of file ossl_ocsp.c.

Referenced by Init_ossl_ocsp(), and ossl_ocspres_get_basic().

Definition at line 73 of file ossl_ocsp.c.

Referenced by Init_ossl_ocsp(), ossl_ocspcertid_new(), and ossl_ocspreq_get_certid().

Definition at line 70 of file ossl_ocsp.c.

Referenced by Init_ossl_ocsp().

Definition at line 71 of file ossl_ocsp.c.

Referenced by Init_ossl_ocsp().

Definition at line 68 of file ossl_ocsp.c.

Referenced by Init_ossl_ocsp().


Generated on 30 Nov 2012 for Ruby by  doxygen 1.6.1