Lines Matching refs:rsrc_session
174 if (session->rsrc.misc.rsrc_session. in iesys_compute_encrypt_nonce()
182 *encryptNonce = &session->rsrc.misc.rsrc_session.nonceTPM; in iesys_compute_encrypt_nonce()
235 session->rsrc.misc.rsrc_session.authHash) { in iesys_compute_cp_hashtab()
242 r = iesys_crypto_cpHash(session->rsrc.misc.rsrc_session. in iesys_compute_cp_hashtab()
250 session->rsrc.misc.rsrc_session.authHash; in iesys_compute_cp_hashtab()
298 if (rp_hash_tab[j].alg == session->rsrc.misc.rsrc_session.authHash) { in iesys_compute_rp_hashtab()
305 r = iesys_crypto_rpHash(session->rsrc.misc.rsrc_session.authHash, in iesys_compute_rp_hashtab()
311 session->rsrc.misc.rsrc_session.authHash; in iesys_compute_rp_hashtab()
539 r = iesys_crypto_random2b(&session->rsrc.misc.rsrc_session.nonceCaller, in iesys_gen_caller_nonces()
540 session->rsrc.misc.rsrc_session.nonceCaller.size); in iesys_gen_caller_nonces()
557 IESYS_SESSION *rsrc_session) in iesys_update_session_flags() argument
565 rsrc_session->origSessionAttributes = rsrc_session->sessionAttributes; in iesys_update_session_flags()
571 rsrc_session->sessionAttributes &= ~(TPMA_SESSION_DECRYPT); in iesys_update_session_flags()
578 rsrc_session->sessionAttributes &= ~(TPMA_SESSION_ENCRYPT); in iesys_update_session_flags()
582 rsrc_session->sessionAttributes, in iesys_update_session_flags()
583 rsrc_session->origSessionAttributes); in iesys_update_session_flags()
601 IESYS_SESSION *rsrc_session = &session->rsrc.misc.rsrc_session; in iesys_restore_session_flags() local
603 rsrc_session->origSessionAttributes, in iesys_restore_session_flags()
604 rsrc_session->sessionAttributes); in iesys_restore_session_flags()
606 rsrc_session->sessionAttributes = rsrc_session->origSessionAttributes; in iesys_restore_session_flags()
639 IESYS_SESSION *rsrc_session = &session->rsrc.misc.rsrc_session; in iesys_encrypt_param() local
640 if (rsrc_session->sessionAttributes & TPMA_SESSION_ENCRYPT) in iesys_encrypt_param()
643 if (rsrc_session->sessionAttributes & TPMA_SESSION_DECRYPT) in iesys_encrypt_param()
647 iesys_update_session_flags(esys_context, rsrc_session); in iesys_encrypt_param()
654 IESYS_SESSION *rsrc_session = &session->rsrc.misc.rsrc_session; in iesys_encrypt_param() local
655 TPMT_SYM_DEF *symDef = &rsrc_session->symmetric; in iesys_encrypt_param()
657 if (rsrc_session->sessionAttributes & TPMA_SESSION_ENCRYPT) { in iesys_encrypt_param()
659 encryptNonce = &rsrc_session->nonceTPM; in iesys_encrypt_param()
661 esys_context->enc_session = rsrc_session; in iesys_encrypt_param()
665 if (rsrc_session->sessionAttributes & TPMA_SESSION_DECRYPT) { in iesys_encrypt_param()
667 *decryptNonce = &rsrc_session->nonceTPM; in iesys_encrypt_param()
669 r = iesys_crypto_hash_get_digest_size(rsrc_session->authHash, &hlen); in iesys_encrypt_param()
695 r = iesys_crypto_KDFa(rsrc_session->authHash, in iesys_encrypt_param()
696 &rsrc_session->sessionValue[0], in iesys_encrypt_param()
697 rsrc_session->sizeSessionValue, "CFB", in iesys_encrypt_param()
698 &rsrc_session->nonceCaller, in iesys_encrypt_param()
699 &rsrc_session->nonceTPM, in iesys_encrypt_param()
716 r = iesys_xor_parameter_obfuscation(rsrc_session->authHash, in iesys_encrypt_param()
717 &rsrc_session->sessionValue[0], in iesys_encrypt_param()
718 rsrc_session->sizeSessionValue, in iesys_encrypt_param()
719 &rsrc_session->nonceCaller, in iesys_encrypt_param()
720 &rsrc_session->nonceTPM, in iesys_encrypt_param()
759 IESYS_SESSION *rsrc_session; in iesys_decrypt_param() local
764 rsrc_session = &session->rsrc.misc.rsrc_session; in iesys_decrypt_param()
765 symDef = &rsrc_session->symmetric; in iesys_decrypt_param()
767 r = iesys_crypto_hash_get_digest_size(rsrc_session->authHash, &hlen); in iesys_decrypt_param()
786 LOGBLOB_DEBUG(&rsrc_session->sessionKey.buffer[0], in iesys_decrypt_param()
787 rsrc_session->sessionKey.size, in iesys_decrypt_param()
790 r = iesys_crypto_KDFa(rsrc_session->authHash, in iesys_decrypt_param()
791 &rsrc_session->sessionValue[0], in iesys_decrypt_param()
792 rsrc_session->sizeSessionValue, in iesys_decrypt_param()
793 "CFB", &rsrc_session->nonceTPM, in iesys_decrypt_param()
794 &rsrc_session->nonceCaller, in iesys_decrypt_param()
818 r = iesys_xor_parameter_obfuscation(rsrc_session->authHash, in iesys_decrypt_param()
819 &rsrc_session->sessionValue[0], in iesys_decrypt_param()
820 rsrc_session->sizeSessionValue, in iesys_decrypt_param()
821 &rsrc_session->nonceTPM, in iesys_decrypt_param()
822 &rsrc_session->nonceCaller, in iesys_decrypt_param()
863 IESYS_SESSION *rsrc_session = &session->rsrc.misc.rsrc_session; in iesys_check_rp_hmacs() local
864 if (rsrc_session->type_policy_session == POLICY_PASSWORD) { in iesys_check_rp_hmacs()
876 if (rsrc_session->authHash == rp_hash_tab[hi].alg) { in iesys_check_rp_hmacs()
882 rsrc_session->authHash); in iesys_check_rp_hmacs()
888 rsrc_session->nonceTPM = rspAuths->auths[i].nonce; in iesys_check_rp_hmacs()
889 rsrc_session->sessionAttributes = in iesys_check_rp_hmacs()
891 r = iesys_crypto_authHmac(rsrc_session->authHash, in iesys_check_rp_hmacs()
892 &rsrc_session->sessionValue[0], in iesys_check_rp_hmacs()
893 rsrc_session->sizeHmacValue, in iesys_check_rp_hmacs()
896 &rsrc_session->nonceTPM, in iesys_check_rp_hmacs()
897 &rsrc_session->nonceCaller, NULL, NULL, in iesys_check_rp_hmacs()
945 if (session->rsrc.misc.rsrc_session.bound_entity.size == 0) in iesys_is_object_bound()
949 return cmp_TPM2B_NAME(&session->rsrc.misc.rsrc_session.bound_entity, &tmp); in iesys_is_object_bound()
981 session->rsrc.misc.rsrc_session.sizeSessionValue in iesys_compute_session_value()
982 = session->rsrc.misc.rsrc_session.sessionKey.size; in iesys_compute_session_value()
983 memcpy(&session->rsrc.misc.rsrc_session.sessionValue[0], in iesys_compute_session_value()
984 &session->rsrc.misc.rsrc_session.sessionKey.buffer[0], in iesys_compute_session_value()
985 session->rsrc.misc.rsrc_session.sessionKey.size); in iesys_compute_session_value()
988 if (session->rsrc.misc.rsrc_session.sessionType != TPM2_SE_HMAC && in iesys_compute_session_value()
989 session->rsrc.misc.rsrc_session.sessionType != TPM2_SE_POLICY) in iesys_compute_session_value()
992 … session->rsrc.misc.rsrc_session.sizeHmacValue = session->rsrc.misc.rsrc_session.sizeSessionValue; in iesys_compute_session_value()
998 memcpy(&session->rsrc.misc.rsrc_session. in iesys_compute_session_value()
999 sessionValue[session->rsrc.misc.rsrc_session.sessionKey.size], in iesys_compute_session_value()
1001 session->rsrc.misc.rsrc_session.sizeSessionValue += auth_value->size; in iesys_compute_session_value()
1010 if (session->rsrc.misc.rsrc_session.sessionType == TPM2_SE_POLICY && in iesys_compute_session_value()
1011 session->rsrc.misc.rsrc_session.type_policy_session != POLICY_AUTH) in iesys_compute_session_value()
1014 session->rsrc.misc.rsrc_session.sizeHmacValue += auth_value->size; in iesys_compute_session_value()
1192 IESYS_SESSION *rsrc_session = &session->rsrc.misc.rsrc_session; in iesys_compute_hmac() local
1193 r = iesys_crypto_hash_get_digest_size(rsrc_session-> in iesys_compute_hmac()
1199 if (rsrc_session->authHash == cp_hash_tab[j].alg) { in iesys_compute_hmac()
1208 r = iesys_crypto_authHmac(rsrc_session->authHash, in iesys_compute_hmac()
1209 &rsrc_session->sessionValue[0], in iesys_compute_hmac()
1210 rsrc_session->sizeHmacValue, in iesys_compute_hmac()
1213 &rsrc_session->nonceCaller, in iesys_compute_hmac()
1214 &rsrc_session->nonceTPM, in iesys_compute_hmac()
1216 rsrc_session->sessionAttributes, &auth->hmac); in iesys_compute_hmac()
1219 auth->nonce = rsrc_session->nonceCaller; in iesys_compute_hmac()
1221 rsrc_session->sessionAttributes; in iesys_compute_hmac()
1294 IESYS_SESSION *rsrc_session = &session->rsrc.misc.rsrc_session; in iesys_gen_auths() local
1295 if (rsrc_session->type_policy_session == POLICY_PASSWORD) { in iesys_gen_auths()
1303 session->rsrc.misc.rsrc_session.sessionAttributes; in iesys_gen_auths()