Ruby  2.1.10p492(2016-04-01revision54464)
Data Structures | Macros | Functions | Variables
ossl.h File Reference
#include <ruby.h>
#include <ruby/io.h>
#include <ruby/thread.h>
#include <openssl/opensslv.h>
#include <errno.h>
#include <openssl/err.h>
#include <openssl/asn1_mac.h>
#include <openssl/x509v3.h>
#include <openssl/ssl.h>
#include <openssl/pkcs12.h>
#include <openssl/pkcs7.h>
#include <openssl/hmac.h>
#include <openssl/rand.h>
#include <openssl/conf.h>
#include <openssl/conf_api.h>
#include "openssl_missing.h"
#include "ruby_missing.h"
#include "ossl_asn1.h"
#include "ossl_bio.h"
#include "ossl_bn.h"
#include "ossl_cipher.h"
#include "ossl_config.h"
#include "ossl_digest.h"
#include "ossl_hmac.h"
#include "ossl_ns_spki.h"
#include "ossl_ocsp.h"
#include "ossl_pkcs12.h"
#include "ossl_pkcs7.h"
#include "ossl_pkcs5.h"
#include "ossl_pkey.h"
#include "ossl_rand.h"
#include "ossl_ssl.h"
#include "ossl_version.h"
#include "ossl_x509.h"
#include "ossl_engine.h"

Go to the source code of this file.

Data Structures

struct  ossl_verify_cb_args
 

Macros

#define assert(condition)
 
#define OSSL_MIN_PWD_LEN   4
 
#define OSSL_Check_Kind(obj, klass)
 
#define OSSL_Check_Instance(obj, klass)
 
#define OSSL_Check_Same_Class(obj1, obj2)
 
#define ossl_str_adjust(str, p)
 
#define OSSL_BIO_reset(bio)
 
#define OSSL_ErrMsg()   ERR_reason_error_string(ERR_get_error())
 
#define OSSL_Debug   ossl_debug
 
#define OSSL_Warning   rb_warning
 
#define OSSL_Warn   rb_warn
 

Functions

int string2hex (const unsigned char *, int, char **, int *)
 
 STACK_OF (X509) *ossl_x509_ary2sk0(VALUE)
 
int *VALUE ossl_x509_sk2ary (STACK_OF(X509) *certs)
 
VALUE ossl_x509crl_sk2ary (STACK_OF(X509_CRL) *crl)
 
VALUE ossl_x509name_sk2ary (STACK_OF(X509_NAME) *names)
 
VALUE ossl_buf2str (char *buf, int len)
 
int ossl_pem_passwd_cb (char *, int, int, void *)
 
 NORETURN (void ossl_raise(VALUE, const char *,...))
 
VALUE ossl_exc_new (VALUE, const char *,...)
 
VALUE ossl_call_verify_cb_proc (struct ossl_verify_cb_args *)
 
int ossl_verify_cb (int, X509_STORE_CTX *)
 
VALUE ossl_to_der (VALUE)
 
VALUE ossl_to_der_if_possible (VALUE)
 
void ossl_debug (const char *,...)
 
void Init_openssl (void)
 

Variables

VALUE mOSSL
 
VALUE eOSSLError
 
int ossl_verify_cb_idx
 
ID ossl_s_to_der
 
VALUE dOSSL
 

Macro Definition Documentation

◆ assert

#define assert (   condition)

Definition at line 45 of file ossl.h.

