diff --git a/configure.in b/configure.in index c2f837b8a..7e6a0d058 100644 --- a/configure.in +++ b/configure.in @@ -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)], diff --git a/src/ssl.c b/src/ssl.c index 8db1f3150..5766b814d 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -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 - #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 + #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,