10 #if !defined(_OSSL_H_) 13 #include RUBY_EXTCONF_H 20 #include <openssl/opensslv.h> 21 #include <openssl/err.h> 22 #include <openssl/asn1.h> 23 #include <openssl/x509v3.h> 24 #include <openssl/ssl.h> 25 #include <openssl/pkcs12.h> 26 #include <openssl/pkcs7.h> 27 #include <openssl/hmac.h> 28 #include <openssl/rand.h> 29 #include <openssl/conf.h> 30 #include <openssl/conf_api.h> 31 #include <openssl/crypto.h> 32 #if !defined(OPENSSL_NO_ENGINE) 33 # include <openssl/engine.h> 35 #if !defined(OPENSSL_NO_OCSP) 36 # include <openssl/ocsp.h> 52 #define OSSL_Check_Kind(obj, klass) do {\ 53 if (!rb_obj_is_kind_of((obj), (klass))) {\ 54 ossl_raise(rb_eTypeError, "wrong argument (%"PRIsVALUE")! (Expected kind of %"PRIsVALUE")",\ 55 rb_obj_class(obj), (klass));\ 59 #define OSSL_Check_Instance(obj, klass) do {\ 60 if (!rb_obj_is_instance_of((obj), (klass))) {\ 61 ossl_raise(rb_eTypeError, "wrong argument (%"PRIsVALUE")! (Expected instance of %"PRIsVALUE")",\ 62 rb_obj_class(obj), (klass));\ 66 #define OSSL_Check_Same_Class(obj1, obj2) do {\ 67 if (!rb_obj_is_instance_of((obj1), rb_obj_class(obj2))) {\ 68 ossl_raise(rb_eTypeError, "wrong argument type");\ 82 #define ossl_str_adjust(str, p) \ 84 long len = RSTRING_LEN(str);\ 85 long newlen = (long)((p) - (unsigned char*)RSTRING_PTR(str));\ 86 assert(newlen <= len);\ 87 rb_str_set_len((str), newlen);\ 110 #define OSSL_BIO_reset(bio) do { \ 111 (void)BIO_reset((bio)); \ 112 ossl_clear_error(); \ 118 #define OSSL_ErrMsg() ERR_reason_error_string(ERR_get_error()) 135 #if defined(HAVE_VA_ARGS_MACRO) 136 #define OSSL_Debug(...) do { \ 137 if (dOSSL == Qtrue) { \ 138 fprintf(stderr, "OSSL_DEBUG: "); \ 139 fprintf(stderr, __VA_ARGS__); \ 140 fprintf(stderr, " [%s:%d]\n", __FILE__, __LINE__); \ 144 #define OSSL_Warning(fmt, ...) do { \ 145 OSSL_Debug((fmt), ##__VA_ARGS__); \ 146 rb_warning((fmt), ##__VA_ARGS__); \ 149 #define OSSL_Warn(fmt, ...) do { \ 150 OSSL_Debug((fmt), ##__VA_ARGS__); \ 151 rb_warn((fmt), ##__VA_ARGS__); \ 155 #define OSSL_Debug ossl_debug 156 #define OSSL_Warning rb_warning 157 #define OSSL_Warn rb_warn int *VALUE ossl_x509_sk2ary(const STACK_OF(X509) *certs)
VALUE ossl_x509name_sk2ary(const STACK_OF(X509_NAME) *names)
STACK_OF(X509) *ossl_x509_ary2sk0(VALUE)
int ossl_pem_passwd_cb(char *, int, int, void *)
void ossl_debug(const char *,...)
VALUE ossl_x509crl_sk2ary(const STACK_OF(X509_CRL) *crl)
VALUE ossl_buf2str(char *buf, int len)
VALUE ossl_to_der_if_possible(VALUE)
unsigned char buf[MIME_BUF_SIZE]
register unsigned int len
void ossl_raise(VALUE exc, const char *fmt,...)
VALUE ossl_pem_passwd_value(VALUE)
NORETURN(void ossl_raise(VALUE, const char *,...))
void ossl_bin2hex(unsigned char *in, char *out, size_t len)
void ossl_clear_error(void)