Commit 24e0198e authored by Dmitry Kasatkin's avatar Dmitry Kasatkin Committed by Mimi Zohar

evm: replace hmac_status with evm_status

We will use digital signatures in addtion to hmac.
Signed-off-by: default avatarDmitry Kasatkin <dmitry.kasatkin@nokia.com>
Signed-off-by: default avatarMimi Zohar <zohar@us.ibm.com>
parent 6d38ca01
...@@ -56,8 +56,8 @@ static enum integrity_status evm_verify_hmac(struct dentry *dentry, ...@@ -56,8 +56,8 @@ static enum integrity_status evm_verify_hmac(struct dentry *dentry,
struct evm_ima_xattr_data xattr_data; struct evm_ima_xattr_data xattr_data;
int rc; int rc;
if (iint->hmac_status == INTEGRITY_PASS) if (iint->evm_status == INTEGRITY_PASS)
return iint->hmac_status; return iint->evm_status;
/* if status is not PASS, try to check again - against -ENOMEM */ /* if status is not PASS, try to check again - against -ENOMEM */
...@@ -71,18 +71,18 @@ static enum integrity_status evm_verify_hmac(struct dentry *dentry, ...@@ -71,18 +71,18 @@ static enum integrity_status evm_verify_hmac(struct dentry *dentry,
sizeof xattr_data, GFP_NOFS); sizeof xattr_data, GFP_NOFS);
if (rc < 0) if (rc < 0)
goto err_out; goto err_out;
iint->hmac_status = INTEGRITY_PASS; iint->evm_status = INTEGRITY_PASS;
return iint->hmac_status; return iint->evm_status;
err_out: err_out:
switch (rc) { switch (rc) {
case -ENODATA: /* file not labelled */ case -ENODATA: /* file not labelled */
iint->hmac_status = INTEGRITY_NOLABEL; iint->evm_status = INTEGRITY_NOLABEL;
break; break;
default: default:
iint->hmac_status = INTEGRITY_FAIL; iint->evm_status = INTEGRITY_FAIL;
} }
return iint->hmac_status; return iint->evm_status;
} }
static int evm_protected_xattr(const char *req_xattr_name) static int evm_protected_xattr(const char *req_xattr_name)
......
...@@ -157,7 +157,7 @@ static void init_once(void *foo) ...@@ -157,7 +157,7 @@ static void init_once(void *foo)
iint->version = 0; iint->version = 0;
iint->flags = 0UL; iint->flags = 0UL;
mutex_init(&iint->mutex); mutex_init(&iint->mutex);
iint->hmac_status = INTEGRITY_UNKNOWN; iint->evm_status = INTEGRITY_UNKNOWN;
} }
static int __init integrity_iintcache_init(void) static int __init integrity_iintcache_init(void)
......
...@@ -37,7 +37,7 @@ struct integrity_iint_cache { ...@@ -37,7 +37,7 @@ struct integrity_iint_cache {
unsigned char flags; unsigned char flags;
u8 digest[SHA1_DIGEST_SIZE]; u8 digest[SHA1_DIGEST_SIZE];
struct mutex mutex; /* protects: version, flags, digest */ struct mutex mutex; /* protects: version, flags, digest */
enum integrity_status hmac_status; enum integrity_status evm_status;
}; };
/* rbtree tree calls to lookup, insert, delete /* rbtree tree calls to lookup, insert, delete
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment