summaryrefslogtreecommitdiffstats
path: root/TPM2-Plugin/src
diff options
context:
space:
mode:
authorNingSun <ning.sun@intel.com>2018-03-29 21:06:26 -0700
committerNingSun <ning.sun@intel.com>2018-03-29 22:51:26 -0700
commit337e67515bb081df614ae7e8313c904499e3505f (patch)
treeffe24fbd9a44a618b267e1be4f584d77a830925e /TPM2-Plugin/src
parent4ba28823277dd1d154e4a26f7eae440c40b1f9fd (diff)
Clean up TPM2 PLugin codes
Remove unused and redundant codes. Issue-ID: AAF-94 Change-Id: Icfdbf29e2d7caa339977e7d074f16e123cbff84f Signed-off-by: NingSun <ning.sun@intel.com>
Diffstat (limited to 'TPM2-Plugin/src')
-rw-r--r--TPM2-Plugin/src/main.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/TPM2-Plugin/src/main.c b/TPM2-Plugin/src/main.c
index 6fc54a4..5020ce6 100644
--- a/TPM2-Plugin/src/main.c
+++ b/TPM2-Plugin/src/main.c
@@ -31,22 +31,24 @@
#include <stdio.h>
#include "tpm2_plugin_api.h"
-#include "plugin_register.h"
+//#include "plugin_register.h"
+//#include "hwpluginif.h"
void main(void)
{
- unsigned long mechanish =1;
+ unsigned long mechanism =1;
void *param = NULL;
size_t len = 100;
- void *ctx = NULL;
-
+ void *keyHandle_sign = NULL;
+
unsigned char *msg;
int msg_len;
unsigned char *sig;
int *sig_len;
- SSHSM_HW_PLUGIN_ACTIVATE_IN_INFO_t *activate_in_info;
- SSHSM_HW_PLUGIN_LOAD_KEY_IN_INFO_t *loadkey_in_info;
+ SSHSM_HW_PLUGIN_ACTIVATE_LOAD_IN_INFO_t *activate_in_info;
+ activate_in_info = malloc(sizeof(SSHSM_HW_PLUGIN_ACTIVATE_LOAD_IN_INFO_t));
+ SSHSM_HW_PLUGIN_ACTIVATE_LOAD_IN_INFO_t *loadkey_in_info;
void **keyHandle;
printf("---------------------------------------------\n");
@@ -65,9 +67,9 @@ void main(void)
tpm2_plugin_load_key(loadkey_in_info, keyHandle );
printf("---------------------------------------------\n");
- tpm2_plugin_rsa_sign_init(mechanish, param, len, ctx);
+ tpm2_plugin_rsa_sign_init(keyHandle_sign, mechanism, param, len);
printf("---------------------------------------------\n");
- tpm2_plugin_rsa_sign(ctx, msg, msg_len, sig, sig_len);
+ tpm2_plugin_rsa_sign(keyHandle_sign, mechanism, msg, msg_len, sig, sig_len);
}