aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Rokos <m.rokos@sh.cvut.cz>2002-09-05 11:12:27 +0000
committerMichal Rokos <m.rokos@sh.cvut.cz>2002-09-05 11:12:27 +0000
commitdb66e9a4eb183ab7ac5797733fb85ea965ef46da (patch)
tree67732305f35e749a51cb4ce8d72d687c6c3732db
parent871d3fb297021cba042602e0c3ba0c1573f9da5e (diff)
downloadruby-openssl-history-db66e9a4eb183ab7ac5797733fb85ea965ef46da.tar.gz
clear OpenSSL error in ossl_raise
-rw-r--r--ChangeLog3
-rw-r--r--ossl.c1
-rwxr-xr-xtest/tc_x509cert.rb1
3 files changed, 5 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 763569b..a8098ed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@ ChangeLog for
### CHANGE LOG ###
+Thu, 05 Sep 2002 12:16:10 +0100 -- Michal Rokos <m.rokos@sh.cvut.cz>
+ * ossl.c: clear OpenSSL error in ossl_raise
+
Wed, 04 Sep 2002 11:20:11 +0100 -- Michal Rokos <m.rokos@sh.cvut.cz>
* ossl.c: drop type checking functions, and
* ossl.h: rewrite them as macros to ossl.h
diff --git a/ossl.c b/ossl.c
index f9af31c..6a70ec5 100644
--- a/ossl.c
+++ b/ossl.c
@@ -144,6 +144,7 @@ ossl_raise(VALUE exc, const char *fmt, ...)
} else {
len += snprintf(buf + len, BUFSIZ - len, "%s", ERR_reason_error_string(e));
}
+ ERR_clear_error();
}
rb_exc_raise(rb_exc_new(exc, buf, len));
}
diff --git a/test/tc_x509cert.rb b/test/tc_x509cert.rb
index 62e4a6b..37c2531 100755
--- a/test/tc_x509cert.rb
+++ b/test/tc_x509cert.rb
@@ -142,6 +142,7 @@ class TC_Certificate < Test::Unit::TestCase
def test_12dup
assert_equal($x509.to_text, $x509.dup.to_text, "dup")
assert_equal($x509.to_text, $x509.clone.to_text, "clone")
+## assert_nothing_raised(Certificate::new().dup, "OpenSSL doens't like duplicating not filled X509 *")
end
def tear_down
##