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/src | |
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/src')
-rw-r--r-- | TPM2-Plugin/src/main.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/TPM2-Plugin/src/main.c b/TPM2-Plugin/src/main.c index 69bb29f..6fc54a4 100644 --- a/TPM2-Plugin/src/main.c +++ b/TPM2-Plugin/src/main.c @@ -31,6 +31,7 @@ #include <stdio.h> #include "tpm2_plugin_api.h" +#include "plugin_register.h" void main(void) { @@ -38,11 +39,35 @@ void main(void) void *param = NULL; size_t len = 100; void *ctx = NULL; + + unsigned char *msg; + int msg_len; + unsigned char *sig; + int *sig_len; - printf("test app calling tpm2_rsa_sign_init in tpm2_plugin \n"); + SSHSM_HW_PLUGIN_ACTIVATE_IN_INFO_t *activate_in_info; + SSHSM_HW_PLUGIN_LOAD_KEY_IN_INFO_t *loadkey_in_info; + void **keyHandle; - tpm2_rsa_sign_init(mechanish, param, len, ctx); + printf("---------------------------------------------\n"); + printf("Test app calling tpm2_plugin APIs\n"); - printf("tpm2_rsa_sign_init was returned from tpm2_plugin, test app will exit... \n"); + printf("---------------------------------------------\n"); + tpm2_plugin_init(); + + printf("---------------------------------------------\n"); + tpm2_plugin_uninit(); + + printf("---------------------------------------------\n"); + tpm2_plugin_activate(activate_in_info); + + printf("---------------------------------------------\n"); + tpm2_plugin_load_key(loadkey_in_info, keyHandle ); + + printf("---------------------------------------------\n"); + tpm2_plugin_rsa_sign_init(mechanish, param, len, ctx); + + printf("---------------------------------------------\n"); + tpm2_plugin_rsa_sign(ctx, msg, msg_len, sig, sig_len); } |