Skip to content

Commit

Permalink
* ext/openssl/ossl_ssl.c: Remove set, but unused variables.
Browse files Browse the repository at this point in the history
  ext/openssl/ossl_pkey.c: ditto

* ext/openssl/ossl_pkey_dh.c: Make functions passed to
  rb_thread_blocking_region return VALUE instead of void. 
  ext/openssl/ossl_pkey_dsa.c: ditto
  ext/openssl/ossl_pkey_rsa.c: ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
emboss committed Oct 19, 2011
1 parent 12c497d commit c35204f
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 11 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
@@ -1,3 +1,13 @@
Wed Oct 19 12:11:26 2011 Martin Bosslet <Martin.Bosslet@googlemail.com>

* ext/openssl/ossl_ssl.c: Remove set, but unused variables.
ext/openssl/ossl_pkey.c: ditto

* ext/openssl/ossl_pkey_dh.c: Make functions passed to
rb_thread_blocking_region return VALUE instead of void.
ext/openssl/ossl_pkey_dsa.c: ditto
ext/openssl/ossl_pkey_rsa.c: ditto

Tue Oct 18 23:28:53 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>

* hash.c (identhash): share with type_numhash.
Expand Down
4 changes: 2 additions & 2 deletions ext/openssl/ossl_pkey.c
Expand Up @@ -38,7 +38,7 @@ ossl_generate_cb(int p, int n, void *arg)
int
ossl_generate_cb_2(int p, int n, BN_GENCB *cb)
{
VALUE ary, ret;
VALUE ary;
struct ossl_generate_cb_arg *arg;
int state;

Expand All @@ -51,7 +51,7 @@ ossl_generate_cb_2(int p, int n, BN_GENCB *cb)
/*
* can be break by raising exception or 'break'
*/
ret = rb_protect(rb_yield, ary, &state);
rb_protect(rb_yield, ary, &state);
if (state) {
arg->stop = 1;
arg->state = state;
Expand Down
3 changes: 2 additions & 1 deletion ext/openssl/ossl_pkey_dh.c
Expand Up @@ -90,11 +90,12 @@ struct dh_blocking_gen_arg {
int result;
};

static void
static VALUE
dh_blocking_gen(void *arg)
{
struct dh_blocking_gen_arg *gen = (struct dh_blocking_gen_arg *)arg;
gen->result = DH_generate_parameters_ex(gen->dh, gen->size, gen->gen, gen->cb);
return Qnil;
}
#endif

Expand Down
3 changes: 2 additions & 1 deletion ext/openssl/ossl_pkey_dsa.c
Expand Up @@ -87,11 +87,12 @@ struct dsa_blocking_gen_arg {
int result;
};

static void
static VALUE
dsa_blocking_gen(void *arg)
{
struct dsa_blocking_gen_arg *gen = (struct dsa_blocking_gen_arg *)arg;
gen->result = DSA_generate_parameters_ex(gen->dsa, gen->size, gen->seed, gen->seed_len, gen->counter, gen->h, gen->cb);
return Qnil;
}
#endif

Expand Down
3 changes: 2 additions & 1 deletion ext/openssl/ossl_pkey_rsa.c
Expand Up @@ -85,11 +85,12 @@ struct rsa_blocking_gen_arg {
int result;
};

static void
static VALUE
rsa_blocking_gen(void *arg)
{
struct rsa_blocking_gen_arg *gen = (struct rsa_blocking_gen_arg *)arg;
gen->result = RSA_generate_key_ex(gen->rsa, gen->size, gen->e, gen->cb);
return Qnil;
}
#endif

Expand Down
12 changes: 6 additions & 6 deletions ext/openssl/ossl_ssl.c
Expand Up @@ -380,7 +380,7 @@ ossl_call_session_new_cb(VALUE ary)
static int
ossl_sslctx_session_new_cb(SSL *ssl, SSL_SESSION *sess)
{
VALUE ary, ssl_obj, sess_obj, ret_obj;
VALUE ary, ssl_obj, sess_obj;
void *ptr;
int state = 0;

Expand All @@ -397,7 +397,7 @@ ossl_sslctx_session_new_cb(SSL *ssl, SSL_SESSION *sess)
rb_ary_push(ary, ssl_obj);
rb_ary_push(ary, sess_obj);

ret_obj = rb_protect((VALUE(*)_((VALUE)))ossl_call_session_new_cb, ary, &state);
rb_protect((VALUE(*)_((VALUE)))ossl_call_session_new_cb, ary, &state);
if (state) {
rb_ivar_set(ssl_obj, ID_callback_state, INT2NUM(state));
}
Expand Down Expand Up @@ -429,7 +429,7 @@ ossl_call_session_remove_cb(VALUE ary)
static void
ossl_sslctx_session_remove_cb(SSL_CTX *ctx, SSL_SESSION *sess)
{
VALUE ary, sslctx_obj, sess_obj, ret_obj;
VALUE ary, sslctx_obj, sess_obj;
void *ptr;
int state = 0;

Expand All @@ -446,7 +446,7 @@ ossl_sslctx_session_remove_cb(SSL_CTX *ctx, SSL_SESSION *sess)
rb_ary_push(ary, sslctx_obj);
rb_ary_push(ary, sess_obj);

ret_obj = rb_protect((VALUE(*)_((VALUE)))ossl_call_session_remove_cb, ary, &state);
rb_protect((VALUE(*)_((VALUE)))ossl_call_session_remove_cb, ary, &state);
if (state) {
/*
the SSL_CTX is frozen, nowhere to save state.
Expand Down Expand Up @@ -506,7 +506,7 @@ ossl_call_servername_cb(VALUE ary)
static int
ssl_servername_cb(SSL *ssl, int *ad, void *arg)
{
VALUE ary, ssl_obj, ret_obj;
VALUE ary, ssl_obj;
void *ptr;
int state = 0;
const char *servername = SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name);
Expand All @@ -521,7 +521,7 @@ ssl_servername_cb(SSL *ssl, int *ad, void *arg)
rb_ary_push(ary, ssl_obj);
rb_ary_push(ary, rb_str_new2(servername));

ret_obj = rb_protect((VALUE(*)_((VALUE)))ossl_call_servername_cb, ary, &state);
rb_protect((VALUE(*)_((VALUE)))ossl_call_servername_cb, ary, &state);
if (state) {
rb_ivar_set(ssl_obj, ID_callback_state, INT2NUM(state));
return SSL_TLSEXT_ERR_ALERT_FATAL;
Expand Down

0 comments on commit c35204f

Please sign in to comment.