aboutsummaryrefslogtreecommitdiff
path: root/sys/netsmb/smb_iod.c
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2004-01-02 22:38:42 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2004-01-02 22:38:42 +0000
commit190b2c4f8a6d2316cad8a8f5e58267809c8f3f21 (patch)
tree29bfe46dba0ee266c5a94f793d668ed1a19215ab /sys/netsmb/smb_iod.c
parentade996adb6a25e94d80f3d6ff4569e02dab8e6ec (diff)
downloadsrc-190b2c4f8a6d2316cad8a8f5e58267809c8f3f21.tar.gz
src-190b2c4f8a6d2316cad8a8f5e58267809c8f3f21.zip
Add support for SMB request signing, which prevents "man in the middle"
attacks and is required to connect to Windows 2003 servers in their default configuration. This adds an extra field to the SMB header containing the truncated 64-bit MD5 digest of a key (a function of the user's password and the server's authentication challenge), an implicit sequence number, and the message data itself. As signing each message imposes a significant performance penalty, we only enable it if the server will not let us connect without it; this should eventually become an option to mount_smbfs.
Notes
Notes: svn path=/head/; revision=124087
Diffstat (limited to 'sys/netsmb/smb_iod.c')
-rw-r--r--sys/netsmb/smb_iod.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/netsmb/smb_iod.c b/sys/netsmb/smb_iod.c
index ae9c45723060..e2abac56bcbf 100644
--- a/sys/netsmb/smb_iod.c
+++ b/sys/netsmb/smb_iod.c
@@ -247,6 +247,8 @@ smb_iod_sendrq(struct smbiod *iod, struct smb_rq *rqp)
*rqp->sr_rqtid = htole16(ssp ? ssp->ss_tid : SMB_TID_UNKNOWN);
*rqp->sr_rquid = htole16(vcp ? vcp->vc_smbuid : 0);
mb_fixhdr(&rqp->sr_rq);
+ if (vcp->vc_hflags2 & SMB_FLAGS2_SECURITY_SIGNATURE)
+ smb_rq_sign(rqp);
}
if (rqp->sr_sendcnt++ > 5) {
rqp->sr_flags |= SMBR_RESTART;