Home
last modified time | relevance | path

Searched refs:pubKey (Results 1 – 25 of 29) sorted by relevance

12

/netbsd-src/crypto/external/cpl/trousers/dist/src/tspi/
H A Dtsp_asym.c38 TPM_PUBKEY pubKey; in __tspi_rsa_encrypt() local
50 if ((result = Trspi_UnloadBlob_PUBKEY(&offset, blob, &pubKey))) { in __tspi_rsa_encrypt()
56 if (pubKey.pubKey.keyLength < inDataLen) { in __tspi_rsa_encrypt()
61 if (pubKey.algorithmParms.encScheme == TPM_ES_RSAESPKCSv15 || in __tspi_rsa_encrypt()
62 pubKey.algorithmParms.encScheme == TSS_ES_RSAESPKCSV15) { in __tspi_rsa_encrypt()
64 pubKey.pubKey.key, pubKey.pubKey.keyLength))) in __tspi_rsa_encrypt()
68 pubKey.pubKey.key, in __tspi_rsa_encrypt()
69 pubKey.pubKey.keyLength))) in __tspi_rsa_encrypt()
74 free(pubKey.pubKey.key); in __tspi_rsa_encrypt()
75 free(pubKey.algorithmParms.parms); in __tspi_rsa_encrypt()
[all …]
H A Dtsp_own.c99 free(dummyKey.pubKey.key); in secret_TakeOwnership()
105 free(dummyKey.pubKey.key); in secret_TakeOwnership()
112 encOwnerAuthLength, dummyKey.pubKey.key, in secret_TakeOwnership()
113 dummyKey.pubKey.keyLength))) { in secret_TakeOwnership()
114 free(dummyKey.pubKey.key); in secret_TakeOwnership()
120 encSRKAuthLength, dummyKey.pubKey.key, in secret_TakeOwnership()
121 dummyKey.pubKey.keyLength))) { in secret_TakeOwnership()
122 free(dummyKey.pubKey.key); in secret_TakeOwnership()
127 free(dummyKey.pubKey.key); in secret_TakeOwnership()
H A Dtspi_sign.c110 BYTE *pubKey = NULL; in Tspi_Hash_VerifySignature() local
123 if ((result = obj_rsakey_get_modulus(hKey, &pubKeySize, &pubKey))) in Tspi_Hash_VerifySignature()
127 free_tspi(tspContext, pubKey); in Tspi_Hash_VerifySignature()
132 free_tspi(tspContext, pubKey); in Tspi_Hash_VerifySignature()
137 result = Trspi_Verify(TSS_HASH_SHA1, hashData, hashDataSize, pubKey, pubKeySize, in Tspi_Hash_VerifySignature()
140 result = Trspi_Verify(TSS_HASH_OTHER, hashData, hashDataSize, pubKey, pubKeySize, in Tspi_Hash_VerifySignature()
146 free_tspi(tspContext, pubKey); in Tspi_Hash_VerifySignature()
H A Dtspi_bind.c68 if (keyContainer.pubKey.keyLength < ulDataLength) { in Tspi_Data_Bind()
76 &encDataLength, keyContainer.pubKey.key, in Tspi_Data_Bind()
77 keyContainer.pubKey.keyLength))) in Tspi_Data_Bind()
96 &encDataLength, keyContainer.pubKey.key, in Tspi_Data_Bind()
97 keyContainer.pubKey.keyLength))) { in Tspi_Data_Bind()
119 keyContainer.pubKey.key, in Tspi_Data_Bind()
120 keyContainer.pubKey.keyLength))) { in Tspi_Data_Bind()
H A Dtspi_ek.c149 TCPA_PUBKEY pubKey; in Tspi_TPM_GetPubEndorsementKey() local
152 __tspi_memset(&pubKey, 0, sizeof(TCPA_PUBKEY)); in Tspi_TPM_GetPubEndorsementKey()
197 __tspi_memset(&pubKey, 0, sizeof(TCPA_PUBKEY)); in Tspi_TPM_GetPubEndorsementKey()
198 if ((result = Trspi_UnloadBlob_PUBKEY(&offset, pubEK, &pubKey))) in Tspi_TPM_GetPubEndorsementKey()
202 result |= Trspi_HashUpdate(&hashCtx, pubKey.pubKey.keyLength, in Tspi_TPM_GetPubEndorsementKey()
203 pubKey.pubKey.key); in Tspi_TPM_GetPubEndorsementKey()
H A Dobj_rsakey.c104 rsakey->key.pubKey.keyLength = 0; in obj_rsakey_add()
284 rsakey->key.pubKey.keyLength = len/8; in obj_rsakey_set_size()
883 switch (rsakey->key.pubKey.keyLength) { in obj_rsakey_get_size()
894 *len = rsakey->key.pubKey.keyLength * 8; in obj_rsakey_get_size()
1140 if (!memcmp(rsakey->key.pubKey.key, zeroBlob, rsakey->key.pubKey.keyLength)) { in obj_rsakey_get_modulus()
1146 *data = calloc_tspi(obj->tspContext, rsakey->key.pubKey.keyLength); in obj_rsakey_get_modulus()
1148 LogError("malloc of %u bytes failed.", rsakey->key.pubKey.keyLength); in obj_rsakey_get_modulus()
1152 *size = rsakey->key.pubKey.keyLength; in obj_rsakey_get_modulus()
1153 memcpy(*data, rsakey->key.pubKey.key, rsakey->key.pubKey.keyLength); in obj_rsakey_get_modulus()
1179 free_ptr = rsakey->key.pubKey.key; in obj_rsakey_set_modulus()
[all …]
H A Dtspi_key.c485 pubLen = keyContainer.pubKey.keyLength; in Tspi_Context_LoadKeyByBlob()
641 BYTE *pubKey = NULL; in Tspi_TPM_KeyControlOwner() local
672 if ((result = obj_rsakey_get_pub_blob(hTssKey, &pubKeyLen, &pubKey))) in Tspi_TPM_KeyControlOwner()
678 LogDebugData(pubKeyLen, pubKey); in Tspi_TPM_KeyControlOwner()
679 result |= Trspi_HashUpdate(&hashCtx, pubKeyLen, pubKey); in Tspi_TPM_KeyControlOwner()
683 free_tspi(tspContext, pubKey); in Tspi_TPM_KeyControlOwner()
689 free_tspi(tspContext, pubKey); in Tspi_TPM_KeyControlOwner()
693 if ((result = RPC_KeyControlOwner(tspContext, hTcsKey, pubKeyLen, pubKey, tpmAttribName, in Tspi_TPM_KeyControlOwner()
695 free_tspi(tspContext, pubKey); in Tspi_TPM_KeyControlOwner()
H A Dtspi_cmk.c130 BYTE *pubKey = NULL; in Tspi_TPM_CMKCreateTicket() local
148 if ((result = obj_rsakey_get_pub_blob(hVerifyKey, &pubKeySize, &pubKey))) in Tspi_TPM_CMKCreateTicket()
161 result |= Trspi_HashUpdate(&hashCtx, pubKeySize, pubKey); in Tspi_TPM_CMKCreateTicket()
172 if ((result = RPC_CMK_CreateTicket(hContext, pubKeySize, pubKey, sigData, sigSize, sig, in Tspi_TPM_CMKCreateTicket()
190 free_tspi(hContext, pubKey); in Tspi_TPM_CMKCreateTicket()
252 free(tpmMigKeyAuth.migrationKey.pubKey.key); in Tspi_Key_CMKCreateBlob()
H A Dtsp_key.c31 free(key->pubKey.key); in free_key_refs()
32 key->pubKey.key = NULL; in free_key_refs()
33 key->pubKey.keyLength = 0; in free_key_refs()
H A Dtspi_migration.c96 Trspi_LoadBlob_STORE_PUBKEY(&offset, pubKeyBlob, &tssKey.pubKey); in Tspi_TPM_AuthorizeMigrationTicket()
208 free(migAuth.migrationKey.pubKey.key); in Tspi_Key_CreateMigrationBlob()
209 migAuth.migrationKey.pubKey.keyLength = 0; in Tspi_Key_CreateMigrationBlob()
H A Dtspi_selftest.c140 keyContainer.pubKey.key, keyContainer.pubKey.keyLength, in Tspi_TPM_CertifySelfTest()
H A Dtspi_quote.c191 keyContainer.pubKey.key, in Tspi_TPM_Quote()
192 keyContainer.pubKey.keyLength, in Tspi_TPM_Quote()
H A Dtspi_aik.c166 Trspi_LoadBlob_STORE_PUBKEY(&offset, chosenIDBlob, &caKey.pubKey); in Tspi_TPM_CollateIdentityRequest()
366 caKey.pubKey.key, caKey.pubKey.keyLength, in Tspi_TPM_CollateIdentityRequest()
H A Dtspi_changeauth.c279 ephemeralKey.pubKey.key, in Tspi_ChangeAuthAsym()
280 ephemeralKey.pubKey.keyLength); in Tspi_ChangeAuthAsym()
H A Dobj.c290 result |= Trspi_Hash_STORE_PUBKEY(&hashCtx, &rsakey->key.pubKey); in obj_tcskey_get_pubkeyhash()
/netbsd-src/crypto/external/cpl/trousers/dist/src/tcs/
H A Dtcs_key_mem_cache.c93 ret = tmp->blob ? &tmp->blob->pubKey : NULL; in mc_get_pub_by_slot()
114 ret = tmp->blob ? &tmp->blob->pubKey : NULL; in mc_get_pub_by_handle()
207 tmp->blob->pubKey.keyLength == pub->keyLength && in mc_get_uuid_by_pub()
208 !memcmp(tmp->blob->pubKey.key, pub->key, pub->keyLength)) { in mc_get_uuid_by_pub()
346 if (key_blob->pubKey.keyLength > 0) { in mc_add_entry()
347 entry->blob->pubKey.key = (BYTE *)malloc(key_blob->pubKey.keyLength); in mc_add_entry()
348 if (entry->blob->pubKey.key == NULL) { in mc_add_entry()
349 LogError("malloc of %u bytes failed.", key_blob->pubKey.keyLength); in mc_add_entry()
355 memcpy(entry->blob->pubKey.key, key_blob->pubKey.key, key_blob->pubKey.keyLength); in mc_add_entry()
357 entry->blob->pubKey.keyLength = key_blob->pubKey.keyLength; in mc_add_entry()
[all …]
H A Dtcsi_ps.c610 TCPA_STORE_PUBKEY pubKey; in TCSP_GetRegisteredKeyByPublicInfo_Internal() local
613 pubKey.key = NULL; in TCSP_GetRegisteredKeyByPublicInfo_Internal()
620 pubKey.keyLength = ulPublicInfoLength; in TCSP_GetRegisteredKeyByPublicInfo_Internal()
621 pubKey.key = malloc(pubKey.keyLength); in TCSP_GetRegisteredKeyByPublicInfo_Internal()
622 if (pubKey.key == NULL) { in TCSP_GetRegisteredKeyByPublicInfo_Internal()
623 LogError("malloc of %d bytes failed.", pubKey.keyLength); in TCSP_GetRegisteredKeyByPublicInfo_Internal()
627 memcpy(pubKey.key, rgbPublicInfo, pubKey.keyLength); in TCSP_GetRegisteredKeyByPublicInfo_Internal()
629 if ((result = ps_get_key_by_pub(&pubKey, keySize, keyBlob))) { in TCSP_GetRegisteredKeyByPublicInfo_Internal()
631 free(pubKey.key); in TCSP_GetRegisteredKeyByPublicInfo_Internal()
635 free(pubKey.key); in TCSP_GetRegisteredKeyByPublicInfo_Internal()
H A Dtcs_key.c46 if ((tcsHandle = mc_get_handle_by_pub(&key.pubKey, hParent)) == NULL_TCS_HANDLE) { in add_cache_entry()
170 if ((tcs_handle = mc_get_handle_by_pub(&key.pubKey, parent_handle))) { in load_key_init()
481 if ((rc = UnloadBlob_STORE_PUBKEY(offset, blob, &key->pubKey))) { in UnloadBlob_TSS_KEY()
505 free(key->pubKey.key); in UnloadBlob_TSS_KEY()
506 key->pubKey.key = NULL; in UnloadBlob_TSS_KEY()
507 key->pubKey.keyLength = 0; in UnloadBlob_TSS_KEY()
530 LoadBlob_STORE_PUBKEY(offset, blob, &key->pubKey); in LoadBlob_TSS_KEY()
539 LoadBlob_STORE_PUBKEY(offset, blob, &(key->pubKey)); in LoadBlob_PUBKEY()
555 if ((rc = UnloadBlob_STORE_PUBKEY(offset, blob, &key->pubKey))) { in UnloadBlob_PUBKEY()
577 free(key->pubKey.key); in destroy_key_refs()
[all …]
H A Dtcsi_own.c105 save = srkKeyContainer.pubKey.key; in TCSP_TakeOwnership_Internal()
106 srkKeyContainer.pubKey.key = fake_pubkey; in TCSP_TakeOwnership_Internal()
119 srkKeyContainer.pubKey.key = save; in TCSP_TakeOwnership_Internal()
/netbsd-src/crypto/external/cpl/trousers/dist/src/tcs/rpc/tcstp/
H A Drpc_maint.c212 BYTE *pubKey; in tcs_wrap_LoadManuMaintPub() local
230 pubKey = (BYTE *)malloc(pubKeySize); in tcs_wrap_LoadManuMaintPub()
231 if (pubKey == NULL) { in tcs_wrap_LoadManuMaintPub()
236 if (getData(TCSD_PACKET_TYPE_PBYTE, 3, pubKey, pubKeySize, &data->comm)) { in tcs_wrap_LoadManuMaintPub()
237 free(pubKey); in tcs_wrap_LoadManuMaintPub()
243 result = TCSP_LoadManuMaintPub_Internal(hContext, antiReplay, pubKeySize, pubKey, in tcs_wrap_LoadManuMaintPub()
247 free(pubKey); in tcs_wrap_LoadManuMaintPub()
H A Drpc_key.c68 BYTE *pubKey; in tcs_wrap_GetPubkey() local
93 result = TCSP_GetPubKey_Internal(hContext, hKey, pAuth, &pubKeySize, &pubKey); in tcs_wrap_GetPubkey()
102 free(pubKey); in tcs_wrap_GetPubkey()
106 free(pubKey); in tcs_wrap_GetPubkey()
109 if (setData(TCSD_PACKET_TYPE_PBYTE, i++, pubKey, pubKeySize, &data->comm)) { in tcs_wrap_GetPubkey()
110 free(pubKey); in tcs_wrap_GetPubkey()
113 free(pubKey); in tcs_wrap_GetPubkey()
/netbsd-src/crypto/external/cpl/trousers/dist/src/include/trousers/
H A Dtrousers.h46 TSS_RESULT Trspi_UnloadBlob_PUBKEY(UINT64 *offset, BYTE *blob, TCPA_PUBKEY *pubKey);
95 void Trspi_LoadBlob_PUBKEY(UINT64 *offset, BYTE *blob, TCPA_PUBKEY *pubKey);
151 TSS_RESULT Trspi_Hash_PUBKEY(Trspi_HashCtx *c, TCPA_PUBKEY *pubKey);
212 #define Trspi_RSA_PKCS15_Encrypt(in,inlen,out,outlen,pubKey,pubSize) \ argument
213 Trspi_RSA_Public_Encrypt(in,inlen,out,outlen,pubKey,pubSize,65537,TR_RSA_PKCS1_PADDING)
215 #define Trspi_RSA_OAEP_Encrypt(in,inlen,out,outlen,pubKey,pubSize) \ argument
216 Trspi_RSA_Public_Encrypt(in,inlen,out,outlen,pubKey,pubSize,65537, \
219 #define Trspi_TPM_RSA_OAEP_Encrypt(in,inlen,out,outlen,pubKey,pubSize) \ argument
220 Trspi_RSA_Encrypt(in,inlen,out,outlen,pubKey,pubSize)
/netbsd-src/crypto/external/cpl/trousers/dist/src/trspi/
H A Dtrousers.c68 Trspi_LoadBlob_PUBKEY(UINT64 *offset, BYTE *blob, TCPA_PUBKEY *pubKey) in Trspi_LoadBlob_PUBKEY() argument
70 Trspi_LoadBlob_KEY_PARMS(offset, blob, &pubKey->algorithmParms); in Trspi_LoadBlob_PUBKEY()
71 Trspi_LoadBlob_STORE_PUBKEY(offset, blob, &pubKey->pubKey); in Trspi_LoadBlob_PUBKEY()
75 Trspi_UnloadBlob_PUBKEY(UINT64 *offset, BYTE *blob, TCPA_PUBKEY *pubKey) in Trspi_UnloadBlob_PUBKEY() argument
79 if (!pubKey) { in Trspi_UnloadBlob_PUBKEY()
86 if ((result = Trspi_UnloadBlob_KEY_PARMS(offset, blob, &pubKey->algorithmParms))) in Trspi_UnloadBlob_PUBKEY()
88 if ((result = Trspi_UnloadBlob_STORE_PUBKEY(offset, blob, &pubKey->pubKey))) { in Trspi_UnloadBlob_PUBKEY()
89 free(pubKey->pubKey.key); in Trspi_UnloadBlob_PUBKEY()
90 free(pubKey->algorithmParms.parms); in Trspi_UnloadBlob_PUBKEY()
91 pubKey->pubKey.key = NULL; in Trspi_UnloadBlob_PUBKEY()
[all …]
/netbsd-src/crypto/external/cpl/trousers/dist/src/include/
H A Dtrousers_types.h116 TPM_STORE_PUBKEY pubKey; member
/netbsd-src/crypto/external/cpl/trousers/dist/src/tcs/ps/
H A Dtcsps.c585 pub_key_size = key.pubKey.keyLength; in psfile_write_key()
649 if ((rc = write_data(fd, (void *)key.pubKey.key, pub_key_size))) { in psfile_write_key()

12