Ruby: ext/openssl/ossl_pkey_dh.c File Reference

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

Data Structures | Macros | Functions | Variables
ossl_pkey_dh.c File Reference
`#include "ossl.h"`

Go to the source code of this file.

## Data Structures
struct | dh_blocking_gen_arg

## Macros
#define | GetPKeyDH(obj, pkey)
#define | GetDH(obj, dh)

## Functions
VALUE | ossl_dh_new (EVP_PKEY *pkey)
void | Init_ossl_dh (void)

## Variables
VALUE | cDH
VALUE | eDHError

## Macro Definition Documentation

## ◆ GetDH

#define GetDH | ( |  | obj,
|  |  | dh
| ) |  |

Value:
do { \
EVP_PKEY *_pkey; \
GetPKeyDH((obj), _pkey); \
(dh) = EVP_PKEY_get0_DH(_pkey); \
} while (0)

Definition at line 20 of file ossl_pkey_dh.c.

## ◆ GetPKeyDH

#define GetPKeyDH | ( |  | obj,
|  |  | pkey
| ) |  |

Value:
do { \
GetPKey((obj), (pkey)); \
if (EVP_PKEY_base_id(pkey) != EVP_PKEY_DH) { /* PARANOIA? */ \
ossl_raise(rb_eRuntimeError, "THIS IS NOT A DH!") ; \
} \
} while (0)
rb_eRuntimeError
VALUE rb_eRuntimeError
Definition: error.c:1055

Definition at line 14 of file ossl_pkey_dh.c.

## Function Documentation

## ◆ Init_ossl_dh()

void Init_ossl_dh | ( | void |  | ) |

Definition at line 576 of file ossl_pkey_dh.c.

References cDH, cPKey, DEF_OSSL_PKEY_BN, dh_blocking_gen_arg::dh, eDHError, eOSSLError, ePKeyError, g, mOSSL, mPKey, priv_key, pub_key, rb_cObject, rb_define_alias(), rb_define_class_under(), rb_define_method, rb_define_module_under(), and rb_define_singleton_method.

Referenced by Init_ossl_pkey().

## ◆ ossl_dh_new()

VALUE ossl_dh_new | ( | EVP_PKEY * | pkey | ) |

Definition at line 58 of file ossl_pkey_dh.c.

References cDH, eDHError, NewPKey, NULL, ossl_raise(), Qfalse, rb_eTypeError, and SetPKey.

## Variable Documentation

## ◆ cDH

VALUE cDH

Definition at line 29 of file ossl_pkey_dh.c.

Referenced by Init_ossl_dh(), and ossl_dh_new().

## ◆ eDHError

VALUE eDHError

Definition at line 30 of file ossl_pkey_dh.c.

Referenced by Init_ossl_dh(), and ossl_dh_new().