Ruby  3.1.0dev(2021-09-10revisionb76ad15ed0da636161de0243c547ee1e6fc95681)
Macros | Functions | Variables
ossl_pkcs7.c File Reference

(b76ad15ed0da636161de0243c547ee1e6fc95681)

#include "ossl.h"
Include dependency graph for ossl_pkcs7.c:

Go to the source code of this file.

Macros

#define NewPKCS7si(klass)   TypedData_Wrap_Struct((klass), &ossl_pkcs7_signer_info_type, 0)
 
#define SetPKCS7si(obj, p7si)
 
#define GetPKCS7si(obj, p7si)
 
#define NewPKCS7ri(klass)   TypedData_Wrap_Struct((klass), &ossl_pkcs7_recip_info_type, 0)
 
#define SetPKCS7ri(obj, p7ri)
 
#define GetPKCS7ri(obj, p7ri)
 
#define numberof(ary)   (int)(sizeof(ary)/sizeof((ary)[0]))
 
#define ossl_pkcs7_set_data(o, v)   rb_iv_set((o), "@data", (v))
 
#define ossl_pkcs7_get_data(o)   rb_iv_get((o), "@data")
 
#define ossl_pkcs7_set_err_string(o, v)   rb_iv_set((o), "@error_string", (v))
 
#define ossl_pkcs7_get_err_string(o)   rb_iv_get((o), "@error_string")
 
#define DefPKCS7Const(x)   rb_define_const(cPKCS7, #x, INT2NUM(PKCS7_##x))
 

Functions

void Init_ossl_pkcs7 (void)
 

Variables

VALUE cPKCS7
 
VALUE cPKCS7Signer
 
VALUE cPKCS7Recipient
 
VALUE ePKCS7Error
 
const rb_data_type_t ossl_pkcs7_type
 

Macro Definition Documentation

◆ DefPKCS7Const

#define DefPKCS7Const (   x)    rb_define_const(cPKCS7, #x, INT2NUM(PKCS7_##x))

◆ GetPKCS7ri

#define GetPKCS7ri (   obj,
  p7ri 
)
Value:
do { \
TypedData_Get_Struct((obj), PKCS7_RECIP_INFO, &ossl_pkcs7_recip_info_type, (p7ri)); \
if (!(p7ri)) { \
ossl_raise(rb_eRuntimeError, "PKCS7ri wasn't initialized."); \
} \
} while (0)

Definition at line 35 of file ossl_pkcs7.c.

◆ GetPKCS7si

#define GetPKCS7si (   obj,
  p7si 
)
Value:
do { \
TypedData_Get_Struct((obj), PKCS7_SIGNER_INFO, &ossl_pkcs7_signer_info_type, (p7si)); \
if (!(p7si)) { \
ossl_raise(rb_eRuntimeError, "PKCS7si wasn't initialized."); \
} \
} while (0)

Definition at line 20 of file ossl_pkcs7.c.

◆ NewPKCS7ri

#define NewPKCS7ri (   klass)    TypedData_Wrap_Struct((klass), &ossl_pkcs7_recip_info_type, 0)

Definition at line 27 of file ossl_pkcs7.c.

◆ NewPKCS7si

#define NewPKCS7si (   klass)    TypedData_Wrap_Struct((klass), &ossl_pkcs7_signer_info_type, 0)

Definition at line 12 of file ossl_pkcs7.c.

◆ numberof

#define numberof (   ary)    (int)(sizeof(ary)/sizeof((ary)[0]))

Definition at line 42 of file ossl_pkcs7.c.

◆ ossl_pkcs7_get_data

#define ossl_pkcs7_get_data (   o)    rb_iv_get((o), "@data")

Definition at line 45 of file ossl_pkcs7.c.

◆ ossl_pkcs7_get_err_string

#define ossl_pkcs7_get_err_string (   o)    rb_iv_get((o), "@error_string")

Definition at line 47 of file ossl_pkcs7.c.

◆ ossl_pkcs7_set_data

#define ossl_pkcs7_set_data (   o,
 
)    rb_iv_set((o), "@data", (v))

Definition at line 44 of file ossl_pkcs7.c.

◆ ossl_pkcs7_set_err_string

#define ossl_pkcs7_set_err_string (   o,
 
)    rb_iv_set((o), "@error_string", (v))

Definition at line 46 of file ossl_pkcs7.c.

◆ SetPKCS7ri

#define SetPKCS7ri (   obj,
  p7ri 
)
Value:
do { \
if (!(p7ri)) { \
ossl_raise(rb_eRuntimeError, "PKCS7ri wasn't initialized."); \
} \
RTYPEDDATA_DATA(obj) = (p7ri); \
} while (0)

Definition at line 29 of file ossl_pkcs7.c.

◆ SetPKCS7si

#define SetPKCS7si (   obj,
  p7si 
)
Value:
do { \
if (!(p7si)) { \
ossl_raise(rb_eRuntimeError, "PKCS7si wasn't initialized."); \
} \
RTYPEDDATA_DATA(obj) = (p7si); \
} while (0)

Definition at line 14 of file ossl_pkcs7.c.

Function Documentation

◆ Init_ossl_pkcs7()

void Init_ossl_pkcs7 ( void  )

Variable Documentation

◆ cPKCS7

VALUE cPKCS7

Definition at line 52 of file ossl_pkcs7.c.

Referenced by Init_ossl_pkcs7().

◆ cPKCS7Recipient

VALUE cPKCS7Recipient

Definition at line 54 of file ossl_pkcs7.c.

◆ cPKCS7Signer

VALUE cPKCS7Signer

Definition at line 53 of file ossl_pkcs7.c.

◆ ePKCS7Error

VALUE ePKCS7Error

Definition at line 55 of file ossl_pkcs7.c.

Referenced by Init_ossl_pkcs7().

◆ ossl_pkcs7_type

const rb_data_type_t ossl_pkcs7_type
Initial value:
= {
"OpenSSL/PKCS7",
{
0, ossl_pkcs7_free,
},
}

Definition at line 63 of file ossl_pkcs7.c.

RUBY_TYPED_FREE_IMMEDIATELY
@ RUBY_TYPED_FREE_IMMEDIATELY
Definition: rtypeddata.h:62
rb_eRuntimeError
VALUE rb_eRuntimeError
Definition: error.c:1091