summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509/by_dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/x509/by_dir.c')
-rw-r--r--src/lib/libcrypto/x509/by_dir.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/by_dir.c b/src/lib/libcrypto/x509/by_dir.c
index a5c306f1fd..6207340472 100644
--- a/src/lib/libcrypto/x509/by_dir.c
+++ b/src/lib/libcrypto/x509/by_dir.c
@@ -302,8 +302,38 @@ static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
302 k=0; 302 k=0;
303 for (;;) 303 for (;;)
304 { 304 {
305 snprintf(b->data,b->max,"%s/%08lx.%s%d",ctx->dirs[i],h, 305 char c = '/';
306 postfix,k); 306#ifdef OPENSSL_SYS_VMS
307 c = ctx->dirs[i][strlen(ctx->dirs[i])-1];
308 if (c != ':' && c != '>' && c != ']')
309 {
310 /* If no separator is present, we assume the
311 directory specifier is a logical name, and
312 add a colon. We really should use better
313 VMS routines for merging things like this,
314 but this will do for now...
315 -- Richard Levitte */
316 c = ':';
317 }
318 else
319 {
320 c = '\0';
321 }
322#endif
323 if (c == '\0')
324 {
325 /* This is special. When c == '\0', no
326 directory separator should be added. */
327 BIO_snprintf(b->data,b->max,
328 "%s%08lx.%s%d",ctx->dirs[i],h,
329 postfix,k);
330 }
331 else
332 {
333 BIO_snprintf(b->data,b->max,
334 "%s%c%08lx.%s%d",ctx->dirs[i],c,h,
335 postfix,k);
336 }
307 k++; 337 k++;
308 if (stat(b->data,&st) < 0) 338 if (stat(b->data,&st) < 0)
309 break; 339 break;