[前][次][番号順一覧][スレッド一覧]

ruby-changes:10971

From: yugui <ko1@a...>
Date: Sun, 22 Feb 2009 23:05:26 +0900 (JST)
Subject: [ruby-changes:10971] Ruby:r22549 (ruby_1_9_1): merges r22440 from trunk into ruby_1_9_1.

yugui	2009-02-22 23:05:14 +0900 (Sun, 22 Feb 2009)

  New Revision: 22549

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=22549

  Log:
    merges r22440 from trunk into ruby_1_9_1.
    * ext/openssl/ossl_ocsp.c (ossl_ocspbres_verify): OCSP_basic_verify
      returns positive value on success, not non-zero.  [ruby-core:21762]

  Modified files:
    branches/ruby_1_9_1/ChangeLog
    branches/ruby_1_9_1/ext/openssl/ossl_ocsp.c

Index: ruby_1_9_1/ChangeLog
===================================================================
--- ruby_1_9_1/ChangeLog	(revision 22548)
+++ ruby_1_9_1/ChangeLog	(revision 22549)
@@ -1,3 +1,8 @@
+Thu Feb 19 15:39:50 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* ext/openssl/ossl_ocsp.c (ossl_ocspbres_verify): OCSP_basic_verify
+	  returns positive value on success, not non-zero.  [ruby-core:21762]
+
 Wed Feb 18 12:35:31 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* file.c (rb_file_s_extname): fix for spaces before extention.
Index: ruby_1_9_1/ext/openssl/ossl_ocsp.c
===================================================================
--- ruby_1_9_1/ext/openssl/ossl_ocsp.c	(revision 22548)
+++ ruby_1_9_1/ext/openssl/ossl_ocsp.c	(revision 22549)
@@ -593,22 +593,22 @@
 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;
 }
 
 /*

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]