summaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/e_loader_attic.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/engines/e_loader_attic.c b/engines/e_loader_attic.c
index faa598f85e..74f297400b 100644
--- a/engines/e_loader_attic.c
+++ b/engines/e_loader_attic.c
@@ -9,6 +9,8 @@
/* THIS ENGINE IS FOR TESTING PURPOSES ONLY. */
+/* This file has quite some overlap with providers/implementations/storemgmt/file_store.c */
+
/* We need to use some engine deprecated APIs */
#define OPENSSL_SUPPRESS_DEPRECATED
@@ -1449,6 +1451,7 @@ static int file_name_to_uri(OSSL_STORE_LOADER_CTX *ctx, const char *name,
static int file_name_check(OSSL_STORE_LOADER_CTX *ctx, const char *name)
{
const char *p = NULL;
+ size_t len = strlen(ctx->_.dir.search_name);
/* If there are no search criteria, all names are accepted */
if (ctx->_.dir.search_name[0] == '\0')
@@ -1463,11 +1466,9 @@ static int file_name_check(OSSL_STORE_LOADER_CTX *ctx, const char *name)
/*
* First, check the basename
*/
- if (strncasecmp(name, ctx->_.dir.search_name,
- sizeof(ctx->_.dir.search_name) - 1) != 0
- || name[sizeof(ctx->_.dir.search_name) - 1] != '.')
+ if (strncasecmp(name, ctx->_.dir.search_name, len) != 0 || name[len] != '.')
return 0;
- p = &name[sizeof(ctx->_.dir.search_name)];
+ p = &name[len + 1];
/*
* Then, if the expected type is a CRL, check that the extension starts