* ext/openssl/ossl_ocsp.c (ossl_ocspbres_verify): OCSP_basic_verify
returns positive value on success, not non-zero. [ruby-core:21762] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a285f8565d
commit
3e1394f36f
@ -1,3 +1,8 @@
|
|||||||
|
Thu Feb 19 15:39:50 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/openssl/ossl_ocsp.c (ossl_ocspbres_verify): OCSP_basic_verify
|
||||||
|
returns positive value on success, not non-zero. [ruby-core:21762]
|
||||||
|
|
||||||
Thu Feb 19 15:17:00 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Thu Feb 19 15:17:00 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* lib/tmpdir.rb (@@systmpdir): File.expand_path also joins paths.
|
* lib/tmpdir.rb (@@systmpdir): File.expand_path also joins paths.
|
||||||
|
@ -593,22 +593,22 @@ ossl_ocspbres_sign(int argc, VALUE *argv, VALUE self)
|
|||||||
static VALUE
|
static VALUE
|
||||||
ossl_ocspbres_verify(int argc, VALUE *argv, VALUE self)
|
ossl_ocspbres_verify(int argc, VALUE *argv, VALUE self)
|
||||||
{
|
{
|
||||||
VALUE certs, store, flags;
|
VALUE certs, store, flags, result;
|
||||||
OCSP_BASICRESP *bs;
|
OCSP_BASICRESP *bs;
|
||||||
STACK_OF(X509) *x509s;
|
STACK_OF(X509) *x509s;
|
||||||
X509_STORE *x509st;
|
X509_STORE *x509st;
|
||||||
int flg, result;
|
int flg;
|
||||||
|
|
||||||
rb_scan_args(argc, argv, "21", &certs, &store, &flags);
|
rb_scan_args(argc, argv, "21", &certs, &store, &flags);
|
||||||
x509st = GetX509StorePtr(store);
|
x509st = GetX509StorePtr(store);
|
||||||
flg = NIL_P(flags) ? 0 : INT2NUM(flags);
|
flg = NIL_P(flags) ? 0 : INT2NUM(flags);
|
||||||
x509s = ossl_x509_ary2sk(certs);
|
x509s = ossl_x509_ary2sk(certs);
|
||||||
GetOCSPBasicRes(self, bs);
|
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);
|
sk_X509_pop_free(x509s, X509_free);
|
||||||
if(!result) rb_warn("%s", ERR_error_string(ERR_peek_error(), NULL));
|
if(!result) rb_warn("%s", ERR_error_string(ERR_peek_error(), NULL));
|
||||||
|
|
||||||
return result ? Qtrue : Qfalse;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user