Ruby  1.9.3p551(2014-11-13revision48407)
Macros | Functions | Variables
ossl.c File Reference
#include "ossl.h"
#include <stdarg.h>

Go to the source code of this file.

Macros

#define OSSL_IMPL_ARY2SK(name, type, expected_class, dup)
 
#define OSSL_IMPL_SK2ARY(name, type)
 

Functions

int string2hex (const unsigned char *buf, int buf_len, char **hexbuf, int *hexbuf_len)
 
static VALUE ossl_str_new (int size)
 
VALUE ossl_buf2str (char *buf, int len)
 
static VALUE ossl_pem_passwd_cb0 (VALUE flag)
 
int ossl_pem_passwd_cb (char *buf, int max_len, int flag, void *pwd)
 
VALUE ossl_call_verify_cb_proc (struct ossl_verify_cb_args *args)
 
int ossl_verify_cb (int ok, X509_STORE_CTX *ctx)
 
VALUE ossl_to_der (VALUE obj)
 
VALUE ossl_to_der_if_possible (VALUE obj)
 
static VALUE ossl_make_error (VALUE exc, const char *fmt, va_list args)
 
void ossl_raise (VALUE exc, const char *fmt,...)
 
VALUE ossl_exc_new (VALUE exc, const char *fmt,...)
 
VALUE ossl_get_errors ()
 
void ossl_debug (const char *fmt,...)
 
static VALUE ossl_debug_get (VALUE self)
 
static VALUE ossl_debug_set (VALUE self, VALUE val)
 
void Init_openssl ()
 

Variables

int ossl_verify_cb_idx
 
VALUE mOSSL
 
VALUE eOSSLError
 
ID ossl_s_to_der
 
VALUE dOSSL
 

Macro Definition Documentation

#define OSSL_IMPL_ARY2SK (   name,
  type,
  expected_class,
  dup 
)

Definition at line 50 of file ossl.c.

