Cryptodisk write support.

* grub-core/disk/cryptodisk.c (grub_crypto_pcbc_encrypt): New function.
	(grub_cryptodisk_decrypt): Moved logic to ...
	(grub_cryptodisk_endecrypt): ...this. New argument "encrypt".
	(grub_cryptodisk_write): Implement.
	* grub-core/kern/emu/hostdisk.c (nwrite): Rename to ...
	(grub_util_fd_write): ... this. Make global.
	* include/grub/emu/hostdisk.h (grub_util_fd_write): New proto.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-01-29 18:16:48 +01:00
parent 87cf97447e
commit 9c6e84b838
4 changed files with 137 additions and 28 deletions

View file

@ -37,6 +37,7 @@ void grub_util_pull_device (const char *osname);
grub_err_t
grub_util_fd_seek (int fd, const char *name, grub_uint64_t sector);
ssize_t grub_util_fd_read (int fd, char *buf, size_t len);
ssize_t grub_util_fd_write (int fd, const char *buf, size_t len);
grub_err_t
grub_cryptodisk_cheat_mount (const char *sourcedev, const char *cheat);
void grub_util_cryptodisk_print_uuid (grub_disk_t disk);