Ruby
2.4.2p198(2017-09-14revision59899)
|
Go to the source code of this file.
Data Structures | |
struct | CRYPTO_dynlock_value |
Macros | |
#define | OSSL_IMPL_ARY2SK(name, type, expected_class, dup) |
#define | OSSL_IMPL_SK2ARY(name, type) |
Functions | |
static VALUE | ossl_str_new (int size) |
VALUE | ossl_buf2str (char *buf, int len) |
void | ossl_bin2hex (unsigned char *in, char *out, size_t inlen) |
VALUE | ossl_pem_passwd_value (VALUE pass) |
static VALUE | ossl_pem_passwd_cb0 (VALUE flag) |
int | ossl_pem_passwd_cb (char *buf, int max_len, int flag, void *pwd_) |
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,...) |
void | ossl_clear_error (void) |
VALUE | ossl_get_errors (void) |
void | ossl_debug (const char *fmt,...) |
static VALUE | ossl_debug_get (VALUE self) |
static VALUE | ossl_debug_set (VALUE self, VALUE val) |
static VALUE | ossl_fips_mode_set (VALUE self, VALUE enabled) |
static void | ossl_lock_unlock (int mode, rb_nativethread_lock_t *lock) |
static void | ossl_lock_callback (int mode, int type, const char *file, int line) |
static struct CRYPTO_dynlock_value * | ossl_dyn_create_callback (const char *file, int line) |
static void | ossl_dyn_lock_callback (int mode, struct CRYPTO_dynlock_value *l, const char *file, int line) |
static void | ossl_dyn_destroy_callback (struct CRYPTO_dynlock_value *l, const char *file, int line) |
static unsigned long | ossl_thread_id (void) |
static void | Init_ossl_locks (void) |
void | Init_openssl (void) |
Variables | |
VALUE | mOSSL |
VALUE | eOSSLError |
ID | ossl_s_to_der |
VALUE | dOSSL |
static rb_nativethread_lock_t * | ossl_locks |
Stores locks needed for OpenSSL thread safety. More... | |
#define OSSL_IMPL_SK2ARY | ( | name, | |
type | |||
) |
void Init_openssl | ( | void | ) |
Definition at line 999 of file ossl.c.
References argc, argv, Init_ossl_asn1(), Init_ossl_bn(), Init_ossl_cipher(), Init_ossl_config(), Init_ossl_digest(), Init_ossl_engine(), Init_ossl_hmac(), Init_ossl_locks(), Init_ossl_ns_spki(), Init_ossl_ocsp(), Init_ossl_pkcs12(), Init_ossl_pkcs5(), Init_ossl_pkcs7(), Init_ossl_pkey(), Init_ossl_rand(), Init_ossl_ssl(), Init_ossl_x509(), INT2NUM, main(), ossl_debug_get(), ossl_debug_set(), ossl_fips_mode_set(), ossl_get_errors(), OSSL_VERSION, Qfalse, Qtrue, rb_define_class_under(), rb_define_const(), rb_define_module(), rb_define_module_function(), rb_eStandardError, rb_global_variable(), rb_intern, and rb_str_new2.
|
static |
Definition at line 478 of file ossl.c.
References ossl_dyn_create_callback(), ossl_dyn_destroy_callback(), ossl_dyn_lock_callback(), ossl_lock_callback(), ossl_thread_id(), rb_eNoMemError, rb_eRuntimeError, rb_nativethread_lock_initialize(), and rb_raise().
Referenced by Init_openssl().
void ossl_bin2hex | ( | unsigned char * | in, |
char * | out, | ||
size_t | inlen | ||
) |
Definition at line 115 of file ossl.c.
References assert, and LONG_MAX.
Referenced by ossl_hmac_hexdigest(), ossl_hmac_s_hexdigest(), ossl_ocspcid_get_issuer_key_hash(), and ossl_ocspcid_get_issuer_name_hash().
VALUE ossl_buf2str | ( | char * | buf, |
int | len | ||
) |
Definition at line 101 of file ossl.c.
References memcpy, NIL_P, ossl_str_new(), rb_jump_tag(), rb_protect(), and RSTRING_PTR.
Referenced by ossl_asn1prim_to_der(), ossl_bn_to_s(), and ossl_spki_to_pem().
void ossl_clear_error | ( | void | ) |
Definition at line 289 of file ossl.c.
References dOSSL, NULL, Qtrue, and rb_warn().
Referenced by dh_generate(), dsa_generate(), ossl_dsa_initialize(), ossl_engine_s_by_id(), ossl_make_error(), ossl_ocspbres_verify(), ossl_ocspreq_verify(), ossl_ocspsres_check_validity(), ossl_pkcs7_verify(), ossl_pkey_verify(), ossl_spki_initialize(), ossl_ssl_stop(), ossl_start_ssl(), ossl_x509_check_private_key(), ossl_x509_verify(), ossl_x509crl_verify(), ossl_x509req_verify(), ossl_x509stctx_verify(), ossl_x509store_add_file(), and rsa_generate().
|
static |
Definition at line 444 of file ossl.c.
References CRYPTO_dynlock_value::lock, and rb_nativethread_lock_initialize().
Referenced by Init_ossl_locks().
|
static |
Definition at line 458 of file ossl.c.
References CRYPTO_dynlock_value::lock, rb_nativethread_lock_destroy(), and rb_nativethread_self().
Referenced by Init_ossl_locks().
|
static |
Definition at line 452 of file ossl.c.
References CRYPTO_dynlock_value::lock, and ossl_lock_unlock().
Referenced by Init_ossl_locks().
Definition at line 397 of file ossl.c.
References ossl_raise(), and RTEST.
Referenced by Init_openssl().
VALUE ossl_get_errors | ( | void | ) |
Definition at line 325 of file ossl.c.
References NULL, rb_ary_new(), rb_ary_push(), and rb_str_new2.
Referenced by Init_openssl().
|
static |
Definition at line 434 of file ossl.c.
References ossl_lock_unlock().
Referenced by Init_ossl_locks().
|
static |
Definition at line 424 of file ossl.c.
References rb_nativethread_lock_lock(), and rb_nativethread_lock_unlock().
Referenced by ossl_dyn_lock_callback(), and ossl_lock_callback().
Definition at line 248 of file ossl.c.
References dOSSL, msg, NIL_P, NULL, ossl_clear_error(), Qnil, Qtrue, rb_exc_new3, rb_str_cat2(), rb_str_new(), rb_str_new_cstr(), rb_vsprintf(), and RSTRING_LEN.
Referenced by ossl_raise().
int ossl_pem_passwd_cb | ( | char * | buf, |
int | max_len, | ||
int | flag, | ||
void * | pwd_ | ||
) |
Definition at line 159 of file ossl.c.
References len, memcpy, NIL_P, NULL, OSSL_Debug, ossl_pem_passwd_cb0(), Qfalse, Qnil, Qtrue, rb_block_given_p(), rb_protect(), rb_set_errinfo(), RB_TYPE_P, rb_warning(), RSTRING_LEN, RSTRING_PTR, RTEST, and T_STRING.
Referenced by ossl_dsa_export(), ossl_dsa_initialize(), ossl_engine_s_by_id(), ossl_pkey_new_from_data(), ossl_rsa_export(), and ossl_rsa_initialize().
Definition at line 149 of file ossl.c.
References NIL_P, Qnil, rb_yield(), and StringValue.
Referenced by ossl_pem_passwd_cb().
Definition at line 133 of file ossl.c.
References eOSSLError, NIL_P, ossl_raise(), Qnil, RSTRING_LEN, and StringValue.
Referenced by ossl_dsa_export(), ossl_dsa_initialize(), ossl_pkey_new_from_data(), ossl_rsa_export(), and ossl_rsa_initialize().
Definition at line 278 of file ossl.c.
References err, ossl_make_error(), and rb_exc_raise().
Referenced by add_status_convert_time(), asn1integer_to_num(), asn1time_to_time(), BIGNUM_1c(), decode_bool(), decode_bstr(), decode_enum(), decode_eoc(), decode_int(), decode_null(), decode_obj(), decode_time(), DupConfigPtr(), DupPKCS7RecipientPtr(), DupPKCS7SignerPtr(), DupX509ReqPtr(), DupX509RevokedPtr(), GetCipherPtr(), GetDigestPtr(), GetPrivPKeyPtr(), hmac_final(), Init_ossl_bn(), Init_ossl_x509store(), int_ossl_asn1_decode0_cons(), int_ossl_decode_sanity_check(), integer_to_bnptr(), 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_hash(), 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_bn_value_ptr(), ossl_cipher_copy(), ossl_cipher_final(), ossl_cipher_init(), ossl_cipher_initialize(), ossl_cipher_is_authenticated(), 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_set_padding(), ossl_cipher_update(), ossl_dh_compute_key(), ossl_dh_export(), ossl_dh_generate_key(), ossl_dh_initialize(), ossl_dh_initialize_copy(), ossl_dh_new(), ossl_dh_s_generate(), ossl_dh_to_der(), ossl_dh_to_public_key(), ossl_dh_to_text(), ossl_digest_copy(), ossl_digest_finish(), ossl_digest_initialize(), ossl_digest_new(), ossl_digest_reset(), ossl_digest_update(), ossl_dsa_export(), ossl_dsa_initialize(), ossl_dsa_initialize_copy(), 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_engine_ctrl_cmd(), ossl_engine_finish(), ossl_engine_get_cipher(), ossl_engine_get_digest(), ossl_engine_load_privkey(), ossl_engine_load_pubkey(), ossl_engine_s_by_id(), ossl_fips_mode_set(), ossl_hmac_alloc(), ossl_hmac_copy(), ossl_hmac_s_hexdigest(), ossl_obj2bio(), ossl_ocspbres_add_nonce(), ossl_ocspbres_add_status(), ossl_ocspbres_alloc(), ossl_ocspbres_find_response(), ossl_ocspbres_get_responses(), ossl_ocspbres_get_status(), ossl_ocspbres_initialize(), ossl_ocspbres_initialize_copy(), ossl_ocspbres_sign(), ossl_ocspbres_to_der(), ossl_ocspbres_verify(), ossl_ocspcid_alloc(), ossl_ocspcid_get_hash_algorithm(), ossl_ocspcid_initialize(), ossl_ocspcid_initialize_copy(), ossl_ocspcid_to_der(), ossl_ocspreq_add_certid(), ossl_ocspreq_add_nonce(), ossl_ocspreq_alloc(), ossl_ocspreq_get_certid(), ossl_ocspreq_initialize(), ossl_ocspreq_initialize_copy(), ossl_ocspreq_sign(), ossl_ocspreq_to_der(), ossl_ocspres_alloc(), ossl_ocspres_initialize(), ossl_ocspres_initialize_copy(), ossl_ocspres_s_create(), ossl_ocspres_to_der(), ossl_ocspsres_alloc(), ossl_ocspsres_check_validity(), ossl_ocspsres_get_cert_status(), ossl_ocspsres_get_next_update(), ossl_ocspsres_get_revocation_reason(), ossl_ocspsres_get_revocation_time(), ossl_ocspsres_get_this_update(), ossl_ocspsres_initialize(), ossl_ocspsres_initialize_copy(), ossl_ocspsres_to_der(), ossl_pem_passwd_value(), ossl_pkcs12_initialize(), ossl_pkcs12_initialize_copy(), ossl_pkcs12_s_allocate(), ossl_pkcs12_s_create(), ossl_pkcs12_to_der(), ossl_pkcs5_pbkdf2_hmac_sha1(), 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_from_data(), ossl_pkey_sign(), ossl_pkey_verify(), ossl_rand_bytes(), ossl_rand_load_file(), ossl_rand_write_file(), ossl_rsa_export(), ossl_rsa_initialize(), ossl_rsa_initialize_copy(), 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_initialize(), ossl_ssl_read_internal(), ossl_ssl_session_initialize(), ossl_ssl_session_initialize_copy(), 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_ecdh_curves(), ossl_sslctx_set_security_level(), 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_get_value(), ossl_x509attr_initialize(), ossl_x509attr_initialize_copy(), 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_initialize_copy(), 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_initialize_copy(), 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_initialize_copy(), ossl_x509revoked_new(), ossl_x509revoked_set_extensions(), ossl_x509revoked_set_serial(), ossl_x509revoked_set_time(), ossl_x509stctx_alloc(), ossl_x509stctx_initialize(), ossl_x509stctx_verify(), ossl_x509store_add_cert(), ossl_x509store_add_crl(), ossl_x509store_add_file(), ossl_x509store_add_path(), ossl_x509store_alloc(), ossl_x509store_set_default_paths(), pkey_check_public_key(), pkey_new0(), read_would_block(), ssl_renegotiation_cb(), and write_would_block().
|
static |
|
static |
Definition at line 471 of file ossl.c.
References rb_nativethread_self().
Referenced by Init_ossl_locks().
Definition at line 226 of file ossl.c.
References rb_funcall(), and StringValue.
Referenced by obj_to_asn1derstr(), and ossl_to_der_if_possible().
Definition at line 237 of file ossl.c.
References ossl_to_der(), and rb_respond_to().
Referenced by join_der_i(), ossl_asn1_decode(), ossl_asn1_decode_all(), ossl_asn1_traverse(), ossl_dh_initialize(), ossl_dsa_initialize(), ossl_ocspbres_initialize(), ossl_ocspcid_initialize(), ossl_ocspreq_initialize(), ossl_ocspres_initialize(), ossl_ocspsres_initialize(), ossl_pkcs7_initialize(), ossl_rsa_initialize(), ossl_x509_initialize(), ossl_x509attr_initialize(), ossl_x509crl_initialize(), ossl_x509ext_initialize(), ossl_x509ext_set_value(), ossl_x509name_initialize(), and ossl_x509req_initialize().
VALUE dOSSL |
Definition at line 341 of file ossl.c.
Referenced by ossl_clear_error(), ossl_debug_get(), and ossl_make_error().
VALUE eOSSLError |
Definition at line 218 of file ossl.c.
Referenced by asn1integer_to_num(), Init_ossl_asn1(), Init_ossl_bn(), Init_ossl_cipher(), Init_ossl_config(), Init_ossl_dh(), Init_ossl_digest(), Init_ossl_dsa(), Init_ossl_engine(), Init_ossl_hmac(), Init_ossl_ns_spki(), Init_ossl_ocsp(), Init_ossl_pkcs12(), Init_ossl_pkcs5(), Init_ossl_pkcs7(), Init_ossl_pkey(), Init_ossl_rand(), Init_ossl_rsa(), Init_ossl_ssl(), Init_ossl_ssl_session(), Init_ossl_x509attr(), Init_ossl_x509cert(), Init_ossl_x509crl(), Init_ossl_x509ext(), Init_ossl_x509name(), Init_ossl_x509req(), Init_ossl_x509revoked(), Init_ossl_x509store(), num_to_asn1integer(), ossl_obj2bio(), and ossl_pem_passwd_value().
VALUE mOSSL |
Definition at line 213 of file ossl.c.
Referenced by Init_ossl_asn1(), Init_ossl_bn(), Init_ossl_cipher(), Init_ossl_config(), Init_ossl_dh(), Init_ossl_digest(), Init_ossl_dsa(), Init_ossl_engine(), Init_ossl_hmac(), Init_ossl_ns_spki(), Init_ossl_ocsp(), Init_ossl_pkcs12(), Init_ossl_pkcs5(), Init_ossl_pkcs7(), Init_ossl_pkey(), Init_ossl_rand(), Init_ossl_rsa(), Init_ossl_ssl(), Init_ossl_ssl_session(), Init_ossl_x509(), Init_ossl_x509attr(), Init_ossl_x509cert(), Init_ossl_x509crl(), Init_ossl_x509ext(), Init_ossl_x509name(), Init_ossl_x509req(), Init_ossl_x509revoked(), and Init_ossl_x509store().
|
static |