diff options
author | NingSun <ning.sun@intel.com> | 2018-03-27 10:42:51 -0700 |
---|---|---|
committer | NingSun <ning.sun@intel.com> | 2018-03-28 16:03:21 -0700 |
commit | 8a5b33a9ba846d785d244e29bc29a46f7be34928 (patch) | |
tree | a5b6ad7d3950a57fefd60dd1200c4ce52dd959b5 /TPM2-Plugin/lib/tpm2_attr_util.c | |
parent | da00ff6db5e68773996ec79d711c45fb3444c580 (diff) |
Add more codes in tpm2-plugin
Implement tpm2_plugin_load_key() and tpm2_plugin_rsa_sign() APIs
Issue-ID: AAF-94
Change-Id: I5f4329fdf973e52264d9e0e8aabc864c5fbdeebf
Signed-off-by: NingSun <ning.sun@intel.com>
Diffstat (limited to 'TPM2-Plugin/lib/tpm2_attr_util.c')
-rw-r--r-- | TPM2-Plugin/lib/tpm2_attr_util.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/TPM2-Plugin/lib/tpm2_attr_util.c b/TPM2-Plugin/lib/tpm2_attr_util.c index 03ce2d5..b21141d 100644 --- a/TPM2-Plugin/lib/tpm2_attr_util.c +++ b/TPM2-Plugin/lib/tpm2_attr_util.c @@ -32,7 +32,7 @@ #include <stdlib.h> #include <string.h> -#include <sapi/tpm20.h> +#include <tss2/tss2_sys.h> #include "log.h" #include "tpm2_attr_util.h" @@ -66,147 +66,147 @@ struct dispatch_table { static bool authread(TPMA_NV *nv, char *arg) { UNUSED(arg); - *nv |= TPMA_NV_TPMA_NV_AUTHREAD; + *nv |= TPMA_NV_AUTHREAD; return true; } static bool authwrite(TPMA_NV *nv, char *arg) { UNUSED(arg); - *nv |= TPMA_NV_TPMA_NV_AUTHWRITE; + *nv |= TPMA_NV_AUTHWRITE; return true; } static bool clear_stclear(TPMA_NV *nv, char *arg) { UNUSED(arg); - *nv |= TPMA_NV_TPMA_NV_CLEAR_STCLEAR; + *nv |= TPMA_NV_CLEAR_STCLEAR; return true; } static bool globallock(TPMA_NV *nv, char *arg) { UNUSED(arg); - *nv |= TPMA_NV_TPMA_NV_GLOBALLOCK; + *nv |= TPMA_NV_GLOBALLOCK; return true; } static bool no_da(TPMA_NV *nv, char *arg) { UNUSED(arg); - *nv |= TPMA_NV_TPMA_NV_NO_DA; + *nv |= TPMA_NV_NO_DA; return true; } static bool orderly(TPMA_NV *nv, char *arg) { UNUSED(arg); - *nv |= TPMA_NV_TPMA_NV_ORDERLY; + *nv |= TPMA_NV_ORDERLY; return true; } static bool ownerread(TPMA_NV *nv, char *arg) { UNUSED(arg); - *nv |= TPMA_NV_TPMA_NV_OWNERREAD; + *nv |= TPMA_NV_OWNERREAD; return true; } static bool ownerwrite(TPMA_NV *nv, char *arg) { UNUSED(arg); - *nv |= TPMA_NV_TPMA_NV_OWNERWRITE; + *nv |= TPMA_NV_OWNERWRITE; return true; } static bool platformcreate(TPMA_NV *nv, char *arg) { UNUSED(arg); - *nv |= TPMA_NV_TPMA_NV_PLATFORMCREATE; + *nv |= TPMA_NV_PLATFORMCREATE; return true; } static bool policyread(TPMA_NV *nv, char *arg) { UNUSED(arg); - *nv |= TPMA_NV_TPMA_NV_POLICYREAD; + *nv |= TPMA_NV_POLICYREAD; return true; } static bool policywrite(TPMA_NV *nv, char *arg) { UNUSED(arg); - *nv |= TPMA_NV_TPMA_NV_POLICYWRITE; + *nv |= TPMA_NV_POLICYWRITE; return true; } static bool policydelete(TPMA_NV *nv, char *arg) { UNUSED(arg); - *nv |= TPMA_NV_TPMA_NV_POLICY_DELETE; + *nv |= TPMA_NV_POLICY_DELETE; return true; } static bool ppread(TPMA_NV *nv, char *arg) { UNUSED(arg); - *nv |= TPMA_NV_TPMA_NV_PPREAD; + *nv |= TPMA_NV_PPREAD; return true; } static bool ppwrite(TPMA_NV *nv, char *arg) { UNUSED(arg); - *nv |= TPMA_NV_TPMA_NV_PPWRITE; + *nv |= TPMA_NV_PPWRITE; return true; } static bool readlocked(TPMA_NV *nv, char *arg) { UNUSED(arg); - *nv |= TPMA_NV_TPMA_NV_READLOCKED; + *nv |= TPMA_NV_READLOCKED; return true; } static bool read_stclear(TPMA_NV *nv, char *arg) { UNUSED(arg); - *nv |= TPMA_NV_TPMA_NV_READ_STCLEAR; + *nv |= TPMA_NV_READ_STCLEAR; return true; } static bool writeall(TPMA_NV *nv, char *arg) { UNUSED(arg); - *nv |= TPMA_NV_TPMA_NV_WRITEALL; + *nv |= TPMA_NV_WRITEALL; return true; } static bool writedefine(TPMA_NV *nv, char *arg) { UNUSED(arg); - *nv |= TPMA_NV_TPMA_NV_WRITEDEFINE; + *nv |= TPMA_NV_WRITEDEFINE; return true; } static bool writelocked(TPMA_NV *nv, char *arg) { UNUSED(arg); - *nv |= TPMA_NV_TPMA_NV_WRITELOCKED; + *nv |= TPMA_NV_WRITELOCKED; return true; } static bool write_stclear(TPMA_NV *nv, char *arg) { UNUSED(arg); - *nv |= TPMA_NV_TPMA_NV_WRITE_STCLEAR; + *nv |= TPMA_NV_WRITE_STCLEAR; return true; } static bool written(TPMA_NV *nv, char *arg) { UNUSED(arg); - *nv |= TPMA_NV_TPMA_NV_WRITTEN; + *nv |= TPMA_NV_WRITTEN; return true; } @@ -226,7 +226,7 @@ static bool nt(TPMA_NV *nv, char *arg) { return false; } - *nv &= ~TPMA_NV_TPM2_NT; + *nv &= ~TPMA_NV_TPM2_NT_MASK; *nv |= value << 4; return true; } @@ -348,7 +348,7 @@ static bool decrypt(TPMA_OBJECT *obj, char *arg) { static bool sign(TPMA_OBJECT *obj, char *arg) { UNUSED(arg); - *obj |= TPMA_OBJECT_SIGN; + *obj |= TPMA_OBJECT_SIGN_ENCRYPT; return true; } |