indent has problems with comments that are on the right hand side of a line.
[oweals/openssl.git] / crypto / ocsp / ocsp_vfy.c
index 8a5e788d960fb4cadff36c352ad9c12cdf30dddb..fc0d4cc0f5f785f688a1242ab12c9202532d298b 100644 (file)
@@ -91,9 +91,12 @@ int OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs,
                {
                EVP_PKEY *skey;
                skey = X509_get_pubkey(signer);
-               ret = OCSP_BASICRESP_verify(bs, skey, 0);
-               EVP_PKEY_free(skey);
-               if(ret <= 0)
+               if (skey)
+                       {
+                       ret = OCSP_BASICRESP_verify(bs, skey, 0);
+                       EVP_PKEY_free(skey);
+                       }
+               if(!skey || ret <= 0)
                        {
                        OCSPerr(OCSP_F_OCSP_BASIC_VERIFY, OCSP_R_SIGNATURE_FAILURE);
                        goto end;
@@ -433,8 +436,11 @@ static int ocsp_req_find_signer(X509 **psigner, OCSP_REQUEST *req, X509_NAME *nm
        if(!(flags & OCSP_NOINTERN))
                {
                signer = X509_find_by_subject(req->optionalSignature->certs, nm);
-               *psigner = signer;
-               return 1;
+               if (signer)
+                       {
+                       *psigner = signer;
+                       return 1;
+                       }
                }
 
        signer = X509_find_by_subject(certs, nm);