Referenced by aligned_malloc(), ary_make_partial(), ary_make_shared(), ary_resize_capa(), ary_shrink_capa(), bary2bdigitdbl(), bary_addc(), bary_divmod(), bary_divmod_normal(), bary_mul_balance_with_mulfunc(), bary_mul_karatsuba(), bary_mul_normal(), bary_mul_precheck(), bary_mul_single(), bary_mul_toom3(), bary_muladd_1xN(), bary_mulsub_1xN(), bary_short_mul(), bary_small_lshift(), bary_small_rshift(), bary_sq_fast(), bary_subb(), bary_unpack(), bary_unpack_internal(), bdigitdbl2bary(), big2str_2bdigits(), big2str_generic(), big2str_karatsuba(), big_shift2(), bigdivrem_mulsub(), bigdivrem_restoring(), bigdivrem_single1(), bigsub_int(), c_gregorian_last_day_of_month(), c_gregorian_to_yday(), c_julian_last_day_of_month(), c_julian_to_yday(), canonicalize_c_jd(), canonicalize_s_jd(), core_hash_merge(), d_complex_new_internal(), d_simple_new_internal(), decode_jd(), f_complex_new2(), f_complex_new_bang1(), f_complex_new_bang2(), f_complex_polar(), f_rational_new2(), f_rational_new_no_reduce2(), get_c_civil(), get_c_df(), get_c_jd(), get_c_time(), get_s_civil(), get_s_jd(), guess_style(), heap_page_allocate(), heap_pages_free_unused_pages(), Init_Complex(), Init_date_core(), Init_Rational(), integer_unpack_num_bdigits(), local_df(), local_jd(), maxpow_in_bdigit_dbl(), newobj_of(), nkf_buf_at(), nkf_buf_pop(), objspace_malloc_increase(), ossl_asn1prim_to_der(), ossl_cipher_final(), ossl_cipher_update(), ossl_pkey_sign(), pop_mark_stack_chunk(), push_mark_stack_chunk(), rb_absint_numwords(), rb_ary_shift(), rb_ary_sort_bang(), rb_objspace_call_finalizer(), rb_str_new_frozen(), set_of(), SHA256_End(), SHA256_Final(), SHA256_Update(), SHA384_End(), SHA384_Final(), SHA512_End(), SHA512_Final(), SHA512_Update(), str2big_karatsuba(), str2big_normal(), str2big_poweroftwo(), str_new4(), str_replace(), verify_internal_consistency_reachable_i(), VpCopy(), VpSetPTR(), yaml_alias_event_initialize(), yaml_document_add_mapping(), yaml_document_add_scalar(), yaml_document_add_sequence(), yaml_document_append_mapping_pair(), yaml_document_append_sequence_item(), yaml_document_delete(), yaml_document_end_event_initialize(), yaml_document_get_node(), yaml_document_get_root_node(), yaml_document_initialize(), yaml_document_start_event_initialize(), yaml_emitter_close(), yaml_emitter_delete(), yaml_emitter_dump(), yaml_emitter_dump_node(), yaml_emitter_flush(), yaml_emitter_initialize(), yaml_emitter_open(), yaml_emitter_process_scalar(), yaml_emitter_set_break(), yaml_emitter_set_canonical(), yaml_emitter_set_encoding(), yaml_emitter_set_indent(), yaml_emitter_set_output(), yaml_emitter_set_output_file(), yaml_emitter_set_output_string(), yaml_emitter_set_unicode(), yaml_emitter_set_width(), yaml_emitter_state_machine(), yaml_event_delete(), yaml_mapping_end_event_initialize(), yaml_mapping_start_event_initialize(), yaml_parser_delete(), yaml_parser_initialize(), yaml_parser_load(), yaml_parser_load_document(), yaml_parser_load_node(), yaml_parser_parse(), yaml_parser_save_simple_key(), yaml_parser_scan(), yaml_parser_set_encoding(), yaml_parser_set_input(), yaml_parser_set_input_file(), yaml_parser_set_input_string(), yaml_parser_state_machine(), yaml_parser_update_buffer(), yaml_scalar_event_initialize(), yaml_sequence_end_event_initialize(), yaml_sequence_start_event_initialize(), yaml_stream_end_event_initialize(), yaml_stream_start_event_initialize(), and yaml_token_delete().

◆ OSSL_BIO_reset

#define OSSL_BIO_reset (   bio)

◆ OSSL_Check_Instance

#define OSSL_Check_Instance (   obj,
  klass 
)
Value:
do {\
if (!rb_obj_is_instance_of((obj), (klass))) {\
ossl_raise(rb_eTypeError, "wrong argument (%"PRIsVALUE")! (Expected instance of %"PRIsVALUE")",\
rb_obj_class(obj), (klass));\
}\
} while (0)
VALUE rb_eTypeError
Definition: error.c:548
#define PRIsVALUE
Definition: ruby.h:137
VALUE rb_obj_is_instance_of(VALUE, VALUE)
Definition: object.c:609
VALUE rb_obj_class(VALUE)
Definition: object.c:226

Definition at line 103 of file ossl.h.

◆ OSSL_Check_Kind

#define OSSL_Check_Kind (   obj,
  klass 
)
Value:
do {\
if (!rb_obj_is_kind_of((obj), (klass))) {\
ossl_raise(rb_eTypeError, "wrong argument (%"PRIsVALUE")! (Expected kind of %"PRIsVALUE")",\
rb_obj_class(obj), (klass));\
}\
} while (0)
VALUE rb_eTypeError
Definition: error.c:548
VALUE rb_obj_is_kind_of(VALUE, VALUE)
Definition: object.c:646
#define PRIsVALUE
Definition: ruby.h:137
VALUE rb_obj_class(VALUE)
Definition: object.c:226

Definition at line 96 of file ossl.h.

Referenced by GetConfigPtr(), ossl_ssl_initialize(), ossl_x509_set_extensions(), ossl_x509crl_set_extensions(), ossl_x509crl_set_revoked(), ossl_x509req_set_attributes(), ossl_x509revoked_set_extensions(), and ossl_x509stctx_clear_ptr().

◆ OSSL_Check_Same_Class

