diff --git a/lib/integrity/integrity.c b/lib/integrity/integrity.c index 68a8cd3d..8acce73e 100644 --- a/lib/integrity/integrity.c +++ b/lib/integrity/integrity.c @@ -114,6 +114,8 @@ int INTEGRITY_key_size(struct crypt_device *cd, const char *integrity) //FIXME: use crypto backend hash size if (!strcmp(integrity, "aead")) return 0; + else if (!strcmp(integrity, "hmac(sha1)")) + return 20; else if (!strcmp(integrity, "hmac(sha256)")) return 32; else if (!strcmp(integrity, "hmac(sha512)")) @@ -143,6 +145,8 @@ int INTEGRITY_tag_size(struct crypt_device *cd, iv_tag_size = 8; else if (!strcmp(cipher_mode, "ctr-random")) iv_tag_size = 16; + else if (!strcmp(cipher, "aegis256") && !strcmp(cipher_mode, "random")) + iv_tag_size = 32; else if (!strcmp(cipher_mode, "random")) iv_tag_size = 16; @@ -153,6 +157,8 @@ int INTEGRITY_tag_size(struct crypt_device *cd, auth_tag_size = 16; //FIXME gcm- mode only else if (!strcmp(integrity, "cmac(aes)")) auth_tag_size = 16; + else if (!strcmp(integrity, "hmac(sha1)")) + auth_tag_size = 20; else if (!strcmp(integrity, "hmac(sha256)")) auth_tag_size = 32; else if (!strcmp(integrity, "hmac(sha512)")) diff --git a/lib/utils_crypt.c b/lib/utils_crypt.c index 2fb34806..d49fee8b 100644 --- a/lib/utils_crypt.c +++ b/lib/utils_crypt.c @@ -105,6 +105,9 @@ int crypt_parse_integrity_mode(const char *s, char *integrity, !strcmp(s, "none")) { strncpy(integrity, s, MAX_CIPHER_LEN); ks = 0; + } else if (!strcmp(s, "hmac-sha1")) { + strncpy(integrity, "hmac(sha1)", MAX_CIPHER_LEN); + ks = 20; } else if (!strcmp(s, "hmac-sha256")) { strncpy(integrity, "hmac(sha256)", MAX_CIPHER_LEN); ks = 32;