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.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/lib/libcrypto/x509/by_dir.c b/src/lib/libcrypto/x509/by_dir.c
index 734e39ac77..14d12c56bd 100644
--- a/src/lib/libcrypto/x509/by_dir.c
+++ b/src/lib/libcrypto/x509/by_dir.c
@@ -59,10 +59,18 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <time.h> 60#include <time.h>
61#include <errno.h> 61#include <errno.h>
62#include <sys/types.h>
63#include <sys/stat.h>
64 62
65#include "cryptlib.h" 63#include "cryptlib.h"
64
65#ifndef NO_SYS_TYPES_H
66# include <sys/types.h>
67#endif
68#ifdef MAC_OS_pre_X
69# include <stat.h>
70#else
71# include <sys/stat.h>
72#endif
73
66#include <openssl/lhash.h> 74#include <openssl/lhash.h>
67#include <openssl/x509.h> 75#include <openssl/x509.h>
68 76
@@ -210,9 +218,9 @@ static int add_cert_dir(BY_DIR *ctx, const char *dir, int type)
210 memcpy(ip,ctx->dirs_type,(ctx->num_dirs_alloced-10)* 218 memcpy(ip,ctx->dirs_type,(ctx->num_dirs_alloced-10)*
211 sizeof(int)); 219 sizeof(int));
212 if (ctx->dirs != NULL) 220 if (ctx->dirs != NULL)
213 Free((char *)ctx->dirs); 221 Free(ctx->dirs);
214 if (ctx->dirs_type != NULL) 222 if (ctx->dirs_type != NULL)
215 Free((char *)ctx->dirs_type); 223 Free(ctx->dirs_type);
216 ctx->dirs=pp; 224 ctx->dirs=pp;
217 ctx->dirs_type=ip; 225 ctx->dirs_type=ip;
218 } 226 }
@@ -318,8 +326,7 @@ static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
318 /* we have added it to the cache so now pull 326 /* we have added it to the cache so now pull
319 * it out again */ 327 * it out again */
320 CRYPTO_r_lock(CRYPTO_LOCK_X509_STORE); 328 CRYPTO_r_lock(CRYPTO_LOCK_X509_STORE);
321 tmp=(X509_OBJECT *)lh_retrieve(xl->store_ctx->certs, 329 tmp=(X509_OBJECT *)lh_retrieve(xl->store_ctx->certs,&stmp);
322 (char *)&stmp);
323 CRYPTO_r_unlock(CRYPTO_LOCK_X509_STORE); 330 CRYPTO_r_unlock(CRYPTO_LOCK_X509_STORE);
324 331
325 if (tmp != NULL) 332 if (tmp != NULL)