65 #ifndef NO_SYS_TYPES_H
66 # include <sys/types.h>
68 #ifndef OPENSSL_NO_POSIX_IO
69 # include <sys/stat.h>
98 static
int dir_ctrl(
X509_LOOKUP *ctx,
int cmd, const
char *argp,
long argl,
102 static
int add_cert_dir(
BY_DIR *ctx,const
char *dir,
int type);
107 "Load certs from files in a directory",
124 static int dir_ctrl(
X509_LOOKUP *ctx,
int cmd,
const char *argp,
long argl,
150 ret=add_cert_dir(ld,argp,(
int)argl);
177 static int by_dir_hash_cmp(
const BY_DIR_HASH *
const *a,
180 if ((*a)->hash > (*b)->hash)
182 if ((*a)->hash < (*b)->hash)
208 static int add_cert_dir(
BY_DIR *ctx,
const char *dir,
int type)
211 const char *s,*ss,*
p;
213 if (dir == NULL || !*dir)
229 if (len == 0)
continue;
233 if (strlen(ent->
dir) == (
size_t)len &&
234 strncmp(ent->
dir,ss,(
unsigned int)len) == 0)
239 if (ctx->dirs == NULL)
254 if (!ent->
dir || !ent->hashes)
256 by_dir_entry_free(ent);
259 strncpy(ent->
dir,ss,(
unsigned int)len);
263 by_dir_entry_free(ent);
292 const char *postfix=
"";
294 if (name == NULL)
return(0);
299 data.x509.st_x509.cert_info= &
data.x509.st_x509_cinf;
300 data.x509.st_x509_cinf.subject=name;
306 data.crl.st_crl.crl= &
data.crl.st_crl_info;
307 data.crl.st_crl_info.issuer=name;
332 j=strlen(ent->
dir)+1+8+6+1+1;
363 #ifdef OPENSSL_SYS_VMS
364 c = ent->
dir[strlen(ent->
dir)-1];
365 if (c !=
':' && c !=
'>' && c !=
']')
385 "%s%08lx.%s%d",ent->
dir,h,
391 "%s%c%08lx.%s%d",ent->
dir,c,h,
394 #ifndef OPENSSL_NO_POSIX_IO
400 if (stat(b->
data,&st) < 0)
459 else if (hent->
suffix < k)