#include <stdio.h>
#include <time.h>
#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include "cryptlib.h"
-#include "lhash.h"
-#include "buffer.h"
-#include "x509.h"
-#include "pem.h"
+#include <openssl/lhash.h>
+#include <openssl/buffer.h>
+#include <openssl/x509.h>
+#include <openssl/pem.h>
#ifndef NO_STDIO
-#ifndef NOPROTO
-static int by_file_ctrl(X509_LOOKUP *ctx,int cmd,char *argc,
- long argl,char **ret);
-#else
-static int by_file_ctrl();
-#endif
-
+static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
+ long argl, char **ret);
X509_LOOKUP_METHOD x509_file_lookup=
{
"Load file into cache",
NULL, /* get_by_alias */
};
-X509_LOOKUP_METHOD *X509_LOOKUP_file()
+X509_LOOKUP_METHOD *X509_LOOKUP_file(void)
{
return(&x509_file_lookup);
}
-static int by_file_ctrl(ctx,cmd,argp,argl,ret)
-X509_LOOKUP *ctx;
-int cmd;
-char *argp;
-long argl;
-char **ret;
+static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl,
+ char **ret)
{
int ok=0,ok2=0;
char *file;
return((ok && ok2)?ok:0);
}
-int X509_load_cert_file(ctx,file,type)
-X509_LOOKUP *ctx;
-const char *file;
-int type;
+int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type)
{
int ret=0;
BIO *in=NULL;
{
for (;;)
{
- x=PEM_read_bio_X509(in,NULL,NULL);
+ x=PEM_read_bio_X509_AUX(in,NULL,NULL,NULL);
if (x == NULL)
{
if ((ERR_GET_REASON(ERR_peek_error()) ==
return(ret);
}
-int X509_load_crl_file(ctx,file,type)
-X509_LOOKUP *ctx;
-const char *file;
-int type;
+int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type)
{
int ret=0;
BIO *in=NULL;
{
for (;;)
{
- x=PEM_read_bio_X509_CRL(in,NULL,NULL);
+ x=PEM_read_bio_X509_CRL(in,NULL,NULL,NULL);
if (x == NULL)
{
if ((ERR_GET_REASON(ERR_peek_error()) ==