Lines Matching refs:pneg_ctxt

763 static void build_preauth_ctxt(struct smb2_preauth_neg_context *pneg_ctxt,  in build_preauth_ctxt()  argument
766 pneg_ctxt->ContextType = SMB2_PREAUTH_INTEGRITY_CAPABILITIES; in build_preauth_ctxt()
767 pneg_ctxt->DataLength = cpu_to_le16(38); in build_preauth_ctxt()
768 pneg_ctxt->HashAlgorithmCount = cpu_to_le16(1); in build_preauth_ctxt()
769 pneg_ctxt->Reserved = cpu_to_le32(0); in build_preauth_ctxt()
770 pneg_ctxt->SaltLength = cpu_to_le16(SMB311_SALT_SIZE); in build_preauth_ctxt()
771 get_random_bytes(pneg_ctxt->Salt, SMB311_SALT_SIZE); in build_preauth_ctxt()
772 pneg_ctxt->HashAlgorithms = hash_id; in build_preauth_ctxt()
775 static void build_encrypt_ctxt(struct smb2_encryption_neg_context *pneg_ctxt, in build_encrypt_ctxt() argument
778 pneg_ctxt->ContextType = SMB2_ENCRYPTION_CAPABILITIES; in build_encrypt_ctxt()
779 pneg_ctxt->DataLength = cpu_to_le16(4); in build_encrypt_ctxt()
780 pneg_ctxt->Reserved = cpu_to_le32(0); in build_encrypt_ctxt()
781 pneg_ctxt->CipherCount = cpu_to_le16(1); in build_encrypt_ctxt()
782 pneg_ctxt->Ciphers[0] = cipher_type; in build_encrypt_ctxt()
785 static void build_sign_cap_ctxt(struct smb2_signing_capabilities *pneg_ctxt, in build_sign_cap_ctxt() argument
788 pneg_ctxt->ContextType = SMB2_SIGNING_CAPABILITIES; in build_sign_cap_ctxt()
789 pneg_ctxt->DataLength = in build_sign_cap_ctxt()
792 pneg_ctxt->Reserved = cpu_to_le32(0); in build_sign_cap_ctxt()
793 pneg_ctxt->SigningAlgorithmCount = cpu_to_le16(1); in build_sign_cap_ctxt()
794 pneg_ctxt->SigningAlgorithms[0] = sign_algo; in build_sign_cap_ctxt()
797 static void build_posix_ctxt(struct smb2_posix_neg_context *pneg_ctxt) in build_posix_ctxt() argument
799 pneg_ctxt->ContextType = SMB2_POSIX_EXTENSIONS_AVAILABLE; in build_posix_ctxt()
800 pneg_ctxt->DataLength = cpu_to_le16(POSIX_CTXT_DATA_LEN); in build_posix_ctxt()
802 pneg_ctxt->Name[0] = 0x93; in build_posix_ctxt()
803 pneg_ctxt->Name[1] = 0xAD; in build_posix_ctxt()
804 pneg_ctxt->Name[2] = 0x25; in build_posix_ctxt()
805 pneg_ctxt->Name[3] = 0x50; in build_posix_ctxt()
806 pneg_ctxt->Name[4] = 0x9C; in build_posix_ctxt()
807 pneg_ctxt->Name[5] = 0xB4; in build_posix_ctxt()
808 pneg_ctxt->Name[6] = 0x11; in build_posix_ctxt()
809 pneg_ctxt->Name[7] = 0xE7; in build_posix_ctxt()
810 pneg_ctxt->Name[8] = 0xB4; in build_posix_ctxt()
811 pneg_ctxt->Name[9] = 0x23; in build_posix_ctxt()
812 pneg_ctxt->Name[10] = 0x83; in build_posix_ctxt()
813 pneg_ctxt->Name[11] = 0xDE; in build_posix_ctxt()
814 pneg_ctxt->Name[12] = 0x96; in build_posix_ctxt()
815 pneg_ctxt->Name[13] = 0x8B; in build_posix_ctxt()
816 pneg_ctxt->Name[14] = 0xCD; in build_posix_ctxt()
817 pneg_ctxt->Name[15] = 0x7C; in build_posix_ctxt()
823 char * const pneg_ctxt = (char *)rsp + in assemble_neg_contexts() local
830 build_preauth_ctxt((struct smb2_preauth_neg_context *)pneg_ctxt, in assemble_neg_contexts()
840 (pneg_ctxt + ctxt_size), in assemble_neg_contexts()
854 (pneg_ctxt + ctxt_size)); in assemble_neg_contexts()
864 (pneg_ctxt + ctxt_size), in assemble_neg_contexts()
875 struct smb2_preauth_neg_context *pneg_ctxt, in decode_preauth_ctxt() argument
886 if (pneg_ctxt->HashAlgorithms != SMB2_PREAUTH_INTEGRITY_SHA512) in decode_preauth_ctxt()
894 struct smb2_encryption_neg_context *pneg_ctxt, in decode_encrypt_ctxt() argument
907 cph_cnt = le16_to_cpu(pneg_ctxt->CipherCount); in decode_encrypt_ctxt()
920 if (pneg_ctxt->Ciphers[i] == SMB2_ENCRYPTION_AES128_GCM || in decode_encrypt_ctxt()
921 pneg_ctxt->Ciphers[i] == SMB2_ENCRYPTION_AES128_CCM || in decode_encrypt_ctxt()
922 pneg_ctxt->Ciphers[i] == SMB2_ENCRYPTION_AES256_CCM || in decode_encrypt_ctxt()
923 pneg_ctxt->Ciphers[i] == SMB2_ENCRYPTION_AES256_GCM) { in decode_encrypt_ctxt()
925 pneg_ctxt->Ciphers[i]); in decode_encrypt_ctxt()
926 conn->cipher_type = pneg_ctxt->Ciphers[i]; in decode_encrypt_ctxt()
952 struct smb2_compression_capabilities_context *pneg_ctxt) in decode_compress_ctxt() argument
958 struct smb2_signing_capabilities *pneg_ctxt, in decode_sign_cap_ctxt() argument
970 sign_algo_cnt = le16_to_cpu(pneg_ctxt->SigningAlgorithmCount); in decode_sign_cap_ctxt()
980 if (pneg_ctxt->SigningAlgorithms[i] == SIGNING_ALG_HMAC_SHA256_LE || in decode_sign_cap_ctxt()
981 pneg_ctxt->SigningAlgorithms[i] == SIGNING_ALG_AES_CMAC_LE) { in decode_sign_cap_ctxt()
983 pneg_ctxt->SigningAlgorithms[i]); in decode_sign_cap_ctxt()
986 pneg_ctxt->SigningAlgorithms[i]; in decode_sign_cap_ctxt()