summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509/by_file.c
diff options
context:
space:
mode:
authorbeck <>1999-09-29 04:37:45 +0000
committerbeck <>1999-09-29 04:37:45 +0000
commitde8f24ea083384bb66b32ec105dc4743c5663cdf (patch)
tree1412176ae62a3cab2cf2b0b92150fcbceaac6092 /src/lib/libcrypto/x509/by_file.c
parentcb929d29896bcb87c2a97417fbd03e50078fc178 (diff)
downloadopenbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.gz
openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.bz2
openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.zip
OpenSSL 0.9.4 merge
Diffstat (limited to 'src/lib/libcrypto/x509/by_file.c')
-rw-r--r--src/lib/libcrypto/x509/by_file.c41
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 73static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
74static int by_file_ctrl(X509_LOOKUP *ctx,int cmd,char *argc, 74 long argl, char **ret);
75 long argl,char **ret);
76#else
77static int by_file_ctrl();
78#endif
79
80X509_LOOKUP_METHOD x509_file_lookup= 75X509_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
94X509_LOOKUP_METHOD *X509_LOOKUP_file() 89X509_LOOKUP_METHOD *X509_LOOKUP_file(void)
95 { 90 {
96 return(&x509_file_lookup); 91 return(&x509_file_lookup);
97 } 92 }
98 93
99static int by_file_ctrl(ctx,cmd,argp,argl,ret) 94static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl,
100X509_LOOKUP *ctx; 95 char **ret)
101int cmd;
102char *argp;
103long argl;
104char **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
141int X509_load_cert_file(ctx,file,type) 132int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type)
142X509_LOOKUP *ctx;
143char *file;
144int 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
211int X509_load_crl_file(ctx,file,type) 199int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type)
212X509_LOOKUP *ctx;
213char *file;
214int 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()) ==