summaryrefslogtreecommitdiff
path: root/ext/openssl
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-10-26 12:06:39 +0000
committergotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-10-26 12:06:39 +0000
commitaa1160ada856883c0bc3ca410efc7a5337bfc401 (patch)
tree91e762e7c67f047f03ff09d95a05010cfbed3832 /ext/openssl
parent6ed0a10eebf11b40cabf17dc8f57018c5fdd6567 (diff)
* ext/openssl/ossl_pkcs7.c (ossl_pkcs7_verify): should clear error.
(fix http://bugs.debian.org/394336) * ext/openssl/ossl_ns_spki.c (ossl_spki_initialize): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl')
-rw-r--r--ext/openssl/ossl_ns_spki.c1
-rw-r--r--ext/openssl/ossl_pkcs7.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/ext/openssl/ossl_ns_spki.c b/ext/openssl/ossl_ns_spki.c
index b90a6b1..66e2837 100644
--- a/ext/openssl/ossl_ns_spki.c
+++ b/ext/openssl/ossl_ns_spki.c
@@ -70,6 +70,7 @@ ossl_spki_initialize(int argc, VALUE *argv, VALUE self)
}
NETSCAPE_SPKI_free(DATA_PTR(self));
DATA_PTR(self) = spki;
+ ERR_clear_error();
return self;
}
diff --git a/ext/openssl/ossl_pkcs7.c b/ext/openssl/ossl_pkcs7.c
index 38a7dce..0fcabd7 100644
--- a/ext/openssl/ossl_pkcs7.c
+++ b/ext/openssl/ossl_pkcs7.c
@@ -667,8 +667,10 @@ ossl_pkcs7_verify(int argc, VALUE *argv, VALUE self)
}
ok = PKCS7_verify(p7, x509s, x509st, in, out, flg);
BIO_free(in);
+ if (ok < 0) ossl_raise(ePKCS7Error, NULL);
msg = ERR_reason_error_string(ERR_get_error());
ossl_pkcs7_set_err_string(self, msg ? rb_str_new2(msg) : Qnil);
+ ERR_clear_error();
data = ossl_membio2str(out);
ossl_pkcs7_set_data(self, data);
sk_X509_pop_free(x509s, X509_free);