summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-26 05:32:02 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-26 05:32:02 +0000
commit151527ceca919e8b56af7b729fd89bc317799016 (patch)
tree04f2209cd85b44923b56970ca51f3a6de24c96bf
parent1663e2d3031fe9b232534827d4defa5a7c255860 (diff)
* ext/openssl/ossl_ocsp.c (ossl_ocspbres_verify): OCSP_basic_verify
returns positive value on success, not non-zero. [ruby-core:21762] backported r22440 from trunk. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@22646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--ext/openssl/ossl_ocsp.c8
2 files changed, 10 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 058064ea98..ede5c89065 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Feb 26 14:31:27 2009 Shugo Maeda <[email protected]>
+
+ * ext/openssl/ossl_ocsp.c (ossl_ocspbres_verify): OCSP_basic_verify
+ returns positive value on success, not non-zero. [ruby-core:21762]
+ backported r22440 from trunk.
+
Thu Feb 26 12:36:36 2009 Akinori MUSHA <[email protected]>
* lib/generator.rb: Remove next() before overriding it to avoid a
diff --git a/ext/openssl/ossl_ocsp.c b/ext/openssl/ossl_ocsp.c
index 07a97d82c9..a658c0180a 100644
--- a/ext/openssl/ossl_ocsp.c
+++ b/ext/openssl/ossl_ocsp.c
@@ -593,22 +593,22 @@ ossl_ocspbres_sign(int argc, VALUE *argv, VALUE self)
static VALUE
ossl_ocspbres_verify(int argc, VALUE *argv, VALUE self)
{
- VALUE certs, store, flags;
+ VALUE certs, store, flags, result;
OCSP_BASICRESP *bs;
STACK_OF(X509) *x509s;
X509_STORE *x509st;
- int flg, result;
+ int flg;
rb_scan_args(argc, argv, "21", &certs, &store, &flags);
x509st = GetX509StorePtr(store);
flg = NIL_P(flags) ? 0 : INT2NUM(flags);
x509s = ossl_x509_ary2sk(certs);
GetOCSPBasicRes(self, bs);
- result = OCSP_basic_verify(bs, x509s, x509st, flg);
+ result = OCSP_basic_verify(bs, x509s, x509st, flg) > 0 ? Qtrue : Qfalse;
sk_X509_pop_free(x509s, X509_free);
if(!result) rb_warn("%s", ERR_error_string(ERR_peek_error(), NULL));
- return result ? Qtrue : Qfalse;
+ return result;
}
/*