if test "$with_liblzma_libraries" != "no"; then
LDFLAGS="${LDFLAGS} -L${with_liblzma_libraries}"
LIBS="${TMPLIBS} -llzma"
- else
- LIBS="${TMPLIBS} -llzma"
+ else
+ LIBS="${TMPLIBS} -llzma"
fi
fi]),LIBLZMA="no")
if test "$LIBLZMA" != "yes"; then
echo
- echo " Warning! liblzma library not found, you will not be"
- echo " able to decompress flash file compressed with lzma."
+ echo " Error! liblzma library not found."
echo " Debian/Ubuntu: apt install liblzma-dev"
echo " Fedora: dnf install xz-devel"
echo " CentOS/RHEL: yum install xz-devel"
echo
- enable_liblzma=no
- else
- enable_liblzma=yes
- LIBS="${TMPLIBS} -llzma"
+ exit 1
fi
+ enable_liblzma=yes
+ LIBS="${TMPLIBS} -llzma"
#libpcre
AC_ARG_WITH(libpcre_includes,
static int DetectEngineHttpServerBodyFileDataTest24(void)
{
-#ifdef HAVE_LIBLZMA
char input[] = "\
%YAML 1.1\n\
---\n\
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
PASS;
-#else
- PASS;
-#endif /* HAVE_LIBLZMA */
}
static int DetectEngineHttpServerBodyFileDataTest25(void)
static int DetectEngineHttpServerBodyFileDataTest26(void)
{
-#ifdef HAVE_LIBLZMA
char input[] = "\
%YAML 1.1\n\
---\n\
UTHFreePackets(&p1, 1);
UTHFreePackets(&p2, 1);
PASS;
-#else
- PASS;
-#endif /* HAVE_LIBLZMA */
}
static int DetectEngineHttpServerBodyFileDataTest27(void)
} else if ((swf_type == HTTP_SWF_COMPRESSION_LZMA || swf_type == HTTP_SWF_COMPRESSION_BOTH) &&
compression_type == FILE_SWF_LZMA_COMPRESSION)
{
-#ifndef HAVE_LIBLZMA
- goto error;
-#else
/* we need to setup the lzma header */
/*
* | 5 bytes | 8 bytes | n bytes |
out_buffer->buf + 8, out_buffer->len - 8);
if (r == 0)
goto error;
-#endif
} else {
goto error;
}
#include <zlib.h>
-#ifdef HAVE_LIBLZMA
#include <lzma.h>
-#endif
#define MAX_SWF_DECOMPRESSED_LEN 50000000
/*
* | 4 bytes | 4 bytes | 4 bytes | 5 bytes | n bytes | 6 bytes |
* | 'ZWS' + version | script len | compressed len | LZMA props | LZMA data | LZMA end marker |
*/
-#ifdef HAVE_LIBLZMA
int FileSwfLzmaDecompression(DetectEngineThreadCtx *det_ctx,
uint8_t *compressed_data, uint32_t compressed_data_len,
uint8_t *decompressed_data, uint32_t decompressed_data_len)
lzma_end(&strm);
return ret;
}
-#endif /* HAVE_LIBLZMA */
int FileSwfZlibDecompression(DetectEngineThreadCtx *det_ctx,
uint8_t *compressed_data, uint32_t compressed_data_len,
uint8_t *decompressed_data, uint32_t decompressed_data_len);
-#ifdef HAVE_LIBLZMA
int FileSwfLzmaDecompression(DetectEngineThreadCtx *det_ctx,
uint8_t *compressed_data, uint32_t compressed_data_len,
uint8_t *decompressed_data, uint32_t decompressed_data_len);
-#endif
#endif /* __UTIL_FILE_SWF_DECOMPRESSION_H__ */