39 ossl_generate_cb_2(
int p,
int n, BN_GENCB *cb)
42 struct ossl_generate_cb_arg *arg;
45 arg = (
struct ossl_generate_cb_arg *)cb->arg;
60 if (arg->stop)
return 0;
65 ossl_generate_cb_stop(
void *ptr)
67 struct ossl_generate_cb_arg *arg = (
struct ossl_generate_cb_arg *)ptr;
81 switch (EVP_PKEY_type(pkey->type)) {
82 #if !defined(OPENSSL_NO_RSA) 86 #if !defined(OPENSSL_NO_DSA) 90 #if !defined(OPENSSL_NO_DH) 94 #if !defined(OPENSSL_NO_EC) && (OPENSSL_VERSION_NUMBER >= 0x0090802fL) 150 if (!(pkey = d2i_PrivateKey_bio(bio,
NULL))) {
157 if (!(pkey = d2i_PUBKEY_bio(bio,
NULL))) {
202 CRYPTO_add(&pkey->references, 1, CRYPTO_LOCK_EVP_PKEY);
216 CRYPTO_add(&pkey->references, 1, CRYPTO_LOCK_EVP_PKEY);
230 if (!(pkey = EVP_PKEY_new())) {
276 unsigned int buf_len;
EVP_PKEY * GetPrivPKeyPtr(VALUE obj)
VALUE ossl_dsa_new(EVP_PKEY *)
EVP_PKEY * DupPrivPKeyPtr(VALUE obj)
VALUE rb_funcall(VALUE, ID, int,...)
Calls a method.
void rb_str_set_len(VALUE, long)
VALUE rb_protect(VALUE(*proc)(VALUE), VALUE data, int *state)
if((ID)(DISPID) nameid !=nameid)
VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)
Defines a class under the namespace of outer.
void rb_define_alloc_func(VALUE, rb_alloc_func_t)
#define GetPKey(obj, pkey)
VALUE ossl_rsa_new(EVP_PKEY *)
VALUE ossl_pkey_new(EVP_PKEY *pkey)
void ossl_generate_cb(int p, int n, void *arg)
RUBY_EXTERN VALUE rb_cObject
#define OSSL_BIO_reset(bio)
static VALUE ossl_pkey_initialize(VALUE self)
VALUE ossl_dh_new(EVP_PKEY *)
const EVP_MD * GetDigestPtr(VALUE obj)
void rb_ary_store(VALUE ary, long idx, VALUE val)
#define SafeGetPKey(obj, pkey)
static VALUE ossl_pkey_alloc(VALUE klass)
void rb_define_module_function(VALUE module, const char *name, VALUE(*func)(ANYARGS), int argc)
Defines a module function for module.
static VALUE ossl_pkey_new_from_data(int argc, VALUE *argv, VALUE self)
#define WrapPKey(klass, obj, pkey)
BIO * ossl_obj2bio(VALUE obj)
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
VALUE ossl_pkey_new_from_file(VALUE filename)
VALUE rb_define_module_under(VALUE outer, const char *name)
VALUE rb_obj_is_instance_of(VALUE, VALUE)
void rb_fd_fix_cloexec(int fd)
RUBY_EXTERN char * strerror(int)
int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx)
void ossl_raise(VALUE exc, const char *fmt,...)
EVP_PKEY * GetPKeyPtr(VALUE obj)
#define SafeStringValue(v)
EVP_PKEY * DupPKeyPtr(VALUE obj)
static VALUE ossl_pkey_sign(VALUE self, VALUE digest, VALUE data)
#define assert(condition)
#define StringValuePtr(v)
int ossl_pem_passwd_cb(char *buf, int max_len, int flag, void *pwd)
#define RSTRING_LENINT(str)
VALUE rb_define_module(const char *name)
static VALUE ossl_pkey_verify(VALUE self, VALUE digest, VALUE sig, VALUE data)
void rb_define_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
VALUE ossl_ec_new(EVP_PKEY *)
VALUE rb_str_new(const char *, long)