Ruby 2.7.7p221 (2022-11-24 revision 168ec2b1e5ad0e4688e963d9de019557c78feed9)
Macros | Functions | Variables
ossl.h File Reference
#include <assert.h>
#include <ruby.h>
#include <errno.h>
#include <ruby/io.h>
#include <ruby/thread.h>
#include <openssl/opensslv.h>
#include <openssl/err.h>
#include <openssl/asn1.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/crypto.h>
#include <openssl/engine.h>
#include <openssl/ocsp.h>
#include <openssl/bn.h>
#include <openssl/rsa.h>
#include <openssl/dsa.h>
#include <openssl/evp.h>
#include <openssl/dh.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_pkey.h"
#include "ossl_rand.h"
#include "ossl_ssl.h"
#include "ossl_version.h"
#include "ossl_x509.h"
#include "ossl_engine.h"
#include "ossl_kdf.h"

Go to the source code of this file.

Macros

#define OSSL_Check_Kind(obj, klass)
 
#define ossl_str_adjust(str, p)
 
#define OSSL_BIO_reset(bio)
 
#define OSSL_Debug   ossl_debug
 

Functions

 STACK_OF (X509) *ossl_x509_ary2sk(VALUE)
 
int *VALUE ossl_x509_sk2ary (const STACK_OF(X509) *certs)
 
VALUE ossl_x509crl_sk2ary (const STACK_OF(X509_CRL) *crl)
 
VALUE ossl_x509name_sk2ary (const STACK_OF(X509_NAME) *names)
 
VALUE ossl_buf2str (char *buf, int len)
 
VALUE ossl_str_new (const char *, long, int *)
 
void ossl_bin2hex (unsigned char *in, char *out, size_t len)
 
VALUE ossl_pem_passwd_value (VALUE)
 
int ossl_pem_passwd_cb (char *, int, int, void *)
 
 NORETURN (void ossl_raise(VALUE, const char *,...))
 
void ossl_clear_error (void)
 
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
 
VALUE dOSSL
 

Macro Definition Documentation

◆ OSSL_BIO_reset

#define OSSL_BIO_reset (   bio)
Value:
do { \
(void)BIO_reset((bio)); \
ossl_clear_error(); \
} while (0)
() void(cc->call !=vm_call_general)

Definition at line 115 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")",\
}\
} while (0)
VALUE rb_eTypeError
Definition: error.c:924
VALUE rb_obj_class(VALUE)
Equivalent to Object#class in Ruby.
Definition: object.c:217
VALUE rb_obj_is_kind_of(VALUE, VALUE)
Determines if obj is a kind of c.
Definition: object.c:692
const VALUE VALUE obj
#define PRIsVALUE

Definition at line 57 of file ossl.h.

◆ OSSL_Debug

#define OSSL_Debug   ossl_debug

Definition at line 149 of file ossl.h.

◆ ossl_str_adjust

#define ossl_str_adjust (   str,
 
)
Value:
do{\
long len = RSTRING_LEN(str);\
long newlen = (long)((p) - (unsigned char*)RSTRING_PTR(str));\
assert(newlen <= len);\
rb_str_set_len((str), newlen);\
}while(0)
char str[HTML_ESCAPE_MAX_LEN+1]
Definition: escape.c:18
#define RSTRING_LEN(str)
#define RSTRING_PTR(str)
__inline__ const void *__restrict__ size_t len
#define long

Definition at line 87 of file ossl.h.

Function Documentation

◆ Init_openssl()

void Init_openssl ( void  )

◆ NORETURN()

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

◆ ossl_bin2hex()

void ossl_bin2hex ( unsigned char in,
char out,
size_t  len 
)

Definition at line 133 of file ossl.c.

References assert, i, and LONG_MAX.

◆ ossl_buf2str()

VALUE ossl_buf2str ( char buf,
int  len 
)

Definition at line 120 of file ossl.c.

References buf, len, ossl_str_new(), rb_jump_tag(), and str.

◆ ossl_clear_error()

void ossl_clear_error ( void  )

Definition at line 304 of file ossl.c.

References dOSSL, NULL, Qtrue, and rb_warn().

◆ ossl_debug()

void ossl_debug ( const char fmt,
  ... 
)

Definition at line 361 of file ossl.c.

References dOSSL, fmt, fprintf(), Qtrue, stderr, va_end, va_start, and vfprintf().

◆ ossl_pem_passwd_cb()

int ossl_pem_passwd_cb ( char buf,
int  max_len,
int  flag,
void pwd_ 
)

◆ ossl_pem_passwd_value()

VALUE ossl_pem_passwd_value ( VALUE  pass)

Definition at line 151 of file ossl.c.

References eOSSLError, NIL_P, ossl_raise(), Qnil, RSTRING_LEN, and StringValue().

◆ ossl_str_new()

VALUE ossl_str_new ( const char ptr,
long  len,
int pstate 
)

Definition at line 101 of file ossl.c.

References rb_protect(), and str.

Referenced by ossl_buf2str(), and ossl_membio2str().

◆ ossl_to_der()

VALUE ossl_to_der ( VALUE  obj)

Definition at line 244 of file ossl.c.

References obj, and rb_funcall.

◆ ossl_to_der_if_possible()

VALUE ossl_to_der_if_possible ( VALUE  obj)

Definition at line 255 of file ossl.c.

References obj, and rb_respond_to().

◆ ossl_x509_sk2ary()

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

◆ ossl_x509crl_sk2ary()

VALUE ossl_x509crl_sk2ary ( const STACK_OF(X509_CRL) *  crl)

◆ ossl_x509name_sk2ary()

VALUE ossl_x509name_sk2ary ( const STACK_OF(X509_NAME) *  names)

◆ STACK_OF()

STACK_OF ( X509  )

Variable Documentation

◆ dOSSL

VALUE dOSSL
extern

Definition at line 357 of file ossl.c.

Referenced by ossl_clear_error(), and ossl_debug().

◆ eOSSLError

VALUE eOSSLError
extern

◆ mOSSL

VALUE mOSSL
extern