move ProcessChainBufer out of filesystem only, add configure option for noFilesystem

This commit is contained in:
Todd A Ouska
2011-06-30 10:07:49 -07:00
parent 48c1730997
commit de1be18a7e
2 changed files with 39 additions and 25 deletions

View File

@ -14,7 +14,8 @@ CYASSL_LIBRARY_VERSION=2:1:0
# current:revision:age
# | | |
# | | +- increment if interfaces have been added
# | | set to zero if interfaces have been removed or changed
# | | set to zero if interfaces have been removed
# | or changed
# | +- increment if source code has changed
# | set to zero if current is incremented
# +- increment if interfaces have been added, removed or changed
@ -337,6 +338,19 @@ then
fi
# No Filesystem Build
AC_ARG_ENABLE(noFilesystem,
[ --enable-noFilesystem Enable No Filesystem (default: disabled)],
[ ENABLED_NOFILESYSTEM=$enableval ],
[ ENABLED_NOFILESYSTEM=no ]
)
if test "$ENABLED_NOFILESYSTEM" = "yes"
then
CFLAGS="$CFLAGS -DNO_FILESYSTEM"
fi
# ECC
AC_ARG_ENABLE(ecc,
[ --enable-ecc Enable ECC (default: disabled)],

View File

@ -891,30 +891,6 @@ int AddCA(SSL_CTX* ctx, buffer der)
}
#ifndef NO_FILESYSTEM
#ifndef MICRIUM
#define XFILE FILE
#define XFOPEN fopen
#define XFSEEK fseek
#define XFTELL ftell
#define XREWIND rewind
#define XFREAD fread
#define XFCLOSE fclose
#define XSEEK_END SEEK_END
#else
#include <fs.h>
#define XFILE FS_FILE
#define XFOPEN fs_fopen
#define XFSEEK fs_fseek
#define XFTELL fs_ftell
#define XREWIND fs_rewind
#define XFREAD fs_fread
#define XFCLOSE fs_fclose
#define XSEEK_END FS_SEEK_END
#endif
/* CA PEM file for verification, may have multiple/chain certs to process */
static int ProcessChainBuffer(SSL_CTX* ctx, const unsigned char* buff,
long sz, int format, int type, SSL* ssl)
@ -945,6 +921,30 @@ static int ProcessChainBuffer(SSL_CTX* ctx, const unsigned char* buff,
}
#ifndef NO_FILESYSTEM
#ifndef MICRIUM
#define XFILE FILE
#define XFOPEN fopen
#define XFSEEK fseek
#define XFTELL ftell
#define XREWIND rewind
#define XFREAD fread
#define XFCLOSE fclose
#define XSEEK_END SEEK_END
#else
#include <fs.h>
#define XFILE FS_FILE
#define XFOPEN fs_fopen
#define XFSEEK fs_fseek
#define XFTELL fs_ftell
#define XREWIND fs_rewind
#define XFREAD fs_fread
#define XFCLOSE fs_fclose
#define XSEEK_END FS_SEEK_END
#endif
/* process a file with name fname into ctx of format and type
userChain specifies a user certificate chain to pass during handshake */
static int ProcessFile(SSL_CTX* ctx, const char* fname, int format, int type,