Process LUKS keyslots in userspace through kernel crypto wrapper.

This allow LUKS handling without requiring root privilege.

The dmcrypt device-mapper is used only for device activation now.
This commit is contained in:
Milan Broz
2014-06-01 21:34:21 +02:00
parent 6d4c2db3b1
commit a3c0f6784b
4 changed files with 370 additions and 5 deletions

View File

@@ -28,6 +28,7 @@ struct crypt_device;
struct crypt_hash;
struct crypt_hmac;
struct crypt_cipher;
struct crypt_storage;
int crypt_backend_init(struct crypt_device *ctx);
@@ -91,4 +92,14 @@ int crypt_cipher_decrypt(struct crypt_cipher *ctx,
const char *in, char *out, size_t length,
const char *iv, size_t iv_length);
/* storage encryption wrappers */
int crypt_storage_init(struct crypt_storage **ctx, uint64_t sector_start,
const char *cipher, const char *cipher_mode,
char *key, size_t key_length);
int crypt_storage_destroy(struct crypt_storage *ctx);
int crypt_storage_decrypt(struct crypt_storage *ctx, uint64_t sector,
size_t count, char *buffer);
int crypt_storage_encrypt(struct crypt_storage *ctx, uint64_t sector,
size_t count, char *buffer);
#endif /* _CRYPTO_BACKEND_H */