diff options
Diffstat (limited to 'src/lib/libcrypto/x509/by_file.c')
-rw-r--r-- | src/lib/libcrypto/x509/by_file.c | 41 |
1 files changed, 13 insertions, 28 deletions
diff --git a/src/lib/libcrypto/x509/by_file.c b/src/lib/libcrypto/x509/by_file.c index 09ebb9bf08..00ee5e8bbc 100644 --- a/src/lib/libcrypto/x509/by_file.c +++ b/src/lib/libcrypto/x509/by_file.c | |||
@@ -63,20 +63,15 @@ | |||
63 | #include <sys/stat.h> | 63 | #include <sys/stat.h> |
64 | 64 | ||
65 | #include "cryptlib.h" | 65 | #include "cryptlib.h" |
66 | #include "lhash.h" | 66 | #include <openssl/lhash.h> |
67 | #include "buffer.h" | 67 | #include <openssl/buffer.h> |
68 | #include "x509.h" | 68 | #include <openssl/x509.h> |
69 | #include "pem.h" | 69 | #include <openssl/pem.h> |
70 | 70 | ||
71 | #ifndef NO_STDIO | 71 | #ifndef NO_STDIO |
72 | 72 | ||
73 | #ifndef NOPROTO | 73 | static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, |
74 | static int by_file_ctrl(X509_LOOKUP *ctx,int cmd,char *argc, | 74 | long argl, char **ret); |
75 | long argl,char **ret); | ||
76 | #else | ||
77 | static int by_file_ctrl(); | ||
78 | #endif | ||
79 | |||
80 | X509_LOOKUP_METHOD x509_file_lookup= | 75 | X509_LOOKUP_METHOD x509_file_lookup= |
81 | { | 76 | { |
82 | "Load file into cache", | 77 | "Load file into cache", |
@@ -91,17 +86,13 @@ X509_LOOKUP_METHOD x509_file_lookup= | |||
91 | NULL, /* get_by_alias */ | 86 | NULL, /* get_by_alias */ |
92 | }; | 87 | }; |
93 | 88 | ||
94 | X509_LOOKUP_METHOD *X509_LOOKUP_file() | 89 | X509_LOOKUP_METHOD *X509_LOOKUP_file(void) |
95 | { | 90 | { |
96 | return(&x509_file_lookup); | 91 | return(&x509_file_lookup); |
97 | } | 92 | } |
98 | 93 | ||
99 | static int by_file_ctrl(ctx,cmd,argp,argl,ret) | 94 | static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl, |
100 | X509_LOOKUP *ctx; | 95 | char **ret) |
101 | int cmd; | ||
102 | char *argp; | ||
103 | long argl; | ||
104 | char **ret; | ||
105 | { | 96 | { |
106 | int ok=0,ok2=0; | 97 | int ok=0,ok2=0; |
107 | char *file; | 98 | char *file; |
@@ -138,10 +129,7 @@ char **ret; | |||
138 | return((ok && ok2)?ok:0); | 129 | return((ok && ok2)?ok:0); |
139 | } | 130 | } |
140 | 131 | ||
141 | int X509_load_cert_file(ctx,file,type) | 132 | int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type) |
142 | X509_LOOKUP *ctx; | ||
143 | char *file; | ||
144 | int type; | ||
145 | { | 133 | { |
146 | int ret=0; | 134 | int ret=0; |
147 | BIO *in=NULL; | 135 | BIO *in=NULL; |
@@ -161,7 +149,7 @@ int type; | |||
161 | { | 149 | { |
162 | for (;;) | 150 | for (;;) |
163 | { | 151 | { |
164 | x=PEM_read_bio_X509(in,NULL,NULL); | 152 | x=PEM_read_bio_X509(in,NULL,NULL,NULL); |
165 | if (x == NULL) | 153 | if (x == NULL) |
166 | { | 154 | { |
167 | if ((ERR_GET_REASON(ERR_peek_error()) == | 155 | if ((ERR_GET_REASON(ERR_peek_error()) == |
@@ -208,10 +196,7 @@ err: | |||
208 | return(ret); | 196 | return(ret); |
209 | } | 197 | } |
210 | 198 | ||
211 | int X509_load_crl_file(ctx,file,type) | 199 | int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type) |
212 | X509_LOOKUP *ctx; | ||
213 | char *file; | ||
214 | int type; | ||
215 | { | 200 | { |
216 | int ret=0; | 201 | int ret=0; |
217 | BIO *in=NULL; | 202 | BIO *in=NULL; |
@@ -231,7 +216,7 @@ int type; | |||
231 | { | 216 | { |
232 | for (;;) | 217 | for (;;) |
233 | { | 218 | { |
234 | x=PEM_read_bio_X509_CRL(in,NULL,NULL); | 219 | x=PEM_read_bio_X509_CRL(in,NULL,NULL,NULL); |
235 | if (x == NULL) | 220 | if (x == NULL) |
236 | { | 221 | { |
237 | if ((ERR_GET_REASON(ERR_peek_error()) == | 222 | if ((ERR_GET_REASON(ERR_peek_error()) == |