Index: sys/conf/NOTES =================================================================== RCS file: /home/ncvs/src/sys/conf/NOTES,v retrieving revision 1.1325.2.13 diff -d -u -I\$OpenBSD:.*\$ -I\$FreeBSD:.*\$ -I\$Id:.*\$ -I\$hrs:.*\$ -r1.1325.2.13 NOTES --- sys/conf/NOTES 23 Feb 2006 02:13:30 -0000 1.1325.2.13 +++ sys/conf/NOTES 2 Apr 2006 08:26:08 -0000 @@ -479,9 +479,7 @@ # SMB/CIFS requester # NETSMB enables support for SMB protocol, it requires LIBMCHAIN and LIBICONV # options. -# NETSMBCRYPTO enables support for encrypted passwords. options NETSMB #SMB/CIFS requester -options NETSMBCRYPTO #encrypted password support for SMB # mchain library. It can be either loaded as KLD or compiled into kernel options LIBMCHAIN Index: sys/conf/files =================================================================== RCS file: /home/ncvs/src/sys/conf/files,v retrieving revision 1.1031.2.26 diff -d -u -I\$OpenBSD:.*\$ -I\$FreeBSD:.*\$ -I\$Id:.*\$ -I\$hrs:.*\$ -r1.1031.2.26 files --- sys/conf/files 17 Mar 2006 01:47:06 -0000 1.1031.2.26 +++ sys/conf/files 2 Apr 2006 08:26:08 -0000 @@ -291,10 +291,10 @@ crypto/blowfish/bf_skey.c optional ipsec ipsec_esp crypto/des/des_ecb.c optional crypto crypto/des/des_ecb.c optional ipsec ipsec_esp -crypto/des/des_ecb.c optional netsmbcrypto +crypto/des/des_ecb.c optional netsmb crypto/des/des_setkey.c optional crypto crypto/des/des_setkey.c optional ipsec ipsec_esp -crypto/des/des_setkey.c optional netsmbcrypto +crypto/des/des_setkey.c optional netsmb crypto/rc4/rc4.c optional netgraph_mppc_encryption crypto/rijndael/rijndael-alg-fst.c optional crypto crypto/rijndael/rijndael-alg-fst.c optional geom_bde Index: sys/conf/files.alpha =================================================================== RCS file: /home/ncvs/src/sys/conf/files.alpha,v retrieving revision 1.121 diff -d -u -I\$OpenBSD:.*\$ -I\$FreeBSD:.*\$ -I\$Id:.*\$ -I\$hrs:.*\$ -r1.121 files.alpha --- sys/conf/files.alpha 14 Jun 2005 04:16:10 -0000 1.121 +++ sys/conf/files.alpha 2 Apr 2006 08:26:08 -0000 @@ -164,7 +164,7 @@ crypto/blowfish/bf_enc.c optional ipsec ipsec_esp crypto/des/des_enc.c optional crypto crypto/des/des_enc.c optional ipsec ipsec_esp -crypto/des/des_enc.c optional netsmbcrypto +crypto/des/des_enc.c optional netsmb dev/advansys/adv_isa.c optional adv isa dev/aic/aic_isa.c optional aic isa dev/atkbdc/atkbd.c optional atkbd atkbdc Index: sys/conf/files.amd64 =================================================================== RCS file: /home/ncvs/src/sys/conf/files.amd64,v retrieving revision 1.71.2.5 diff -d -u -I\$OpenBSD:.*\$ -I\$FreeBSD:.*\$ -I\$Id:.*\$ -I\$hrs:.*\$ -r1.71.2.5 files.amd64 --- sys/conf/files.amd64 26 Jan 2006 22:12:31 -0000 1.71.2.5 +++ sys/conf/files.amd64 2 Apr 2006 08:26:08 -0000 @@ -132,7 +132,7 @@ crypto/blowfish/bf_enc.c optional ipsec ipsec_esp crypto/des/des_enc.c optional crypto crypto/des/des_enc.c optional ipsec ipsec_esp -crypto/des/des_enc.c optional netsmbcrypto +crypto/des/des_enc.c optional netsmb dev/acpica/acpi_if.m standard dev/arcmsr/arcmsr.c optional arcmsr pci dev/atkbdc/atkbd.c optional atkbd atkbdc Index: sys/conf/files.i386 =================================================================== RCS file: /home/ncvs/src/sys/conf/files.i386,v retrieving revision 1.538.2.4 diff -d -u -I\$OpenBSD:.*\$ -I\$FreeBSD:.*\$ -I\$Id:.*\$ -I\$hrs:.*\$ -r1.538.2.4 files.i386 --- sys/conf/files.i386 10 Mar 2006 23:27:40 -0000 1.538.2.4 +++ sys/conf/files.i386 2 Apr 2006 08:26:08 -0000 @@ -127,7 +127,7 @@ compile-with "${CC} -c -I$S/crypto/blowfish/arch/i386 ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}" \ no-implicit-rule crypto/des/arch/i386/des_enc.S optional ipsec ipsec_esp -crypto/des/arch/i386/des_enc.S optional netsmbcrypto +crypto/des/arch/i386/des_enc.S optional netsmb bf_enc.o optional crypto \ dependency "$S/crypto/blowfish/arch/i386/bf_enc.S $S/crypto/blowfish/arch/i386/bf_enc_586.S $S/crypto/blowfish/arch/i386/bf_enc_686.S" \ compile-with "${CC} -c -I$S/crypto/blowfish/arch/i386 ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}" \ Index: sys/conf/files.ia64 =================================================================== RCS file: /home/ncvs/src/sys/conf/files.ia64,v retrieving revision 1.81 diff -d -u -I\$OpenBSD:.*\$ -I\$FreeBSD:.*\$ -I\$Id:.*\$ -I\$hrs:.*\$ -r1.81 files.ia64 --- sys/conf/files.ia64 30 Jun 2005 07:49:21 -0000 1.81 +++ sys/conf/files.ia64 2 Apr 2006 08:26:08 -0000 @@ -46,7 +46,7 @@ crypto/blowfish/bf_enc.c optional ipsec ipsec_esp crypto/des/des_enc.c optional crypto crypto/des/des_enc.c optional ipsec ipsec_esp -crypto/des/des_enc.c optional netsmbcrypto +crypto/des/des_enc.c optional netsmb dev/advansys/adv_isa.c optional adv isa dev/aic/aic_isa.c optional aic isa dev/atkbdc/atkbd.c optional atkbd atkbdc Index: sys/conf/files.pc98 =================================================================== RCS file: /home/ncvs/src/sys/conf/files.pc98,v retrieving revision 1.327.2.3 diff -d -u -I\$OpenBSD:.*\$ -I\$FreeBSD:.*\$ -I\$Id:.*\$ -I\$hrs:.*\$ -r1.327.2.3 files.pc98 --- sys/conf/files.pc98 10 Mar 2006 23:27:40 -0000 1.327.2.3 +++ sys/conf/files.pc98 2 Apr 2006 08:26:08 -0000 @@ -83,7 +83,7 @@ compile-with "${CC} -c -I$S/crypto/blowfish/arch/i386 ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}" \ no-implicit-rule crypto/des/arch/i386/des_enc.S optional ipsec ipsec_esp -crypto/des/arch/i386/des_enc.S optional netsmbcrypto +crypto/des/arch/i386/des_enc.S optional netsmb bf_enc.o optional crypto \ dependency "$S/crypto/blowfish/arch/i386/bf_enc.S $S/crypto/blowfish/arch/i386/bf_enc_586.S $S/crypto/blowfish/arch/i386/bf_enc_686.S" \ compile-with "${CC} -c -I$S/crypto/blowfish/arch/i386 ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}" \ Index: sys/conf/files.powerpc =================================================================== RCS file: /home/ncvs/src/sys/conf/files.powerpc,v retrieving revision 1.44.2.1 diff -d -u -I\$OpenBSD:.*\$ -I\$FreeBSD:.*\$ -I\$Id:.*\$ -I\$hrs:.*\$ -r1.44.2.1 files.powerpc --- sys/conf/files.powerpc 8 Dec 2005 10:56:46 -0000 1.44.2.1 +++ sys/conf/files.powerpc 2 Apr 2006 08:26:08 -0000 @@ -70,7 +70,7 @@ crypto/blowfish/bf_enc.c optional ipsec ipsec_esp crypto/des/des_enc.c optional ipsec ipsec_esp -crypto/des/des_enc.c optional netsmbcrypto +crypto/des/des_enc.c optional netsmb dev/ofw/openfirm.c standard dev/ofw/ofw_bus_if.m standard Index: sys/conf/files.sparc64 =================================================================== RCS file: /home/ncvs/src/sys/conf/files.sparc64,v retrieving revision 1.73.2.1 diff -d -u -I\$OpenBSD:.*\$ -I\$FreeBSD:.*\$ -I\$Id:.*\$ -I\$hrs:.*\$ -r1.73.2.1 files.sparc64 --- sys/conf/files.sparc64 13 Feb 2006 11:39:01 -0000 1.73.2.1 +++ sys/conf/files.sparc64 2 Apr 2006 08:26:08 -0000 @@ -22,7 +22,7 @@ crypto/blowfish/bf_enc.c optional ipsec ipsec_esp crypto/des/des_enc.c optional crypto crypto/des/des_enc.c optional ipsec ipsec_esp -crypto/des/des_enc.c optional netsmbcrypto +crypto/des/des_enc.c optional netsmb dev/atkbdc/atkbd.c optional atkbd atkbdc dev/atkbdc/atkbd_atkbdc.c optional atkbd atkbdc dev/atkbdc/atkbdc.c optional atkbdc Index: sys/conf/options =================================================================== RCS file: /home/ncvs/src/sys/conf/options,v retrieving revision 1.510.2.4 diff -d -u -I\$OpenBSD:.*\$ -I\$FreeBSD:.*\$ -I\$Id:.*\$ -I\$hrs:.*\$ -r1.510.2.4 options --- sys/conf/options 9 Mar 2006 21:50:59 -0000 1.510.2.4 +++ sys/conf/options 2 Apr 2006 08:26:08 -0000 @@ -234,7 +234,8 @@ # SMB/CIFS requester NETSMB opt_netsmb.h -NETSMBCRYPTO opt_netsmb.h +# Obsolete +NETSMBCRYPTO opt_dontuse.h # Experimental support for large MS-DOS filesystems; SEE WARNING IN "NOTES"! MSDOSFS_LARGE opt_msdosfs.h Index: sys/modules/smbfs/Makefile =================================================================== RCS file: /home/ncvs/src/sys/modules/smbfs/Makefile,v retrieving revision 1.9.2.1 diff -d -u -I\$OpenBSD:.*\$ -I\$FreeBSD:.*\$ -I\$Id:.*\$ -I\$hrs:.*\$ -r1.9.2.1 Makefile --- sys/modules/smbfs/Makefile 10 Feb 2006 00:38:06 -0000 1.9.2.1 +++ sys/modules/smbfs/Makefile 2 Apr 2006 08:26:08 -0000 @@ -19,16 +19,13 @@ smbfs_vfsops.c smbfs_node.c smbfs_io.c smbfs_vnops.c \ smbfs_subr.c smbfs_smb.c -NETSMBCRYPTO= - -.if defined(NETSMBCRYPTO) +# NETSMBCRYPTO SRCS+= des_ecb.c des_setkey.c .if ${MACHINE_ARCH} == "i386" SRCS+= des_enc.S .else SRCS+= des_enc.c .endif -.endif # Build with IPX support (1|0) SMB_IPX?= 0 @@ -52,12 +49,6 @@ opt_ipx.h: echo "#define IPX 1" > ${.TARGET} .endif - -# XXX netsmb should be a separate module -.if defined(NETSMBCRYPTO) -opt_netsmb.h: - echo "#define NETSMBCRYPTO 1" > ${.TARGET} -.endif .endif .include Index: sys/netsmb/smb_crypt.c =================================================================== RCS file: /home/ncvs/src/sys/netsmb/smb_crypt.c,v retrieving revision 1.8 diff -d -u -I\$OpenBSD:.*\$ -I\$FreeBSD:.*\$ -I\$Id:.*\$ -I\$hrs:.*\$ -r1.8 smb_crypt.c --- sys/netsmb/smb_crypt.c 7 Jan 2005 01:45:49 -0000 1.8 +++ sys/netsmb/smb_crypt.c 2 Apr 2006 08:26:08 -0000 @@ -59,12 +59,10 @@ #include #include -#include "opt_netsmb.h" - -#ifdef NETSMBCRYPTO - #include +#include "opt_netsmb.h" + static u_char N8[] = {0x4b, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25}; @@ -87,13 +85,11 @@ des_ecb_encrypt((des_cblock *)data, (des_cblock *)dest, *ksp, 1); free(ksp, M_SMBTEMP); } -#endif int smb_encrypt(const u_char *apwd, u_char *C8, u_char *RN) { -#ifdef NETSMBCRYPTO u_char *p, *P14, *S21; p = malloc(14 + 21, M_SMBTEMP, M_WAITOK); @@ -112,17 +108,11 @@ smb_E(S21 + 14, C8, RN + 16); free(p, M_SMBTEMP); return 0; -#else - SMBERROR("password encryption is not available\n"); - bzero(RN, 24); - return EAUTH; -#endif } int smb_ntencrypt(const u_char *apwd, u_char *C8, u_char *RN) { -#ifdef NETSMBCRYPTO u_char S21[21]; u_int16_t *unipwd; MD4_CTX *ctxp; @@ -146,11 +136,6 @@ smb_E(S21 + 7, C8, RN + 8); smb_E(S21 + 14, C8, RN + 16); return 0; -#else - SMBERROR("password encryption is not available\n"); - bzero(RN, 24); - return EAUTH; -#endif } /* @@ -159,7 +144,6 @@ int smb_calcmackey(struct smb_vc *vcp) { -#ifdef NETSMBCRYPTO const char *pwd; u_int16_t *unipwd; int len; @@ -210,10 +194,6 @@ smb_E(S21 + 14, vcp->vc_ch, vcp->vc_mackey + 32); return (0); -#else - panic("smb_calcmackey: encryption not available"); - return (0); -#endif /* NETSMBCRYPTO */ } /* @@ -222,7 +202,6 @@ int smb_rq_sign(struct smb_rq *rqp) { -#ifdef NETSMBCRYPTO struct smb_vc *vcp = rqp->sr_vc; struct mbchain *mbp; struct mbuf *mb; @@ -278,10 +257,6 @@ bcopy(digest, rqp->sr_rqsig, 8); return (0); -#else - panic("smb_rq_sign: encryption not available"); - return (0); -#endif /* NETSMBCRYPTO */ } /* @@ -290,7 +265,6 @@ int smb_rq_verify(struct smb_rq *rqp) { -#ifdef NETSMBCRYPTO struct smb_vc *vcp = rqp->sr_vc; struct mdchain *mdp; u_char sigbuf[8]; @@ -332,8 +306,4 @@ return (EAUTH); return (0); -#else - panic("smb_rq_verify: encryption not available"); - return (0); -#endif /* NETSMBCRYPTO */ } Index: sys/netsmb/smb_smb.c =================================================================== RCS file: /home/ncvs/src/sys/netsmb/smb_smb.c,v retrieving revision 1.13 diff -d -u -I\$OpenBSD:.*\$ -I\$FreeBSD:.*\$ -I\$Id:.*\$ -I\$hrs:.*\$ -r1.13 smb_smb.c --- sys/netsmb/smb_smb.c 7 Jan 2005 01:45:49 -0000 1.13 +++ sys/netsmb/smb_smb.c 2 Apr 2006 08:26:08 -0000 @@ -197,10 +197,8 @@ vcp->vc_chlen = sblen; vcp->obj.co_flags |= SMBV_ENCRYPT; } -#ifdef NETSMBCRYPTO if (sp->sv_sm & SMB_SM_SIGS_REQUIRE) vcp->vc_hflags2 |= SMB_FLAGS2_SECURITY_SIGNATURE; -#endif vcp->vc_hflags2 |= SMB_FLAGS2_KNOWS_LONG_NAMES; if (dp->d_id == SMB_DIALECT_NTLM0_12 && sp->sv_maxtx < 4096 &&