Additional comment changes for reformat of 1.0.2
[openssl.git] / crypto / x509 / x509_lu.c
index 3a6e04a1deea41846f36a05dfefd361139ff40b9..de4ed5090e1240179f5fa5198f3b165cb2a58dfb 100644 (file)
@@ -87,7 +87,7 @@ void X509_LOOKUP_free(X509_LOOKUP *ctx)
        if (ctx == NULL) return;
        if (    (ctx->method != NULL) &&
                (ctx->method->free != NULL))
-               ctx->method->free(ctx);
+               (*ctx->method->free)(ctx);
        OPENSSL_free(ctx);
        }
 
@@ -238,6 +238,19 @@ void X509_STORE_free(X509_STORE *vfy)
        if (vfy == NULL)
            return;
 
+       i=CRYPTO_add(&vfy->references,-1,CRYPTO_LOCK_X509_STORE);
+#ifdef REF_PRINT
+       REF_PRINT("X509_STORE",vfy);
+#endif
+       if (i > 0) return;
+#ifdef REF_CHECK
+       if (i < 0)
+               {
+               fprintf(stderr,"X509_STORE_free, bad reference count\n");
+               abort(); /* ok */
+               }
+#endif
+
        sk=vfy->get_cert_methods;
        for (i=0; i<sk_X509_LOOKUP_num(sk); i++)
                {
@@ -320,7 +333,7 @@ int X509_STORE_get_by_subject(X509_STORE_CTX *vs, int type, X509_NAME *name,
                        return 0;
                }
 
-/*     if (ret->data.ptr != NULL)
+/*-    if (ret->data.ptr != NULL)
                X509_OBJECT_free_contents(ret); */
 
        ret->type=tmp->type;
@@ -610,7 +623,8 @@ X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, X509_OBJECT *x
        }
 
 
-/* Try to get issuer certificate from store. Due to limitations
+/*-
+ * Try to get issuer certificate from store. Due to limitations
  * of the API this can only retrieve a single certificate matching
  * a given subject name. However it will fill the cache with all
  * matching certificates, so we can examine the cache for all
@@ -712,5 +726,16 @@ void X509_STORE_set_verify_cb(X509_STORE *ctx,
        ctx->verify_cb = verify_cb;
        }
 
+void X509_STORE_set_lookup_crls_cb(X509_STORE *ctx,
+               STACK_OF(X509_CRL)* (*cb)(X509_STORE_CTX *ctx, X509_NAME *nm))
+       {
+       ctx->lookup_crls = cb;
+       }
+
+X509_STORE *X509_STORE_CTX_get0_store(X509_STORE_CTX *ctx)
+       {
+       return ctx->ctx;
+       }
+
 IMPLEMENT_STACK_OF(X509_LOOKUP)
 IMPLEMENT_STACK_OF(X509_OBJECT)