Commit 6e2f49b3 authored by Richard Levitte's avatar Richard Levitte
Browse files

Make sure OSSL_STORE_load() isn't caught in an endless loop



The post process callback might potentially say "no" to everything (by
constantly returning NULL) and thereby cause an endless loop.  Ensure
that we stop all processing when "eof" is reached.

Reviewed-by: default avatarPaul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/3823)
parent 50c9ac07
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -90,6 +90,9 @@ OSSL_STORE_INFO *OSSL_STORE_load(OSSL_STORE_CTX *ctx)
    OSSL_STORE_INFO *v = NULL;
    OSSL_STORE_INFO *v = NULL;


 again:
 again:
    if (OSSL_STORE_eof(ctx))
        return NULL;

    v = ctx->loader->load(ctx->loader_ctx, ctx->ui_method, ctx->ui_data);
    v = ctx->loader->load(ctx->loader_ctx, ctx->ui_method, ctx->ui_data);


    if (ctx->post_process != NULL && v != NULL) {
    if (ctx->post_process != NULL && v != NULL) {