#define OSSL_Check_Same_Class (   obj1,
  obj2 
)
Value:
do {\
if (!rb_obj_is_instance_of((obj1), rb_obj_class(obj2))) {\
ossl_raise(rb_eTypeError, "wrong argument type");\
}\
} while (0)
VALUE rb_eTypeError
Definition: error.c:548
VALUE rb_obj_is_instance_of(VALUE, VALUE)
Definition: object.c:609
VALUE rb_obj_class(VALUE)
Definition: object.c:226

Definition at line 110 of file ossl.h.

◆ OSSL_Debug

#define OSSL_Debug   ossl_debug

◆ OSSL_ErrMsg

#define OSSL_ErrMsg ( )    ERR_reason_error_string(ERR_get_error())

Definition at line 161 of file ossl.h.

Referenced by ossl_x509_check_private_key().

◆ OSSL_MIN_PWD_LEN

#define OSSL_MIN_PWD_LEN   4

Definition at line 81 of file ossl.h.

Referenced by ossl_dsa_export(), and ossl_rsa_export().

◆ ossl_str_adjust

#define ossl_str_adjust (   str,
 
)
Value:
do{\
int len = RSTRING_LENINT(str);\
int newlen = rb_long2int((p) - (unsigned char*)RSTRING_PTR(str));\
assert(newlen <= len);\
rb_str_set_len((str), newlen);\
}while(0)
#define rb_long2int(n)
Definition: ruby.h:317
#define RSTRING_PTR(str)
Definition: ruby.h:845
#define RSTRING_LENINT(str)
Definition: ruby.h:853

Definition at line 138 of file ossl.h.

Referenced by ossl_asn1cons_to_der(), ossl_asn1data_to_der(), ossl_dh_to_der(), ossl_dsa_to_der(), ossl_pkcs12_to_der(), ossl_pkcs7_to_der(), ossl_rsa_to_der(), ossl_spki_to_der(), ossl_ssl_session_to_der(), ossl_x509_to_der(), ossl_x509attr_get_value(), ossl_x509ext_to_der(), ossl_x509name_to_der(), and ossl_x509req_to_der().

◆ OSSL_Warn

#define OSSL_Warn   rb_warn

Definition at line 213 of file ossl.h.

◆ OSSL_Warning

#define OSSL_Warning   rb_warning

Definition at line 212 of file ossl.h.

Referenced by ossl_x509_check_private_key().

Function Documentation

◆ Init_openssl()

void Init_openssl ( void  )

◆ NORETURN()

NORETURN ( void   ossl_raiseVALUE, const char *,...)

◆ ossl_buf2str()

VALUE ossl_buf2str ( char *  buf,
int  len 
)

◆ ossl_call_verify_cb_proc()

VALUE ossl_call_verify_cb_proc ( struct ossl_verify_cb_args )

◆ ossl_debug()

void ossl_debug ( const char *  ,
  ... 
)

Definition at line 383 of file ossl.c.

References dOSSL, and Qtrue.

◆ ossl_exc_new()

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

Definition at line 344 of file ossl.c.

References err, and ossl_make_error().

Referenced by read_would_block(), and write_would_block().

◆ ossl_pem_passwd_cb()

int ossl_pem_passwd_cb ( char *  ,
int  ,
int  ,
void *   
)

◆ ossl_to_der()

VALUE ossl_to_der ( VALUE  )

Definition at line 272 of file ossl.c.

References ossl_s_to_der, rb_funcall(), and StringValue.

Referenced by obj_to_asn1derstr(), and ossl_to_der_if_possible().

◆ ossl_to_der_if_possible()

VALUE ossl_to_der_if_possible ( VALUE  )

◆ ossl_verify_cb()

int ossl_verify_cb ( int  ,
X509_STORE_CTX *   
)

◆ ossl_x509_sk2ary()

int* VALUE ossl_x509_sk2ary ( STACK_OF(X509) *  certs)

◆ ossl_x509crl_sk2ary()

VALUE ossl_x509crl_sk2ary ( STACK_OF(X509_CRL) *  crl)

Referenced by ossl_pkcs7_get_crls().

◆ ossl_x509name_sk2ary()

VALUE ossl_x509name_sk2ary ( STACK_OF(X509_NAME) *  names)

◆ STACK_OF()

STACK_OF ( X509  )

◆ string2hex()

int string2hex ( const unsigned char *  ,
int  ,
char **  ,
int *   
)

Definition at line 18 of file ossl.c.

References buf.

Referenced by ossl_hmac_hexdigest(), and ossl_hmac_s_hexdigest().

Variable Documentation

◆ dOSSL

VALUE dOSSL

Definition at line 379 of file ossl.c.

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

◆ eOSSLError

VALUE eOSSLError

◆ mOSSL

VALUE mOSSL

◆ ossl_s_to_der

ID ossl_s_to_der

Definition at line 269 of file ossl.c.

Referenced by Init_openssl(), ossl_to_der(), and ossl_to_der_if_possible().

◆ ossl_verify_cb_idx

int ossl_verify_cb_idx