summaryrefslogtreecommitdiff
path: root/ext/openssl/ossl_config.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-15 01:54:40 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-15 01:54:40 +0000
commitd89b8333c5bf7b319f0ab774951dfa53993ebdc1 (patch)
tree65e5b11627653d6cc3c5fe49f62b5b1c6899fdd5 /ext/openssl/ossl_config.c
parent9d24a847b8e6ecd92e735601a1102270b9507fbb (diff)
* ext/openssl/ossl_digest.c (ossl_digest_initialize): [ruby-dev:25198]
* lib/cgi/session.rb (CGI::Session::initialize): generate new session if given session_id does not exist. [ruby-list:40368] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_config.c')
-rw-r--r--ext/openssl/ossl_config.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/ext/openssl/ossl_config.c b/ext/openssl/ossl_config.c
index 37abff5..ef89fdf 100644
--- a/ext/openssl/ossl_config.c
+++ b/ext/openssl/ossl_config.c
@@ -119,8 +119,8 @@ ossl_config_copy(VALUE self, VALUE other)
VALUE str;
CONF *conf;
- GetConfig(other, conf);
str = rb_funcall(self, rb_intern("to_s"), 0);
+ GetConfig(other, conf);
parse_config(str, conf);
return self;
@@ -134,11 +134,11 @@ ossl_config_initialize(int argc, VALUE *argv, VALUE self)
char *filename;
VALUE path;
- GetConfig(self, conf);
rb_scan_args(argc, argv, "01", &path);
if(!NIL_P(path)){
SafeStringValue(path);
filename = StringValuePtr(path);
+ GetConfig(self, conf);
if (!NCONF_load(conf, filename, &eline)){
if (eline <= 0)
ossl_raise(eConfigError, "wrong config file %s", filename);
@@ -149,7 +149,10 @@ ossl_config_initialize(int argc, VALUE *argv, VALUE self)
#ifdef OSSL_NO_CONF_API
else rb_raise(rb_eArgError, "wrong number of arguments (0 for 1)");
#else
- else _CONF_new_data(conf);
+ else {
+ GetConfig(self, conf);
+ _CONF_new_data(conf);
+ }
#endif
return self;
@@ -164,10 +167,10 @@ ossl_config_add_value(VALUE self, VALUE section, VALUE name, VALUE value)
CONF *conf;
CONF_VALUE *sv, *cv;
- GetConfig(self, conf);
StringValue(section);
StringValue(name);
StringValue(value);
+ GetConfig(self, conf);
if(!(sv = _CONF_get_section(conf, RSTRING(section)->ptr))){
if(!(sv = _CONF_new_section(conf, RSTRING(section)->ptr))){
ossl_raise(eConfigError, NULL);
@@ -195,9 +198,9 @@ ossl_config_get_value(VALUE self, VALUE section, VALUE name)
CONF *conf;
char *str;
- GetConfig(self, conf);
StringValue(section);
StringValue(name);
+ GetConfig(self, conf);
str = NCONF_get_string(conf, RSTRING(section)->ptr, RSTRING(name)->ptr);
if(!str){
ERR_clear_error();
@@ -261,6 +264,7 @@ ossl_config_get_section(VALUE self, VALUE section)
VALUE hash;
hash = rb_hash_new();
+ StringValue(section);
GetConfig(self, conf);
if (!(sk = NCONF_get_section(conf, StringValuePtr(section)))) {
ERR_clear_error();