ext_openssl_ossl_ocsp.c.diff

lrz (Laurent Sansonetti), 02/18/2009 04:13 am

Download (905 Bytes)

ext/openssl/ossl_ocsp.c 2009-02-17 11:04:57.000000000 -0800
593 593
    OCSP_BASICRESP *bs;
594 594
    STACK_OF(X509) *x509s;
595 595
    X509_STORE *x509st;
596
    int flg, result;
596
    int flg;
597
    VALUE result;
597 598

  
598 599
    rb_scan_args(argc, argv, "21", &certs, &store, &flags);
599 600
    x509st = GetX509StorePtr(store);
600 601
    flg = NIL_P(flags) ? 0 : INT2NUM(flags);
601 602
    x509s = ossl_x509_ary2sk(certs);
602 603
    GetOCSPBasicRes(self, bs);
603
    result = OCSP_basic_verify(bs, x509s, x509st, flg);
604
    result = OCSP_basic_verify(bs, x509s, x509st, flg) <= 0 ? Qfalse : Qtrue;
604 605
    sk_X509_pop_free(x509s, X509_free);
605
    if(!result) rb_warn("%s", ERR_error_string(ERR_peek_error(), NULL));
606
    if(!RTEST(result)) rb_warn("%s", ERR_error_string(ERR_peek_error(), NULL));
606 607

  
607
    return result ? Qtrue : Qfalse;
608
    return result;
608 609
}
609 610

  
610 611
/*