#define OSSL_IMPL_SK2ARY (   name,
  type 
)
Value:
VALUE \
ossl_##name##_sk2ary(STACK_OF(type) *sk) \
{ \
int i, num; \
if (!sk) { \
OSSL_Debug("empty sk!"); \
} \
num = sk_##type##_num(sk); \
if (num < 0) { \
OSSL_Debug("items in sk < -1???"); \
} \
for (i=0; i<num; i++) { \
t = sk_##type##_value(sk, i); \
rb_ary_push(ary, ossl_##name##_new(t)); \
} \
}
volatile VALUE ary
Definition: tcltklib.c:9700
VP_EXPORT int
Definition: bigdecimal.c:4911
if(len<=MAX_WORD_LENGTH &&len >=MIN_WORD_LENGTH)
Definition: name2ctype.h:23841
unsigned long VALUE
Definition: ruby.h:88
VALUE rb_ary_push(VALUE ary, VALUE item)
Definition: array.c:740
STACK_OF(X509)*ossl_x509_ary2sk0(VALUE)
#define Qnil
Definition: ruby.h:367
VALUE rb_ary_new(void)
Definition: array.c:339
for(v/=shifter=1)
Definition: bigdecimal.c:5541
int type
Definition: tcltklib.c:107
#define OSSL_Debug
Definition: ossl.h:205
int t
Definition: ripper.c:14285
return
Definition: name2ctype.h:23857
VALUE rb_ary_new2(long capa)
Definition: array.c:332
ssize_t i
Definition: bigdecimal.c:5519
const char * name
Definition: nkf.c:208

Definition at line 98 of file ossl.c.

Function Documentation

void Init_openssl ( void  )
VALUE ossl_buf2str ( char *  buf,
int  len 
)
VALUE ossl_call_verify_cb_proc ( struct ossl_verify_cb_args args)
void ossl_debug ( const char *  fmt,
  ... 
)

Definition at line 374 of file ossl.c.

References args, Qtrue, and va_end().

static VALUE ossl_debug_get ( VALUE  self)
static

Definition at line 393 of file ossl.c.

References dOSSL.

Referenced by Init_openssl().

static VALUE ossl_debug_set ( VALUE  self,
VALUE  val 
)
static

Definition at line 406 of file ossl.c.

References dOSSL, Qtrue, and val.

Referenced by Init_openssl().

VALUE ossl_exc_new ( VALUE  exc,
const char *  fmt,
  ... 
)

Definition at line 335 of file ossl.c.

References args, err, ossl_make_error(), and va_end().

Referenced by read_would_block(), and write_would_block().

VALUE ossl_get_errors ( )

Definition at line 354 of file ossl.c.

References ary, e, NULL, rb_ary_new(), rb_ary_push(), and rb_str_new2().

Referenced by Init_openssl().

static VALUE ossl_make_error ( VALUE  exc,
const char *  fmt,
va_list  args 
)
static
int ossl_pem_passwd_cb ( char *  buf,
int  max_len,
int  flag,
void pwd 
)
static VALUE ossl_pem_passwd_cb0 ( VALUE  flag)
static

Definition at line 151 of file ossl.c.

References rb_yield(), and SafeStringValue.

Referenced by ossl_pem_passwd_cb().

void ossl_raise ( VALUE  exc,
const char *  fmt,
  ... 
)

Definition at line 324 of file ossl.c.

References args, err, ossl_make_error(), rb_exc_raise(), and va_end().

Referenced by asn1integer_to_num(), asn1time_to_time(), decode_bool(), decode_bstr(), decode_enum(), decode_eoc(), decode_int(), decode_null(), decode_obj(), decode_time(), DupPKCS7RecipientPtr(), DupPKCS7SignerPtr(), DupPrivPKeyPtr(), DupX509AttrPtr(), DupX509ExtPtr(), DupX509ReqPtr(), DupX509RevokedPtr(), GetBNPtr(), GetConfigPtr(), GetDigestPtr(), GetPrivPKeyPtr(), hmac_final(), Init_openssl(), Init_ossl_bn(), int_ossl_asn1_decode0_cons(), int_ossl_decode_sanity_check(), num_to_asn1integer(), obj_to_asn1bool(), obj_to_asn1bstr(), obj_to_asn1derstr(), obj_to_asn1gtime(), obj_to_asn1null(), obj_to_asn1obj(), obj_to_asn1str(), obj_to_asn1utime(), ossl_asn1_decode0(), ossl_asn1_default_tag(), ossl_asn1_get_asn1type(), ossl_asn1_initialize(), ossl_asn1_is_explicit(), ossl_asn1_tag(), ossl_asn1_tag_class(), ossl_asn1cons_to_der(), ossl_asn1data_initialize(), ossl_asn1data_to_der(), ossl_asn1obj_s_register(), ossl_asn1prim_to_der(), ossl_bn_alloc(), ossl_bn_coerce(), ossl_bn_copy(), ossl_bn_div(), ossl_bn_initialize(), ossl_bn_is_prime(), ossl_bn_is_prime_fasttest(), ossl_bn_new(), ossl_bn_s_generate_prime(), ossl_bn_to_i(), ossl_bn_to_s(), ossl_cipher_copy(), ossl_cipher_final(), ossl_cipher_init(), ossl_cipher_initialize(), ossl_cipher_new(), ossl_cipher_pkcs5_keyivgen(), ossl_cipher_reset(), ossl_cipher_set_iv(), ossl_cipher_set_key(), ossl_cipher_set_key_length(), ossl_cipher_update(), ossl_create_dh(), ossl_dh_compute_key(), ossl_dh_export(), ossl_dh_generate_key(), ossl_dh_initialize(), ossl_dh_new(), ossl_dh_s_generate(), ossl_dh_to_der(), ossl_dh_to_public_key(), ossl_dh_to_text(), ossl_digest_alloc(), ossl_digest_copy(), ossl_digest_initialize(), ossl_digest_new(), ossl_digest_reset(), ossl_dsa_export(), ossl_dsa_initialize(), ossl_dsa_new(), ossl_dsa_s_generate(), ossl_dsa_sign(), ossl_dsa_to_der(), ossl_dsa_to_public_key(), ossl_dsa_to_text(), ossl_dsa_verify(), ossl_hmac_hexdigest(), ossl_hmac_s_hexdigest(), ossl_obj2bio(), ossl_pkcs12_initialize(), ossl_pkcs12_s_allocate(), ossl_pkcs12_s_create(), ossl_pkcs12_to_der(), ossl_pkcs7_add_certificate(), ossl_pkcs7_add_crl(), ossl_pkcs7_add_data(), ossl_pkcs7_add_recipient(), ossl_pkcs7_add_signer(), ossl_pkcs7_alloc(), ossl_pkcs7_copy(), ossl_pkcs7_decrypt(), ossl_pkcs7_get_recipient(), ossl_pkcs7_get_signer(), ossl_pkcs7_initialize(), ossl_pkcs7_s_encrypt(), ossl_pkcs7_s_read_smime(), ossl_pkcs7_s_sign(), ossl_pkcs7_s_write_smime(), ossl_pkcs7_set_cipher(), ossl_pkcs7_set_detached(), ossl_pkcs7_set_type(), ossl_pkcs7_sym2typeid(), ossl_pkcs7_to_der(), ossl_pkcs7_to_pem(), ossl_pkcs7_verify(), ossl_pkcs7ri_alloc(), ossl_pkcs7ri_initialize(), ossl_pkcs7ri_new(), ossl_pkcs7si_alloc(), ossl_pkcs7si_get_signed_time(), ossl_pkcs7si_initialize(), ossl_pkcs7si_new(), ossl_pkey_alloc(), ossl_pkey_initialize(), ossl_pkey_new(), ossl_pkey_new_from_data(), ossl_pkey_new_from_file(), ossl_pkey_sign(), ossl_pkey_verify(), ossl_rand_bytes(), ossl_rand_egd(), ossl_rand_egd_bytes(), ossl_rand_load_file(), ossl_rand_pseudo_bytes(), ossl_rand_write_file(), ossl_rsa_export(), ossl_rsa_initialize(), ossl_rsa_new(), ossl_rsa_private_decrypt(), ossl_rsa_private_encrypt(), ossl_rsa_public_decrypt(), ossl_rsa_public_encrypt(), ossl_rsa_s_generate(), ossl_rsa_to_der(), ossl_rsa_to_public_key(), ossl_rsa_to_text(), ossl_spki_alloc(), ossl_spki_get_public_key(), ossl_spki_initialize(), ossl_spki_print(), ossl_spki_set_challenge(), ossl_spki_set_public_key(), ossl_spki_sign(), ossl_spki_to_der(), ossl_spki_to_pem(), ossl_spki_verify(), ossl_ssl_read_internal(), ossl_ssl_session_initialize(), ossl_ssl_session_reused(), ossl_ssl_session_to_der(), ossl_ssl_session_to_pem(), ossl_ssl_session_to_text(), ossl_ssl_set_session(), ossl_ssl_setup(), ossl_ssl_write_internal(), ossl_sslctx_add_extra_chain_cert_i(), ossl_sslctx_flush_sessions(), ossl_sslctx_s_alloc(), ossl_sslctx_set_ciphers(), ossl_sslctx_set_ssl_version(), ossl_sslctx_setup(), ossl_start_ssl(), ossl_x509_add_extension(), ossl_x509_alloc(), ossl_x509_copy(), ossl_x509_get_issuer(), ossl_x509_get_not_after(), ossl_x509_get_not_before(), ossl_x509_get_public_key(), ossl_x509_get_signature_algorithm(), ossl_x509_get_subject(), ossl_x509_initialize(), ossl_x509_new(), ossl_x509_new_from_file(), ossl_x509_set_extensions(), ossl_x509_set_issuer(), ossl_x509_set_not_after(), ossl_x509_set_not_before(), ossl_x509_set_public_key(), ossl_x509_set_subject(), ossl_x509_set_version(), ossl_x509_sign(), ossl_x509_to_der(), ossl_x509_to_pem(), ossl_x509_to_text(), ossl_x509_verify(), ossl_x509attr_alloc(), ossl_x509attr_get_oid(), ossl_x509attr_initialize(), ossl_x509attr_new(), ossl_x509attr_set_oid(), ossl_x509attr_set_value(), ossl_x509attr_to_der(), ossl_x509crl_add_extension(), ossl_x509crl_add_revoked(), ossl_x509crl_alloc(), ossl_x509crl_copy(), ossl_x509crl_get_signature_algorithm(), ossl_x509crl_initialize(), ossl_x509crl_new(), ossl_x509crl_set_extensions(), ossl_x509crl_set_issuer(), ossl_x509crl_set_last_update(), ossl_x509crl_set_next_update(), ossl_x509crl_set_revoked(), ossl_x509crl_set_version(), ossl_x509crl_sign(), ossl_x509crl_to_der(), ossl_x509crl_to_pem(), ossl_x509crl_to_text(), ossl_x509crl_verify(), ossl_x509ext_alloc(), ossl_x509ext_get_oid(), ossl_x509ext_get_value(), ossl_x509ext_initialize(), ossl_x509ext_new(), ossl_x509ext_set_oid(), ossl_x509ext_set_value(), ossl_x509ext_to_der(), ossl_x509extfactory_create_ext(), ossl_x509name_add_entry(), ossl_x509name_alloc(), ossl_x509name_initialize(), ossl_x509name_new(), ossl_x509name_to_a(), ossl_x509name_to_der(), ossl_x509name_to_s(), ossl_x509req_add_attribute(), ossl_x509req_alloc(), ossl_x509req_copy(), ossl_x509req_get_public_key(), ossl_x509req_get_signature_algorithm(), ossl_x509req_get_subject(), ossl_x509req_initialize(), ossl_x509req_new(), ossl_x509req_set_attributes(), ossl_x509req_set_public_key(), ossl_x509req_set_subject(), ossl_x509req_set_version(), ossl_x509req_sign(), ossl_x509req_to_der(), ossl_x509req_to_pem(), ossl_x509req_to_text(), ossl_x509req_verify(), ossl_x509revoked_add_extension(), ossl_x509revoked_alloc(), ossl_x509revoked_new(), ossl_x509revoked_set_extensions(), ossl_x509revoked_set_time(), 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().

static VALUE ossl_str_new ( int  size)
static

Definition at line 128 of file ossl.c.

References rb_str_new().

Referenced by ossl_buf2str().

VALUE ossl_to_der ( VALUE  obj)

Definition at line 263 of file ossl.c.

References rb_funcall(), and StringValue.

Referenced by obj_to_asn1derstr(), and ossl_to_der_if_possible().

VALUE ossl_to_der_if_possible ( VALUE  obj)
int ossl_verify_cb ( int  ok,
X509_STORE_CTX *  ctx 
)
int string2hex ( const unsigned char *  buf,
int  buf_len,
char **  hexbuf,
int hexbuf_len 
)

Definition at line 18 of file ossl.c.

References i, and len.

Referenced by ossl_hmac_hexdigest(), and ossl_hmac_s_hexdigest().

Variable Documentation

VALUE dOSSL

Definition at line 370 of file ossl.c.

Referenced by ossl_debug_get(), ossl_debug_set(), and ossl_make_error().

VALUE eOSSLError
VALUE mOSSL
ID ossl_s_to_der

Definition at line 260 of file ossl.c.

int ossl_verify_cb_idx