Ruby: ext/openssl/ossl_x509ext.c File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Macros | Functions | Variables
ossl_x509ext.c File Reference
`#include "ossl.h"`

Go to the source code of this file.

## Macros
#define | NewX509Ext(klass) TypedData_Wrap_Struct((klass), &ossl_x509ext_type, 0)
#define | SetX509Ext(obj, ext)
#define | GetX509Ext(obj, ext)
#define | MakeX509ExtFactory(klass, obj, ctx)
#define | GetX509ExtFactory(obj, ctx)

## Functions
VALUE | ossl_x509ext_new (X509_EXTENSION *ext)
X509_EXTENSION * | GetX509ExtPtr (VALUE obj)
void | Init_ossl_x509ext (void)

## Variables
VALUE | cX509Ext
VALUE | cX509ExtFactory
VALUE | eX509ExtError

## Macro Definition Documentation

## ◆ GetX509Ext

#define GetX509Ext | ( |  | obj,
|  |  | ext
| ) |  |

Value:
do { \
TypedData_Get_Struct((obj), X509_EXTENSION, &ossl_x509ext_type, (ext)); \
if (!(ext)) { \
ossl_raise(rb_eRuntimeError, "EXT wasn't initialized!"); \
} \
} while (0)
rb_eRuntimeError
VALUE rb_eRuntimeError
Definition: error.c:1055

Definition at line 20 of file ossl_x509ext.c.

## ◆ GetX509ExtFactory

#define GetX509ExtFactory | ( |  | obj,
|  |  | ctx
| ) |  |

Value:
do { \
TypedData_Get_Struct((obj), X509V3_CTX, &ossl_x509extfactory_type, (ctx)); \
if (!(ctx)) { \
ossl_raise(rb_eRuntimeError, "CTX wasn't initialized!"); \
} \
} while (0)

Definition at line 33 of file ossl_x509ext.c.

## ◆ MakeX509ExtFactory

#define MakeX509ExtFactory | ( |  | klass,
|  |  | obj,
|  |  | ctx
| ) |  |

Value:
do { \
(obj) = TypedData_Wrap_Struct((klass), &ossl_x509extfactory_type, 0); \
if (!((ctx) = OPENSSL_malloc(sizeof(X509V3_CTX)))) \
ossl_raise(rb_eRuntimeError, "CTX wasn't allocated!"); \
X509V3_set_ctx((ctx), NULL, NULL, NULL, NULL, 0); \
RTYPEDDATA_DATA(obj) = (ctx); \
} while (0)
NULL
#define NULL
Definition: regenc.h:69
TypedData_Wrap_Struct
#define TypedData_Wrap_Struct(klass, data_type, sval)
Definition: rtypeddata.h:101

Definition at line 26 of file ossl_x509ext.c.

## ◆ NewX509Ext

#define NewX509Ext | ( |  | klass | ) | TypedData_Wrap_Struct((klass), &ossl_x509ext_type, 0)

Definition at line 12 of file ossl_x509ext.c.

## ◆ SetX509Ext

#define SetX509Ext | ( |  | obj,
|  |  | ext
| ) |  |

Value:
do { \
if (!(ext)) { \
ossl_raise(rb_eRuntimeError, "EXT wasn't initialized!"); \
} \
RTYPEDDATA_DATA(obj) = (ext); \
} while (0)

Definition at line 14 of file ossl_x509ext.c.

## Function Documentation

## ◆ GetX509ExtPtr()

X509_EXTENSION * GetX509ExtPtr | ( | VALUE | obj | ) |

Definition at line 85 of file ossl_x509ext.c.

References GetX509Ext.

## ◆ Init_ossl_x509ext()

void Init_ossl_x509ext | ( | void |  | ) |

Definition at line 451 of file ossl_x509ext.c.

References cX509Ext, cX509ExtFactory, eOSSLError, eX509ExtError, mOSSL, mX509, Qfalse, rb_attr(), rb_cObject, rb_define_alloc_func(), rb_define_class_under(), rb_define_method, rb_define_module(), rb_define_module_under(), rb_eStandardError, and rb_intern().

Referenced by Init_ossl_x509().

## ◆ ossl_x509ext_new()

VALUE ossl_x509ext_new | ( | X509_EXTENSION * | ext | ) |

Definition at line 65 of file ossl_x509ext.c.

References cX509Ext, eX509ExtError, NewX509Ext, NULL, ossl_raise(), and SetX509Ext.

## Variable Documentation

## ◆ cX509Ext

VALUE cX509Ext

Definition at line 43 of file ossl_x509ext.c.

Referenced by Init_ossl_x509ext(), and ossl_x509ext_new().

## ◆ cX509ExtFactory

VALUE cX509ExtFactory

Definition at line 44 of file ossl_x509ext.c.

Referenced by Init_ossl_x509ext().

## ◆ eX509ExtError

VALUE eX509ExtError

Definition at line 45 of file ossl_x509ext.c.

Referenced by Init_ossl_x509ext(), and ossl_x509ext_new().