diff options
author | tjr <tjr@FreeBSD.org> | 2004-01-02 22:38:42 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2004-01-02 22:38:42 +0000 |
commit | 622d03664527d3d3fe721e79f2dd24ecc197b6be (patch) | |
tree | 29bfe46dba0ee266c5a94f793d668ed1a19215ab /sys/netsmb/smb_conn.c | |
parent | 48774c9608c496e940be2db40ae36281f17e0e3d (diff) | |
download | FreeBSD-src-622d03664527d3d3fe721e79f2dd24ecc197b6be.zip FreeBSD-src-622d03664527d3d3fe721e79f2dd24ecc197b6be.tar.gz |
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.
Diffstat (limited to 'sys/netsmb/smb_conn.c')
-rw-r--r-- | sys/netsmb/smb_conn.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/netsmb/smb_conn.c b/sys/netsmb/smb_conn.c index 23eb4be..7ea63ee 100644 --- a/sys/netsmb/smb_conn.c +++ b/sys/netsmb/smb_conn.c @@ -405,6 +405,9 @@ smb_vc_create(struct smb_vcspec *vcspec, vcp->vc_mode = vcspec->rights & SMBM_MASK; vcp->obj.co_flags = vcspec->flags & (SMBV_PRIVATE | SMBV_SINGLESHARE); vcp->vc_tdesc = &smb_tran_nbtcp_desc; + vcp->vc_seqno = 0; + vcp->vc_mackey = NULL; + vcp->vc_mackeylen = 0; if (uid == SMBM_ANY_OWNER) uid = realuid; @@ -474,6 +477,8 @@ smb_vc_free(struct smb_connobj *cp) SMB_STRFREE(vcp->vc_srvname); SMB_STRFREE(vcp->vc_pass); SMB_STRFREE(vcp->vc_domain); + if (vcp->vc_mackey) + free(vcp->vc_mackey, M_SMBTEMP); if (vcp->vc_paddr) free(vcp->vc_paddr, M_SONAME); if (vcp->vc_laddr) |