summaryrefslogtreecommitdiffstats
path: root/engines
diff options
context:
space:
mode:
authorTomas Mraz <tmraz@fedoraproject.org>2020-11-03 18:15:46 +0100
committerTomas Mraz <tmraz@fedoraproject.org>2020-11-11 16:05:56 +0100
commit69d16b70cf84f0e290990de424274fde20420b78 (patch)
tree8ef65500fdd8d76dce2809277fcf59f80bb0141c /engines
parenttest/recipes/30-test_evp_libctx.t: use fips-and-base.cnf (diff)
downloadopenssl-69d16b70cf84f0e290990de424274fde20420b78.tar.xz
openssl-69d16b70cf84f0e290990de424274fde20420b78.zip
Avoid duplicate ends_with_dirsep functions
Refactor them into inline ossl_ends_with_dirsep function in internal/cryptlib.h. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13306)
Diffstat (limited to 'engines')
-rw-r--r--engines/e_loader_attic.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/engines/e_loader_attic.c b/engines/e_loader_attic.c
index 4f238b9cb2..176c159c8c 100644
--- a/engines/e_loader_attic.c
+++ b/engines/e_loader_attic.c
@@ -1424,27 +1424,13 @@ static int file_read_asn1(BIO *bp, unsigned char **data, long *len)
return 1;
}
-static int ends_with_dirsep(const char *uri)
-{
- if (*uri != '\0')
- uri += strlen(uri) - 1;
-#if defined(__VMS)
- if (*uri == ']' || *uri == '>' || *uri == ':')
- return 1;
-#elif defined(_WIN32)
- if (*uri == '\\')
- return 1;
-#endif
- return *uri == '/';
-}
-
static int file_name_to_uri(OSSL_STORE_LOADER_CTX *ctx, const char *name,
char **data)
{
assert(name != NULL);
assert(data != NULL);
{
- const char *pathsep = ends_with_dirsep(ctx->uri) ? "" : "/";
+ const char *pathsep = ossl_ends_with_dirsep(ctx->uri) ? "" : "/";
long calculated_length = strlen(ctx->uri) + strlen(pathsep)
+ strlen(name) + 1 /* \0 */;