#include "ossl.h"
Go to the source code of this file.
#define DO_IT_VIA_RUBY 0 |
Definition at line 90 of file ossl_asn1.c.
#define OSSL_ASN1_DEFINE_CLASS | ( | name, | ||
super | ||||
) |
do{\ cASN1##name = rb_define_class_under(mASN1, #name, cASN1##super);\ rb_define_module_function(mASN1, #name, ossl_asn1_##name, -1);\ }while(0)
Referenced by Init_ossl_asn1().
#define ossl_asn1_get_tag | ( | o | ) | rb_attr_get((o),rb_intern("@tag")) |
Definition at line 160 of file ossl_asn1.c.
Referenced by ossl_asn1_tag(), ossl_asn1cons_to_der(), and ossl_asn1prim_to_der().
#define ossl_asn1_get_tag_class | ( | o | ) | rb_attr_get((o),rb_intern("@tag_class")) |
Definition at line 162 of file ossl_asn1.c.
Referenced by ossl_asn1_tag_class().
#define ossl_asn1_get_tagging | ( | o | ) | rb_attr_get((o),rb_intern("@tagging")) |
Definition at line 161 of file ossl_asn1.c.
Referenced by ossl_asn1_is_explicit().
#define ossl_asn1_get_value | ( | o | ) | rb_attr_get((o),rb_intern("@value")) |
Definition at line 159 of file ossl_asn1.c.
Referenced by ossl_asn1_get_asn1type(), ossl_asn1cons_each(), ossl_asn1cons_to_der(), ossl_asn1data_to_der(), ossl_asn1obj_get_ln(), ossl_asn1obj_get_oid(), and ossl_asn1obj_get_sn().
#define OSSL_ASN1_IMPL_FACTORY_METHOD | ( | klass | ) |
#define ossl_asn1_set_tag | ( | o, | ||
v | ||||
) | rb_iv_set((o),"@tag",(v)) |
Definition at line 165 of file ossl_asn1.c.
Referenced by ossl_asn1_initialize(), and ossl_asn1data_initialize().
#define ossl_asn1_set_tag_class | ( | o, | ||
v | ||||
) | rb_iv_set((o),"@tag_class",(v)) |
Definition at line 167 of file ossl_asn1.c.
Referenced by ossl_asn1_initialize(), and ossl_asn1data_initialize().
#define ossl_asn1_set_tagging | ( | o, | ||
v | ||||
) | rb_iv_set((o),"@tagging",(v)) |
Definition at line 166 of file ossl_asn1.c.
Referenced by ossl_asn1_initialize().
#define ossl_asn1_set_value | ( | o, | ||
v | ||||
) | rb_iv_set((o),"@value",(v)) |
Definition at line 164 of file ossl_asn1.c.
Referenced by ossl_asn1_initialize(), and ossl_asn1data_initialize().
VALUE asn1integer_to_num | ( | ASN1_INTEGER * | ai | ) |
Definition at line 92 of file ossl_asn1.c.
References eOSSLError, NULL, ossl_bn_new(), ossl_raise(), Qtrue, rb_cstr_to_inum(), and rb_eTypeError.
Referenced by decode_enum(), decode_int(), ossl_pkcs7ri_get_serial(), ossl_pkcs7si_get_serial(), ossl_x509_get_serial(), and ossl_x509revoked_get_serial().
VALUE asn1str_to_str | ( | ASN1_STRING * | str | ) |
Definition at line 81 of file ossl_asn1.c.
References rb_str_new().
Referenced by ossl_pkcs7ri_get_enc_key().
VALUE asn1time_to_time | ( | ASN1_TIME * | time | ) |
Definition at line 26 of file ossl_asn1.c.
References argv, INT2NUM(), ossl_raise(), rb_cTime, rb_eTypeError, rb_funcall2(), rb_intern, and rb_warning().
Referenced by decode_time(), ossl_pkcs7si_get_signed_time(), ossl_x509_get_not_after(), ossl_x509_get_not_before(), ossl_x509crl_get_last_update(), ossl_x509crl_get_next_update(), and ossl_x509revoked_get_time().
static VALUE decode_bool | ( | unsigned char * | der, | |
int | length | |||
) | [static] |
Definition at line 311 of file ossl_asn1.c.
References NULL, ossl_raise(), and Qtrue.
Referenced by ossl_asn1_decode0().
static VALUE decode_bstr | ( | unsigned char * | der, | |
int | length, | |||
long * | unused_bits | |||
) | [static] |
Definition at line 343 of file ossl_asn1.c.
References len, NULL, ossl_raise(), and rb_str_new().
Referenced by ossl_asn1_decode0().
static VALUE decode_enum | ( | unsigned char * | der, | |
int | length | |||
) | [static] |
Definition at line 364 of file ossl_asn1.c.
References _, asn1integer_to_num(), NULL, ossl_raise(), rb_jump_tag(), and rb_protect().
Referenced by ossl_asn1_decode0().
static VALUE decode_int | ( | unsigned char * | der, | |
int | length | |||
) | [static] |
Definition at line 324 of file ossl_asn1.c.
References _, asn1integer_to_num(), NULL, ossl_raise(), rb_jump_tag(), and rb_protect().
Referenced by ossl_asn1_decode0().
static VALUE decode_null | ( | unsigned char * | der, | |
int | length | |||
) | [static] |
Definition at line 383 of file ossl_asn1.c.
References NULL, and ossl_raise().
Referenced by ossl_asn1_decode0().
static VALUE decode_obj | ( | unsigned char * | der, | |
int | length | |||
) | [static] |
Definition at line 397 of file ossl_asn1.c.
References NULL, ossl_membio2str(), ossl_raise(), and rb_str_new2().
Referenced by ossl_asn1_decode0().
static VALUE decode_time | ( | unsigned char * | der, | |
int | length | |||
) | [static] |
Definition at line 426 of file ossl_asn1.c.
References _, asn1time_to_time(), NULL, ossl_raise(), rb_jump_tag(), and rb_protect().
Referenced by ossl_asn1_decode0().
void Init_ossl_asn1 | ( | void | ) |
Definition at line 1085 of file ossl_asn1.c.
References eOSSLError, INT2NUM(), mOSSL, name, ossl_asn1_decode(), ossl_asn1_decode_all(), OSSL_ASN1_DEFINE_CLASS, ossl_asn1_initialize(), ossl_asn1_traverse(), ossl_asn1cons_each(), ossl_asn1cons_to_der(), ossl_asn1data_initialize(), ossl_asn1data_to_der(), ossl_asn1obj_get_ln(), ossl_asn1obj_get_oid(), ossl_asn1obj_get_sn(), ossl_asn1obj_s_register(), ossl_asn1prim_to_der(), Qtrue, rb_ary_new(), rb_ary_store(), rb_attr(), rb_cObject, rb_define_alias(), rb_define_class_under(), rb_define_const(), rb_define_method(), rb_define_module(), rb_define_module_function(), rb_define_module_under(), rb_define_singleton_method(), rb_include_module(), rb_intern, rb_mEnumerable, and rb_str_new2().
Referenced by Init_openssl().
Definition at line 677 of file ossl_asn1.c.
References join_der_i(), rb_block_call, rb_intern, and rb_str_new().
Referenced by ossl_asn1cons_to_der(), and ossl_asn1data_to_der().
Definition at line 668 of file ossl_asn1.c.
References ossl_to_der_if_possible(), rb_str_append(), and StringValue.
Referenced by join_der().
ASN1_INTEGER* num_to_asn1integer | ( | VALUE | obj, | |
ASN1_INTEGER * | ai | |||
) |
Definition at line 144 of file ossl_asn1.c.
References eOSSLError, GetBNPtr(), NULL, and ossl_raise().
Referenced by obj_to_asn1int(), ossl_x509_set_serial(), and ossl_x509revoked_set_serial().
static ASN1_BOOLEAN obj_to_asn1bool | ( | VALUE | obj | ) | [static] |
Definition at line 197 of file ossl_asn1.c.
References RTEST.
Referenced by ossl_asn1_get_asn1type().
static ASN1_BIT_STRING* obj_to_asn1bstr | ( | VALUE | obj, | |
long | unused_bits | |||
) | [static] |
Definition at line 213 of file ossl_asn1.c.
References NULL, ossl_raise(), RSTRING_LEN, RSTRING_PTR, and StringValue.
Referenced by ossl_asn1_get_asn1type().
static ASN1_STRING* obj_to_asn1derstr | ( | VALUE | obj | ) | [static] |
Definition at line 294 of file ossl_asn1.c.
References NULL, ossl_raise(), ossl_to_der(), RSTRING_LEN, and RSTRING_PTR.
Referenced by ossl_asn1_get_asn1type().
static ASN1_GENERALIZEDTIME* obj_to_asn1gtime | ( | VALUE | time | ) | [static] |
Definition at line 281 of file ossl_asn1.c.
References NULL, ossl_raise(), time_t, and time_to_time_t().
Referenced by ossl_asn1_get_asn1type().
static ASN1_INTEGER* obj_to_asn1int | ( | VALUE | obj | ) | [static] |
Definition at line 207 of file ossl_asn1.c.
References NULL, and num_to_asn1integer().
Referenced by ossl_asn1_get_asn1type().
static ASN1_NULL* obj_to_asn1null | ( | VALUE | obj | ) | [static] |
Definition at line 242 of file ossl_asn1.c.
References NIL_P, NULL, and ossl_raise().
Referenced by ossl_asn1_get_asn1type().
static ASN1_OBJECT* obj_to_asn1obj | ( | VALUE | obj | ) | [static] |
Definition at line 255 of file ossl_asn1.c.
References ossl_raise(), RSTRING_PTR, and StringValue.
Referenced by ossl_asn1_get_asn1type(), and ossl_asn1obj_get_oid().
static ASN1_STRING* obj_to_asn1str | ( | VALUE | obj | ) | [static] |
Definition at line 229 of file ossl_asn1.c.
References NULL, ossl_raise(), RSTRING_LEN, RSTRING_PTR, and StringValue.
Referenced by ossl_asn1_get_asn1type().
static ASN1_UTCTIME* obj_to_asn1utime | ( | VALUE | time | ) | [static] |
Definition at line 268 of file ossl_asn1.c.
References NULL, ossl_raise(), time_t, and time_to_time_t().
Referenced by ossl_asn1_get_asn1type().
static VALUE ossl_asn1_class2sym | ( | int | tc | ) | [static] |
Definition at line 836 of file ossl_asn1.c.
References ossl_asn1_decode0(), ossl_to_der_if_possible(), rb_ary_entry(), rb_str_new4(), RSTRING_LEN, RSTRING_PTR, and StringValue.
Referenced by Init_ossl_asn1().
static VALUE ossl_asn1_decode0 | ( | unsigned char ** | pp, | |
long | length, | |||
long * | offset, | |||
long | depth, | |||
int | once, | |||
int | yield | |||
) | [static] |
Definition at line 714 of file ossl_asn1.c.
References decode_bool(), decode_bstr(), decode_enum(), decode_int(), decode_null(), decode_obj(), decode_time(), ID2SYM, INT2NUM(), ossl_asn1_info_t::klass, len, LONG2NUM, NULL, ossl_asn1_class2sym(), ossl_raise(), Qfalse, Qtrue, rb_ary_new(), rb_ary_push(), rb_cArray, rb_funcall(), rb_intern, rb_iv_set(), rb_obj_is_kind_of(), rb_str_new(), and rb_yield().
Referenced by ossl_asn1_decode(), ossl_asn1_decode_all(), and ossl_asn1_traverse().
Definition at line 853 of file ossl_asn1.c.
References ossl_asn1_decode0(), ossl_to_der_if_possible(), rb_str_new4(), RSTRING_LEN, RSTRING_PTR, and StringValue.
Referenced by Init_ossl_asn1().
static int ossl_asn1_default_tag | ( | VALUE | obj | ) | [static] |
Definition at line 566 of file ossl_asn1.c.
References CLASS_OF, ossl_raise(), rb_class2name(), and rb_obj_is_kind_of().
Referenced by ossl_asn1_get_asn1type(), ossl_asn1_initialize(), and ossl_asn1cons_to_der().
ASN1_TYPE* ossl_asn1_get_asn1type | ( | VALUE | obj | ) |
Definition at line 490 of file ossl_asn1.c.
References NIL_P, NUM2INT, obj_to_asn1bool(), obj_to_asn1bstr(), obj_to_asn1derstr(), obj_to_asn1gtime(), obj_to_asn1int(), obj_to_asn1null(), obj_to_asn1obj(), obj_to_asn1str(), obj_to_asn1utime(), ossl_asn1_default_tag(), ossl_asn1_get_value, ossl_raise(), rb_attr_get(), and rb_intern.
Referenced by ossl_asn1prim_to_der(), and ossl_x509attr_set_value().
Definition at line 869 of file ossl_asn1.c.
References ID2SYM, INT2NUM(), NIL_P, NUM2INT, ossl_asn1_default_tag(), ossl_asn1_set_tag, ossl_asn1_set_tag_class, ossl_asn1_set_tagging, ossl_asn1_set_value, ossl_raise(), rb_scan_args(), SYM2ID, and SYMBOL_P.
Referenced by Init_ossl_asn1().
static int ossl_asn1_is_explicit | ( | VALUE | obj | ) | [static] |
Definition at line 595 of file ossl_asn1.c.
References NIL_P, ossl_asn1_get_tagging, ossl_raise(), SYM2ID, and SYMBOL_P.
Referenced by ossl_asn1cons_to_der(), and ossl_asn1prim_to_der().
static int ossl_asn1_tag | ( | VALUE | obj | ) | [static] |
Definition at line 583 of file ossl_asn1.c.
References NIL_P, NUM2INT, ossl_asn1_get_tag, and ossl_raise().
Referenced by ossl_asn1data_to_der().
static int ossl_asn1_tag_class | ( | VALUE | obj | ) | [static] |
Definition at line 616 of file ossl_asn1.c.
References NIL_P, ossl_asn1_get_tag_class, ossl_raise(), SYM2ID, and SYMBOL_P.
Referenced by ossl_asn1cons_to_der(), ossl_asn1data_to_der(), and ossl_asn1prim_to_der().
Definition at line 821 of file ossl_asn1.c.
References ossl_asn1_decode0(), ossl_to_der_if_possible(), rb_str_new4(), RSTRING_LEN, RSTRING_PTR, and StringValue.
Referenced by Init_ossl_asn1().
static void ossl_ASN1_TYPE_free | ( | ASN1_TYPE * | a | ) | [static] |
Definition at line 913 of file ossl_asn1.c.
Referenced by ossl_asn1prim_to_der().
Definition at line 997 of file ossl_asn1.c.
References ossl_asn1_get_value, and rb_ary_each().
Referenced by Init_ossl_asn1().
Definition at line 963 of file ossl_asn1.c.
References join_der(), NUM2INT, ossl_asn1_default_tag(), ossl_asn1_get_tag, ossl_asn1_get_value, ossl_asn1_is_explicit(), ossl_asn1_tag_class(), ossl_str_adjust, rb_str_new(), RSTRING_LEN, and RSTRING_PTR.
Referenced by Init_ossl_asn1().
static VALUE ossl_asn1data_initialize | ( | VALUE | self, | |
VALUE | value, | |||
VALUE | tag, | |||
VALUE | tag_class | |||
) | [static] |
Definition at line 654 of file ossl_asn1.c.
References NUM2INT, ossl_asn1_set_tag, ossl_asn1_set_tag_class, ossl_asn1_set_value, ossl_raise(), SYM2ID, and SYMBOL_P.
Referenced by Init_ossl_asn1().
Definition at line 685 of file ossl_asn1.c.
References join_der(), NULL, ossl_asn1_get_value, ossl_asn1_tag(), ossl_asn1_tag_class(), ossl_raise(), ossl_str_adjust, rb_cArray, rb_obj_is_kind_of(), rb_str_new(), RSTRING_LEN, RSTRING_PTR, and StringValue.
Referenced by Init_ossl_asn1().
Definition at line 1030 of file ossl_asn1.c.
References ossl_asn1_get_value, rb_str_new2(), and StringValuePtr.
Referenced by Init_ossl_asn1().
Definition at line 1043 of file ossl_asn1.c.
References buf, obj_to_asn1obj(), ossl_asn1_get_value, and rb_str_new2().
Referenced by Init_ossl_asn1().
Definition at line 1017 of file ossl_asn1.c.
References ossl_asn1_get_value, rb_str_new2(), and StringValuePtr.
Referenced by Init_ossl_asn1().
Definition at line 1004 of file ossl_asn1.c.
References NULL, ossl_raise(), RSTRING_PTR, and StringValue.
Referenced by Init_ossl_asn1().
Definition at line 926 of file ossl_asn1.c.
References assert, buf, len, NULL, NUM2INT, ossl_asn1_get_asn1type(), ossl_asn1_get_tag, ossl_asn1_is_explicit(), ossl_asn1_tag_class(), ossl_ASN1_TYPE_free(), ossl_buf2str(), ossl_i2d_ASN1_TYPE(), and ossl_raise().
Referenced by Init_ossl_asn1().
static int ossl_i2d_ASN1_TYPE | ( | ASN1_TYPE * | a, | |
unsigned char ** | pp | |||
) | [static] |
Definition at line 902 of file ossl_asn1.c.
Referenced by ossl_asn1prim_to_der().
Definition at line 2409 of file time.c.
Referenced by rb_thread_sleep().
time_t time_to_time_t | ( | VALUE | time | ) |
Definition at line 72 of file ossl_asn1.c.
References NUM2LONG(), rb_Integer(), and time_t.
Referenced by obj_to_asn1gtime(), obj_to_asn1utime(), ossl_x509_set_not_after(), ossl_x509_set_not_before(), ossl_x509crl_set_last_update(), ossl_x509crl_set_next_update(), and ossl_x509revoked_set_time().
Definition at line 178 of file ossl_asn1.c.
Definition at line 184 of file ossl_asn1.c.
Definition at line 176 of file ossl_asn1.c.
Definition at line 174 of file ossl_asn1.c.
Definition at line 172 of file ossl_asn1.c.
Definition at line 177 of file ossl_asn1.c.
Definition at line 187 of file ossl_asn1.c.
Definition at line 183 of file ossl_asn1.c.
Definition at line 182 of file ossl_asn1.c.
Definition at line 182 of file ossl_asn1.c.
Definition at line 177 of file ossl_asn1.c.
Definition at line 183 of file ossl_asn1.c.
Definition at line 185 of file ossl_asn1.c.
Definition at line 180 of file ossl_asn1.c.
Definition at line 186 of file ossl_asn1.c.
Definition at line 179 of file ossl_asn1.c.
Definition at line 173 of file ossl_asn1.c.
Definition at line 180 of file ossl_asn1.c.
Definition at line 188 of file ossl_asn1.c.
Definition at line 188 of file ossl_asn1.c.
Definition at line 181 of file ossl_asn1.c.
Definition at line 184 of file ossl_asn1.c.
Definition at line 187 of file ossl_asn1.c.
Definition at line 179 of file ossl_asn1.c.
Definition at line 181 of file ossl_asn1.c.
Definition at line 170 of file ossl_asn1.c.
Referenced by ossl_x509attr_set_value().
Definition at line 169 of file ossl_asn1.c.
Referenced by ossl_x509attr_get_value().
ossl_asn1_info_t ossl_asn1_info[] [static] |
Definition at line 451 of file ossl_asn1.c.
int ossl_asn1_info_size = (sizeof(ossl_asn1_info)/sizeof(ossl_asn1_info[0])) |
Definition at line 485 of file ossl_asn1.c.
ID sAPPLICATION [static] |
Definition at line 191 of file ossl_asn1.c.
ID sCONTEXT_SPECIFIC [static] |
Definition at line 191 of file ossl_asn1.c.
Definition at line 190 of file ossl_asn1.c.
Definition at line 190 of file ossl_asn1.c.
Definition at line 191 of file ossl_asn1.c.
ID sUNIVERSAL [static] |
Definition at line 191 of file ossl_asn1.c.