Lines Matching refs:pneg_ctxt

765 static void build_preauth_ctxt(struct smb2_preauth_neg_context *pneg_ctxt,  in build_preauth_ctxt()  argument
768 pneg_ctxt->ContextType = SMB2_PREAUTH_INTEGRITY_CAPABILITIES; in build_preauth_ctxt()
769 pneg_ctxt->DataLength = cpu_to_le16(38); in build_preauth_ctxt()
770 pneg_ctxt->HashAlgorithmCount = cpu_to_le16(1); in build_preauth_ctxt()
771 pneg_ctxt->Reserved = cpu_to_le32(0); in build_preauth_ctxt()
772 pneg_ctxt->SaltLength = cpu_to_le16(SMB311_SALT_SIZE); in build_preauth_ctxt()
773 get_random_bytes(pneg_ctxt->Salt, SMB311_SALT_SIZE); in build_preauth_ctxt()
774 pneg_ctxt->HashAlgorithms = hash_id; in build_preauth_ctxt()
777 static void build_encrypt_ctxt(struct smb2_encryption_neg_context *pneg_ctxt, in build_encrypt_ctxt() argument
780 pneg_ctxt->ContextType = SMB2_ENCRYPTION_CAPABILITIES; in build_encrypt_ctxt()
781 pneg_ctxt->DataLength = cpu_to_le16(4); in build_encrypt_ctxt()
782 pneg_ctxt->Reserved = cpu_to_le32(0); in build_encrypt_ctxt()
783 pneg_ctxt->CipherCount = cpu_to_le16(1); in build_encrypt_ctxt()
784 pneg_ctxt->Ciphers[0] = cipher_type; in build_encrypt_ctxt()
787 static void build_sign_cap_ctxt(struct smb2_signing_capabilities *pneg_ctxt, in build_sign_cap_ctxt() argument
790 pneg_ctxt->ContextType = SMB2_SIGNING_CAPABILITIES; in build_sign_cap_ctxt()
791 pneg_ctxt->DataLength = in build_sign_cap_ctxt()
794 pneg_ctxt->Reserved = cpu_to_le32(0); in build_sign_cap_ctxt()
795 pneg_ctxt->SigningAlgorithmCount = cpu_to_le16(1); in build_sign_cap_ctxt()
796 pneg_ctxt->SigningAlgorithms[0] = sign_algo; in build_sign_cap_ctxt()
799 static void build_posix_ctxt(struct smb2_posix_neg_context *pneg_ctxt) in build_posix_ctxt() argument
801 pneg_ctxt->ContextType = SMB2_POSIX_EXTENSIONS_AVAILABLE; in build_posix_ctxt()
802 pneg_ctxt->DataLength = cpu_to_le16(POSIX_CTXT_DATA_LEN); in build_posix_ctxt()
804 pneg_ctxt->Name[0] = 0x93; in build_posix_ctxt()
805 pneg_ctxt->Name[1] = 0xAD; in build_posix_ctxt()
806 pneg_ctxt->Name[2] = 0x25; in build_posix_ctxt()
807 pneg_ctxt->Name[3] = 0x50; in build_posix_ctxt()
808 pneg_ctxt->Name[4] = 0x9C; in build_posix_ctxt()
809 pneg_ctxt->Name[5] = 0xB4; in build_posix_ctxt()
810 pneg_ctxt->Name[6] = 0x11; in build_posix_ctxt()
811 pneg_ctxt->Name[7] = 0xE7; in build_posix_ctxt()
812 pneg_ctxt->Name[8] = 0xB4; in build_posix_ctxt()
813 pneg_ctxt->Name[9] = 0x23; in build_posix_ctxt()
814 pneg_ctxt->Name[10] = 0x83; in build_posix_ctxt()
815 pneg_ctxt->Name[11] = 0xDE; in build_posix_ctxt()
816 pneg_ctxt->Name[12] = 0x96; in build_posix_ctxt()
817 pneg_ctxt->Name[13] = 0x8B; in build_posix_ctxt()
818 pneg_ctxt->Name[14] = 0xCD; in build_posix_ctxt()
819 pneg_ctxt->Name[15] = 0x7C; in build_posix_ctxt()
825 char * const pneg_ctxt = (char *)rsp + in assemble_neg_contexts() local
832 build_preauth_ctxt((struct smb2_preauth_neg_context *)pneg_ctxt, in assemble_neg_contexts()
842 (pneg_ctxt + ctxt_size), in assemble_neg_contexts()
856 (pneg_ctxt + ctxt_size)); in assemble_neg_contexts()
866 (pneg_ctxt + ctxt_size), in assemble_neg_contexts()
877 struct smb2_preauth_neg_context *pneg_ctxt, in decode_preauth_ctxt() argument
888 if (pneg_ctxt->HashAlgorithms != SMB2_PREAUTH_INTEGRITY_SHA512) in decode_preauth_ctxt()
896 struct smb2_encryption_neg_context *pneg_ctxt, in decode_encrypt_ctxt() argument
909 cph_cnt = le16_to_cpu(pneg_ctxt->CipherCount); in decode_encrypt_ctxt()
922 if (pneg_ctxt->Ciphers[i] == SMB2_ENCRYPTION_AES128_GCM || in decode_encrypt_ctxt()
923 pneg_ctxt->Ciphers[i] == SMB2_ENCRYPTION_AES128_CCM || in decode_encrypt_ctxt()
924 pneg_ctxt->Ciphers[i] == SMB2_ENCRYPTION_AES256_CCM || in decode_encrypt_ctxt()
925 pneg_ctxt->Ciphers[i] == SMB2_ENCRYPTION_AES256_GCM) { in decode_encrypt_ctxt()
927 pneg_ctxt->Ciphers[i]); in decode_encrypt_ctxt()
928 conn->cipher_type = pneg_ctxt->Ciphers[i]; in decode_encrypt_ctxt()
954 struct smb2_compression_capabilities_context *pneg_ctxt) in decode_compress_ctxt() argument
960 struct smb2_signing_capabilities *pneg_ctxt, in decode_sign_cap_ctxt() argument
972 sign_algo_cnt = le16_to_cpu(pneg_ctxt->SigningAlgorithmCount); in decode_sign_cap_ctxt()
982 if (pneg_ctxt->SigningAlgorithms[i] == SIGNING_ALG_HMAC_SHA256_LE || in decode_sign_cap_ctxt()
983 pneg_ctxt->SigningAlgorithms[i] == SIGNING_ALG_AES_CMAC_LE) { in decode_sign_cap_ctxt()
985 pneg_ctxt->SigningAlgorithms[i]); in decode_sign_cap_ctxt()
988 pneg_ctxt->SigningAlgorithms[i]; in decode_sign_cap_ctxt()