Skip to content

Commit bf7952d

Browse files
Josef 'Jeff' Sipekcmouse
Josef 'Jeff' Sipek
authored andcommitted
auth: Remove ntlm mechanism & the LANMAN and NTLM password schemes
1 parent d3d02fd commit bf7952d

20 files changed

+2
-1701
lines changed

COPYING

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
See AUTHORS file for list of copyright holders.
22

3-
Everything in src/lib/, src/auth/, src/lib-sql/ and src/lib-ntlm/ is under
4-
MIT license (see COPYING.MIT) unless otherwise mentioned at the beginning
5-
of the file.
3+
Everything in src/lib/, src/auth/, and src/lib-sql/ is under MIT license
4+
(see COPYING.MIT) unless otherwise mentioned at the beginning of the file.
65

76
Everything else is LGPLv2.1 (see COPYING.LGPL) unless otherwise mentioned
87
at the beginning of the file.

configure.ac

-1
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,6 @@ src/lib-ldap/Makefile
836836
src/lib-lua/Makefile
837837
src/lib-mail/Makefile
838838
src/lib-master/Makefile
839-
src/lib-ntlm/Makefile
840839
src/lib-program-client/Makefile
841840
src/lib-otp/Makefile
842841
src/lib-dovecot/Makefile

src/Makefile.am

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ SUBDIRS = \
4040
lib-index \
4141
lib-storage \
4242
lib-sql \
43-
lib-ntlm \
4443
lib-otp \
4544
lib-lda \
4645
lib-dict-backend \

src/auth/Makefile.am

-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ AM_CPPFLAGS = \
3232
-I$(top_srcdir)/src/lib-sql \
3333
-I$(top_srcdir)/src/lib-settings \
3434
-I$(top_srcdir)/src/lib-old-stats \
35-
-I$(top_srcdir)/src/lib-ntlm \
3635
-I$(top_srcdir)/src/lib-otp \
3736
-I$(top_srcdir)/src/lib-master \
3837
-I$(top_srcdir)/src/lib-oauth2 \
@@ -72,7 +71,6 @@ auth_libs = \
7271
libauth.la \
7372
libstats_auth.la \
7473
libpassword.la \
75-
../lib-ntlm/libntlm.la \
7674
../lib-otp/libotp.la \
7775
$(LIBDOVECOT_LUA) \
7876
$(LIBDOVECOT_SQL)
@@ -119,7 +117,6 @@ libauth_la_SOURCES = \
119117
mech-digest-md5.c \
120118
mech-external.c \
121119
mech-gssapi.c \
122-
mech-ntlm.c \
123120
mech-otp.c \
124121
mech-scram.c \
125122
mech-apop.c \
@@ -258,7 +255,6 @@ test_libs = \
258255
test_libpassword_SOURCES = test-libpassword.c
259256
test_libpassword_LDADD = \
260257
libpassword.la \
261-
../lib-ntlm/libntlm.la \
262258
../lib-otp/libotp.la \
263259
$(CRYPT_LIBS) \
264260
$(LIBDOVECOT_SQL) \

src/auth/mech-ntlm.c

-260
This file was deleted.

src/auth/mech.c

-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ extern const struct mech_module mech_apop;
7171
extern const struct mech_module mech_cram_md5;
7272
extern const struct mech_module mech_digest_md5;
7373
extern const struct mech_module mech_external;
74-
extern const struct mech_module mech_ntlm;
7574
extern const struct mech_module mech_otp;
7675
extern const struct mech_module mech_scram_sha1;
7776
extern const struct mech_module mech_scram_sha256;
@@ -203,7 +202,6 @@ void mech_init(const struct auth_settings *set)
203202
mech_register_module(&mech_winbind_ntlm);
204203
mech_register_module(&mech_winbind_spnego);
205204
} else {
206-
mech_register_module(&mech_ntlm);
207205
#if defined(HAVE_GSSAPI_SPNEGO) && defined(BUILTIN_GSSAPI)
208206
mech_register_module(&mech_gssapi_spnego);
209207
#endif
@@ -231,7 +229,6 @@ void mech_deinit(const struct auth_settings *set)
231229
mech_unregister_module(&mech_winbind_ntlm);
232230
mech_unregister_module(&mech_winbind_spnego);
233231
} else {
234-
mech_unregister_module(&mech_ntlm);
235232
#if defined(HAVE_GSSAPI_SPNEGO) && defined(BUILTIN_GSSAPI)
236233
mech_unregister_module(&mech_gssapi_spnego);
237234
#endif

src/auth/password-scheme.c

-29
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include "md5.h"
1010
#include "hmac.h"
1111
#include "hmac-cram-md5.h"
12-
#include "ntlm.h"
1312
#include "mycrypt.h"
1413
#include "randgen.h"
1514
#include "sha1.h"
@@ -710,32 +709,6 @@ plain_md5_generate(const char *plaintext, const struct password_generate_params
710709
*size_r = MD5_RESULTLEN;
711710
}
712711

713-
static void
714-
lm_generate(const char *plaintext, const struct password_generate_params *params ATTR_UNUSED,
715-
const unsigned char **raw_password_r, size_t *size_r)
716-
{
717-
unsigned char *digest;
718-
719-
digest = t_malloc_no0(LM_HASH_SIZE);
720-
lm_hash(plaintext, digest);
721-
722-
*raw_password_r = digest;
723-
*size_r = LM_HASH_SIZE;
724-
}
725-
726-
static void
727-
ntlm_generate(const char *plaintext, const struct password_generate_params *params ATTR_UNUSED,
728-
const unsigned char **raw_password_r, size_t *size_r)
729-
{
730-
unsigned char *digest;
731-
732-
digest = t_malloc_no0(NTLMSSP_HASH_SIZE);
733-
ntlm_v1_hash(plaintext, digest);
734-
735-
*raw_password_r = digest;
736-
*size_r = NTLMSSP_HASH_SIZE;
737-
}
738-
739712
static int otp_verify(const char *plaintext, const struct password_generate_params *params ATTR_UNUSED,
740713
const unsigned char *raw_password, size_t size,
741714
const char **error_r)
@@ -797,8 +770,6 @@ static const struct password_scheme builtin_schemes[] = {
797770
NULL, plain_md5_generate },
798771
{ "LDAP-MD5", PW_ENCODING_BASE64, MD5_RESULTLEN,
799772
NULL, plain_md5_generate },
800-
{ "LANMAN", PW_ENCODING_HEX, LM_HASH_SIZE, NULL, lm_generate },
801-
{ "NTLM", PW_ENCODING_HEX, NTLMSSP_HASH_SIZE, NULL, ntlm_generate },
802773
{ "OTP", PW_ENCODING_NONE, 0, otp_verify, otp_generate },
803774
{ "PBKDF2", PW_ENCODING_NONE, 0, pbkdf2_verify, pbkdf2_generate },
804775
};

0 commit comments

Comments
 (0)