diff options
author | Michal Rokos <m.rokos@sh.cvut.cz> | 2002-02-13 13:09:26 +0000 |
---|---|---|
committer | Michal Rokos <m.rokos@sh.cvut.cz> | 2002-02-13 13:09:26 +0000 |
commit | 5e2a679a46e2164f8b38b71132787c3327862957 (patch) | |
tree | 4ab99602f4f8adec2a96194abd4a39c48e0fab00 /ossl_config.c | |
parent | 1ad093352e953cabd70c851989ce06edc233d5f4 (diff) | |
download | ruby-openssl-history-5e2a679a46e2164f8b38b71132787c3327862957.tar.gz |
* transition from rb_raise to OSSL_Raise (where possible)
* some mem checks
* preliminary DH key support
Diffstat (limited to 'ossl_config.c')
-rw-r--r-- | ossl_config.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/ossl_config.c b/ossl_config.c index 6ba188b..548affc 100644 --- a/ossl_config.c +++ b/ossl_config.c @@ -1,7 +1,7 @@ /* * $Id$ * 'OpenSSL for Ruby' project - * Copyright (C) 2001 Michal Rokos <m.rokos@sh.cvut.cz> + * Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz> * All rights reserved. */ /* @@ -66,7 +66,8 @@ ossl_config_s_load(int argc, VALUE* argv, VALUE klass) if (err_line <= 0) rb_raise(eConfigError, "wrong config file %s", RSTRING(path)->ptr); else - rb_raise(eConfigError, "error on line %ld in config file %s", err_line, RSTRING(path)->ptr); + rb_raise(eConfigError, "error on line %ld in config file %s",\ + err_line, RSTRING(path)->ptr); } MakeConfig(obj, confp); @@ -89,9 +90,9 @@ ossl_config_get_value(VALUE self, VALUE section, VALUE item) } Check_SafeStr(item); - if (!(str = CONF_get_string(confp->config, sect, RSTRING(item)->ptr))) + if (!(str = CONF_get_string(confp->config, sect, RSTRING(item)->ptr))) { OSSL_Raise(eConfigError, ""); - + } return rb_str_new2(str); } @@ -110,9 +111,10 @@ ossl_config_get_section(VALUE self, VALUE section) Check_SafeStr(section); - if (!(sk = CONF_get_section(confp->config, RSTRING(section)->ptr))) + if (!(sk = CONF_get_section(confp->config, RSTRING(section)->ptr))) { OSSL_Raise(eConfigError, ""); - + } + hash = rb_hash_new(); if ((entries = sk_CONF_VALUE_num(sk)) < 0) { @@ -121,8 +123,7 @@ ossl_config_get_section(VALUE self, VALUE section) } for (i=0; i<entries; i++) { - entry = sk_CONF_VALUE_value(sk, i); - + entry = sk_CONF_VALUE_value(sk, i); rb_hash_aset(hash, rb_str_new2(entry->name), rb_str_new2(entry->value)); } |