summaryrefslogtreecommitdiffstats
path: root/test/ossl_store_test.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2021-06-22 07:28:26 +0200
committerRichard Levitte <levitte@openssl.org>2021-06-26 06:43:08 +0200
commit511fb47264df8333a5e2096fb5ef49436a965a63 (patch)
tree27d5d7f28d5704b897e71021f6ec11ab71ea8bd5 /test/ossl_store_test.c
parentUTF-8 not easily supported on VMS command line yet (diff)
downloadopenssl-511fb47264df8333a5e2096fb5ef49436a965a63.tar.xz
openssl-511fb47264df8333a5e2096fb5ef49436a965a63.zip
test/ossl_store_test.c: Adapt the use of datadir for VMS paths
Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15823)
Diffstat (limited to 'test/ossl_store_test.c')
-rw-r--r--test/ossl_store_test.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/ossl_store_test.c b/test/ossl_store_test.c
index b9135cfcb3..b45d1d548f 100644
--- a/test/ossl_store_test.c
+++ b/test/ossl_store_test.c
@@ -7,6 +7,7 @@
* https://www.openssl.org/source/license.html
*/
+#include <string.h>
#include <limits.h>
#include <openssl/store.h>
#include <openssl/ui.h>
@@ -101,6 +102,7 @@ static int get_params(const char *uri, const char *type)
static int test_store_get_params(int idx)
{
const char *type;
+ const char *urifmt;
char uri[PATH_MAX];
switch(idx) {
@@ -128,8 +130,16 @@ static int test_store_get_params(int idx)
return 0;
}
- if (!TEST_true(BIO_snprintf(uri, sizeof(uri), "%s/%s-params.pem",
- datadir, type)))
+ urifmt = "%s/%s-params.pem";
+#ifdef __VMS
+ {
+ char datadir_end = datadir[strlen(datadir) - 1];
+
+ if (datadir_end == ':' || datadir_end == ']' || datadir_end == '>')
+ urifmt = "%s%s-params.pem";
+ }
+#endif
+ if (!TEST_true(BIO_snprintf(uri, sizeof(uri), urifmt, datadir, type)))
return 0;
TEST_info("Testing uri: %s", uri);