Skip to content

Commit

Permalink
Don't ignore errors on encrypting password in SMBTcon
Browse files Browse the repository at this point in the history
Although unlikely to fail (and tree connect does not commonly send
a password since SECMODE_USER is the default for most servers)
do not ignore errors on SMBNTEncrypt in SMB Tree Connect.

Reported by Coverity (CID 1226853)

Signed-off-by: Steve French <[email protected]>
Acked-by: Shirish Pargaonkar <[email protected]>
Acked-by: Sachin Prabhu <[email protected]>
Reviewed-by: Jeff Layton <[email protected]>
  • Loading branch information
smfrench committed Apr 1, 2015
1 parent 75fdfc8 commit f3a31a2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/cifs/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -3696,6 +3696,12 @@ CIFSTCon(const unsigned int xid, struct cifs_ses *ses,
#endif /* CIFS_WEAK_PW_HASH */
rc = SMBNTencrypt(tcon->password, ses->server->cryptkey,
bcc_ptr, nls_codepage);
if (rc) {
cifs_dbg(FYI, "%s Can't generate NTLM rsp. Error: %d\n",
__func__, rc);
cifs_buf_release(smb_buffer);
return rc;
}

bcc_ptr += CIFS_AUTH_RESP_SIZE;
if (ses->capabilities & CAP_UNICODE) {
Expand Down

0 comments on commit f3a31a2

Please sign in to comment.