Commit Graph

13 Commits

Author SHA1 Message Date
Vladimir 'phcoder' Serbinenko e837738991 * grub-core/lib/xzembed/xz_dec_stream.c (hash_validate): Use void *
for context.
2012-02-29 14:56:51 +01:00
Vladimir 'phcoder' Serbinenko 84f9d341b0 * grub-core/fs/affs.c (grub_affs_read_block): Avoid <= in loop
condition to avoid possibly infinite loops.
	* grub-core/lib/pbkdf2.c (grub_crypto_pbkdf2): Likewise.
	* grub-core/lib/xzembed/xz_dec_bcj.c (bcj_powerpc): Likewise.
2012-02-22 05:22:39 +01:00
Vladimir 'phcoder' Serbinenko 7816a17ed1 * grub-core/normal/crypto.c (grub_crypto_autoload): Prevent
infinite recursion using counter.
	* grub-core/lib/xzembed/xz_dec_stream.c (xz_dec_init): Defer s->crc32
	init to skip it if the magic check fails.
	(dec_stream_header): Init s->crc32.
2012-01-23 03:39:37 +01:00
Vladimir 'phcoder' Serbinenko 3ec0fc1c3b Make XZ compression parameters dependent on target and not host CPU.
* configure.ac: Define GRUB_TARGET_CPU_XYZ series.
	* grub-core/lib/xzembed/xz_config.h: Use GRUB_TARGET_CPU_XYZ.
2012-01-18 13:59:03 +01:00
Vladimir 'phcoder' Serbinenko c029da8a89 Various squash4 fixes and LZO and XZ support.
* Makefile.util.def (libgrubmods.a): Add xzembed directory to cppflags.
	Add xzembed source files.
	* grub-core/Makefile.core.def (squash4): Add xzembed and minilzo flags.
	* grub-core/fs/squash4.c (grub_squash_super): New field compression.
	(grub_squash_inode): New subtype long_dir.
	(SQUASH_TYPE_LONG_DIR): New inode type.
	(COMPRESSION): New enum.
	(XZBUFSIZ): New const.
	(grub_squash_data): New fields blksz, decompress, xzdec, xzbuf.
	(read_chunk): Use data->decompress.
	(zlib_decompress): New function.
	(lzo_decompress): Likewise.
	(xz_decompress): Likewise.
	(squash_mount): Set new data fields.
	(grub_squash_iterate_dir): Handle long dir.
	(squash_unmount): Free xzdec and xzbuf.
	(grub_squash_open): Check ino type.
	(direct_read): Stylistic fixes. Use data->decompress.
	(grub_squash_read_data): Likewise.
	* grub-core/io/gzio.c (grub_gzio): Remove disk_input.
	(get_byte): Likewise.
	(grub_zlib_disk_read): Removed.
	* grub-core/lib/posix_wrap/sys/types.h (ssize_t): New type.
	(GRUB_POSIX_BOOL_DEFINED): New define.
	* grub-core/lib/posix_wrap/unistd.h: Include sys/types.h.
	* grub-core/lib/xzembed/xz.h: Addmissing includes.
	[!GRUB_POSIX_BOOL_DEFINED]: Define bool.
	* include/grub/deflate.h (grub_zlib_disk_read): Removed.
2011-12-26 13:18:01 +01:00
Vladimir 'phcoder' Serbinenko f7ce5bafb5 Fix mips compilation.
* grub-core/lib/xzembed/xz_dec_stream.c (xz_dec): Restrict hash_id to
	normal decoder.
	(hashes): Use in embed decoder as well (for sizes).
	(dec_stream_header): Fix embed decompressor logic.
	(dec_stream_footer): Likewise.
2011-11-11 18:30:34 +01:00
Vladimir 'phcoder' Serbinenko 158dc1ea26 XZ CRC64 and SHA256 support.
* Makefile.util.def (libgrubmods): Add crc64.c.
	* grub-core/Makefile.core.def (crc64): New module.
	* grub-core/lib/crc64.c: New file.
	* grub-core/lib/xzembed/xz_dec_stream.c (xz_dec_hash)
	[!GRUB_EMBED_DECOMPRESSOR]: Rename crc32_context to hash_context.
	Fix the type.
	(MAX_HASH_SIZE): New define.
	(xz_dec) [!GRUB_EMBED_DECOMPRESSOR]: Add generic hash fields.
	(dec_block) [!GRUB_EMBED_DECOMPRESSOR]: Handle non-crc32 hashes.
	(index_update) [!GRUB_EMBED_DECOMPRESSOR]: Likewise.
	(dec_index) [!GRUB_EMBED_DECOMPRESSOR]: Likewise.
	(crc32_validate) [!GRUB_EMBED_DECOMPRESSOR]: Rename to ...
	(hash_validate) [!GRUB_EMBED_DECOMPRESSOR]: ... this.
	Handle non-crc32 hashes.
	(hashes) [!GRUB_EMBED_DECOMPRESSOR]: New variable.
	(dec_stream_header): Handle non-crc32 hashes.
	(dec_stream_footer): Likewise.
	(dec_block_header): Likewise.
	(dec_main): Likewise.
	(xz_dec_init): Likewise.
	(xz_dec_reset): Likewise.
	(xz_dec_end): Likewise.
	* util/import_gcry.py: Add CRC64 line.
2011-11-03 15:13:30 +01:00
Vladimir 'phcoder' Serbinenko e0a8ef26e4 MAke a separate scratch for decompressor 2010-09-21 19:39:51 +02:00
Vladimir 'phcoder' Serbinenko f8926c32b4 C part of decompressor 2010-09-21 11:22:52 +02:00
Szymon Janc 014f47b74f * grub-core/lib/xzembed/xz_dec_stream.c (dec_main): Fix index and block
CRC calculations and validity checks.
	* grub-core/lib/xzembed/xz_dec_stream.c (dec_index): Fix index CRC
	calculations.
2010-09-15 00:39:49 +02:00
Szymon Janc dd521a4afb * grub-core/lib/xzembed/xz_dec_stream.c (xz_dec_end): Fix memory leak. 2010-09-15 00:13:09 +02:00
Vladimir 'phcoder' Serbinenko 788f1f3a85 * grub-core/lib/xzembed/xz_dec_stream.c (xz_dec_reset): Preserve context
pointer.
2010-09-12 13:50:24 +02:00
Szymon Janc f0aff67c47 * grub-core/Makefile.core.def (xzio): New module.
* grub-core/io/xzio.c: New file.
	* grub-core/lib/xzembed/xz.h: New file (from xembed).
	* grub-core/lib/xzembed/xz_config.h: Likewise.
	* grub-core/lib/xzembed/xz_dec_bcj.c: Likewise.
	* grub-core/lib/xzembed/xz_dec_lzma2.c: Likewise.
	* grub-core/lib/xzembed/xz_dec_stream.c: Likewise.
	* grub-core/lib/xzembed/xz_lzma2.h: Likewise.
	* grub-core/lib/xzembed/xz_private.h: Likewise.
	* grub-core/lib/xzembed/xz_stream.h: Likewise.
	* include/grub/file.h (grub_file_filter_id): New compression filter
	GRUB_FILE_FILTER_XZIO.
2010-09-05 17:12:13 +02:00