summaryrefslogtreecommitdiffstats
path: root/TPM2-Plugin/lib/include/tpm2_plugin_api.h
diff options
context:
space:
mode:
authorNingSun <ning.sun@intel.com>2018-04-26 14:20:38 -0700
committerNing Sun <ning.sun@intel.com>2018-05-24 21:23:58 +0000
commit1ca4825b215df6c3370f6e274d095b2d928e64b4 (patch)
tree47f7c6527e06f25ca8f0c325d807f54aea7690b2 /TPM2-Plugin/lib/include/tpm2_plugin_api.h
parent1432266ea7ce545a60b0b53f4c920e68bc1ed152 (diff)
Added 3 more TPM2 Plugin APIs
Added tpm2_plugin_rsa_sign_update(...), tpm2_plugin_rsa_sign_final(...), tpm2_plugin_rsa_sign_cleanup(...) APIs. Issue-ID: AAF-94 Change-Id: I104ff7b979329c03e91206d19371d3904f163993 Signed-off-by: NingSun <ning.sun@intel.com>
Diffstat (limited to 'TPM2-Plugin/lib/include/tpm2_plugin_api.h')
-rw-r--r--TPM2-Plugin/lib/include/tpm2_plugin_api.h66
1 files changed, 41 insertions, 25 deletions
diff --git a/TPM2-Plugin/lib/include/tpm2_plugin_api.h b/TPM2-Plugin/lib/include/tpm2_plugin_api.h
index 2a0ace0..d96d2f9 100644
--- a/TPM2-Plugin/lib/include/tpm2_plugin_api.h
+++ b/TPM2-Plugin/lib/include/tpm2_plugin_api.h
@@ -141,51 +141,67 @@ typedef struct {
int version;
} common_opts_t;
+#define MAX_DATA_SIGNUPDATE 0x2000
+#define MAX_SESSIONS 0x1000
+
+typedef struct concatenate_data_signupdate {
+ unsigned long int session_handle;
+ unsigned char data_signupdate[MAX_DATA_SIGNUPDATE];
+ int data_length;
+}CONCATENATE_DATA_SIGNUPDATE_t;
+
int tpm2_plugin_init();
int tpm2_plugin_uninit();
int tpm2_plugin_activate(SSHSM_HW_PLUGIN_ACTIVATE_LOAD_IN_INFO_t *activate_in_info);
int tpm2_plugin_load_key(
SSHSM_HW_PLUGIN_ACTIVATE_LOAD_IN_INFO_t *loadkey_in_info,
- void **keyHandle
+ void **keyHandle,
+ SSHSM_HW_PLUGIN_IMPORT_PUBLIC_KEY_INFO_t *importkey_info
);
-int tpm2_rsa_create_object(
- unsigned long appHandle,
- //DhsmWPKRSAFormat* wpk,
- void *wpk,
- unsigned char* swk,
- int swk_len,
- unsigned char* iv,
- int iv_len,
- int tag_len,
- void **cb_object);
-
-int tpm2_rsa_delete_object(
- void *cb_object);
-
int tpm2_plugin_rsa_sign_init(
void *keyHandle,
unsigned long mechanism,
void *param,
- int len);
+ int len,
+ void **plugin_data_ref
+ );
int tpm2_plugin_rsa_sign(
void *keyHandle,
unsigned long mechanism,
unsigned char *msg,
int msg_len,
+ void *plugin_data_ref,
unsigned char *sig,
- int *sig_len);
+ int *sig_len
+ );
+
+int tpm2_plugin_rsa_sign_update(
+ void *keyHandle,
+ unsigned long mechnaism,
+ unsigned char *msg,
+ int msg_len,
+ void *plugin_data_ref
+ );
+
+int tpm2_plugin_rsa_sign_final(
+ void *keyHandle,
+ unsigned long mechnaism,
+ void *plugin_data_ref,
+ unsigned char *outsig,
+ int *outsiglen
+ );
+/** This function is called by SSHSM only if there sign_final function is not called.
+If sign_final function is called, it is assumed that plugin would have cleaned this up.
+***/
-int tpm2_import_object(
- unsigned long appHandle,
- unsigned char* tlvbuffer,
- int buflen,
- unsigned char* iv,
- int iv_len,
- unsigned char* tpm_pwd,
- int tpm_pwd_len);
+typedef int (*sshsm_hw_plugin_rsa_sign_cleanup)(
+ void *keyHandle,
+ unsigned long mechnaism,
+ void *plugin_data_ref
+ );
#ifdef __cplusplus