Ruby
3.1.0dev(2021-09-10revisionb76ad15ed0da636161de0243c547ee1e6fc95681)
|
Go to the documentation of this file.
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/rand.h>
28 #include <openssl/conf.h>
30 #include <openssl/ts.h>
32 #include <openssl/crypto.h>
33 #if !defined(OPENSSL_NO_ENGINE)
34 # include <openssl/engine.h>
36 #if !defined(OPENSSL_NO_OCSP)
37 # include <openssl/ocsp.h>
39 #include <openssl/bn.h>
40 #include <openssl/rsa.h>
41 #include <openssl/dsa.h>
42 #include <openssl/evp.h>
43 #include <openssl/dh.h>
58 #define OSSL_Check_Kind(obj, klass) do {\
59 if (!rb_obj_is_kind_of((obj), (klass))) {\
60 ossl_raise(rb_eTypeError, "wrong argument (%"PRIsVALUE")! (Expected kind of %"PRIsVALUE")",\
61 rb_obj_class(obj), (klass));\
68 #if !defined(NUM2UINT64T)
70 # define NUM2UINT64T(x) ((uint64_t)NUM2ULONG(x))
71 # elif defined(HAVE_LONG_LONG) && SIZEOF_LONG_LONG == 8
72 # define NUM2UINT64T(x) ((uint64_t)NUM2ULL(x))
74 # error "unknown platform; no 64-bit width integer"
88 #define ossl_str_adjust(str, p) \
90 long newlen = (long)((p) - (unsigned char*)RSTRING_PTR(str));\
91 assert(newlen <= RSTRING_LEN(str));\
92 rb_str_set_len((str), newlen);\
115 #define OSSL_BIO_reset(bio) do { \
116 (void)BIO_reset((bio)); \
117 ossl_clear_error(); \
138 #if defined(HAVE_VA_ARGS_MACRO)
139 #define OSSL_Debug(...) do { \
140 if (dOSSL == Qtrue) { \
141 fprintf(stderr, "OSSL_DEBUG: "); \
142 fprintf(stderr, __VA_ARGS__); \
143 fprintf(stderr, " [%s:%d]\n", __FILE__, __LINE__); \
148 void ossl_debug(
const char *, ...);
149 #define OSSL_Debug ossl_debug
171 #ifndef OPENSSL_NO_TS
VALUE ossl_pem_passwd_value(VALUE)
int ossl_pem_passwd_cb(char *, int, int, void *)
VALUE ossl_buf2str(char *buf, int len)
int *VALUE ossl_x509_sk2ary(const STACK_OF(X509) *certs)
VALUE ossl_to_der_if_possible(VALUE)
VALUE ossl_x509name_sk2ary(const STACK_OF(X509_NAME) *names)
void ossl_raise(VALUE exc, const char *fmt,...)
NORETURN(void ossl_raise(VALUE, const char *,...))
VALUE ossl_str_new(const char *, long, int *)
unsigned char buf[MIME_BUF_SIZE]
void ossl_bin2hex(unsigned char *in, char *out, size_t len)
STACK_OF(X509) *ossl_x509_ary2sk(VALUE)
void ossl_clear_error(void)
VALUE ossl_x509crl_sk2ary(const STACK_OF(X509_CRL) *crl)