Lines Matching refs:cifs_pdu
40 static int cifs_calculate_signature(const struct smb_hdr *cifs_pdu, in cifs_calculate_signature() argument
45 if (cifs_pdu == NULL || signature == NULL || server == NULL) in cifs_calculate_signature()
63 cifs_pdu->Protocol, cifs_pdu->smb_buf_length); in cifs_calculate_signature()
71 int cifs_sign_smb(struct smb_hdr *cifs_pdu, struct TCP_Server_Info *server, in cifs_sign_smb() argument
77 if ((cifs_pdu == NULL) || (server == NULL)) in cifs_sign_smb()
80 if ((cifs_pdu->Flags2 & SMBFLG2_SECURITY_SIGNATURE) == 0) in cifs_sign_smb()
83 cifs_pdu->Signature.Sequence.SequenceNumber = in cifs_sign_smb()
85 cifs_pdu->Signature.Sequence.Reserved = 0; in cifs_sign_smb()
90 rc = cifs_calculate_signature(cifs_pdu, server, smb_signature); in cifs_sign_smb()
92 memset(cifs_pdu->Signature.SecuritySignature, 0, 8); in cifs_sign_smb()
94 memcpy(cifs_pdu->Signature.SecuritySignature, smb_signature, 8); in cifs_sign_smb()
152 struct smb_hdr *cifs_pdu = iov[0].iov_base; in cifs_sign_smb2() local
154 if ((cifs_pdu == NULL) || (server == NULL)) in cifs_sign_smb2()
157 if ((cifs_pdu->Flags2 & SMBFLG2_SECURITY_SIGNATURE) == 0) in cifs_sign_smb2()
160 cifs_pdu->Signature.Sequence.SequenceNumber = in cifs_sign_smb2()
162 cifs_pdu->Signature.Sequence.Reserved = 0; in cifs_sign_smb2()
169 memset(cifs_pdu->Signature.SecuritySignature, 0, 8); in cifs_sign_smb2()
171 memcpy(cifs_pdu->Signature.SecuritySignature, smb_signature, 8); in cifs_sign_smb2()
176 int cifs_verify_signature(struct smb_hdr *cifs_pdu, in cifs_verify_signature() argument
184 if (cifs_pdu == NULL || server == NULL) in cifs_verify_signature()
187 if (cifs_pdu->Command == SMB_COM_NEGOTIATE) in cifs_verify_signature()
190 if (cifs_pdu->Command == SMB_COM_LOCKING_ANDX) { in cifs_verify_signature()
192 (struct smb_com_lock_req *)cifs_pdu; in cifs_verify_signature()
201 if (memcmp(cifs_pdu->Signature.SecuritySignature, "BSRSPYL ", 8) == 0) in cifs_verify_signature()
203 cifs_pdu->Command); in cifs_verify_signature()
207 memcpy(server_response_sig, cifs_pdu->Signature.SecuritySignature, 8); in cifs_verify_signature()
209 cifs_pdu->Signature.Sequence.SequenceNumber = in cifs_verify_signature()
211 cifs_pdu->Signature.Sequence.Reserved = 0; in cifs_verify_signature()
214 rc = cifs_calculate_signature(cifs_pdu, server, in cifs_verify_signature()