From: Stephan Bosch Date: Thu, 3 Jun 2021 17:26:10 +0000 (+0200) Subject: auth: Move password-scheme code to lib-auth-common. X-Git-Tag: 2.4.0~3126 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d632abbf571f8e9157b1526533d677a1b8eb829;p=thirdparty%2Fdovecot%2Fcore.git auth: Move password-scheme code to lib-auth-common. --- diff --git a/configure.ac b/configure.ac index 79f5691538..640270aa17 100644 --- a/configure.ac +++ b/configure.ac @@ -539,6 +539,8 @@ LIBDOVECOT_LA_LIBS='\ $(top_builddir)/src/lib-imap/libimap.la \ $(top_builddir)/src/lib-mail/libmail.la \ $(top_builddir)/src/lib-sasl/libsasl.la \ + $(top_builddir)/src/lib-otp/libotp.la \ + $(top_builddir)/src/lib-auth/libauth.la \ $(top_builddir)/src/lib-auth-client/libauth-client.la \ $(top_builddir)/src/lib-charset/libcharset.la \ $(top_builddir)/src/lib-ssl-iostream/libssl_iostream.la \ diff --git a/src/Makefile.am b/src/Makefile.am index 7a651af658..e262511f4b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -9,6 +9,7 @@ LIBDOVECOT_SUBDIRS = \ lib-test \ lib \ lib-settings \ + lib-otp \ lib-auth \ lib-auth-client \ lib-dns \ @@ -43,7 +44,6 @@ SUBDIRS = \ lib-index \ lib-storage \ lib-sql \ - lib-otp \ lib-lda \ lib-dict-backend \ anvil \ diff --git a/src/auth/Makefile.am b/src/auth/Makefile.am index b967781564..2de1067e11 100644 --- a/src/auth/Makefile.am +++ b/src/auth/Makefile.am @@ -1,4 +1,4 @@ -noinst_LTLIBRARIES = libpassword.la libauth.la +noinst_LTLIBRARIES = libauth.la auth_moduledir = $(moduledir)/auth # automake seems to force making this unconditional.. @@ -61,22 +61,8 @@ AM_CPPFLAGS = \ auth_LDFLAGS = -export-dynamic -libpassword_la_SOURCES = \ - crypt-blowfish.c \ - mycrypt.c \ - password-scheme.c \ - password-scheme-crypt.c \ - password-scheme-md5crypt.c \ - password-scheme-scram.c \ - password-scheme-otp.c \ - password-scheme-pbkdf2.c \ - password-scheme-sodium.c -libpassword_la_CFLAGS = $(AM_CPPFLAGS) $(LIBSODIUM_CFLAGS) - auth_libs = \ libauth.la \ - libpassword.la \ - ../lib-auth/libauth.la \ ../lib-otp/libotp.la \ $(AUTH_LUA_LIBS) \ $(LIBDOVECOT_SQL) @@ -178,12 +164,10 @@ headers = \ db-passwd-file.h \ db-oauth2.h \ mech.h \ - mycrypt.h \ passdb.h \ passdb-blocking.h \ passdb-cache.h \ passdb-template.h \ - password-scheme.h \ userdb.h \ userdb-blocking.h \ userdb-template.h @@ -223,32 +207,17 @@ pkginc_libdir=$(pkgincludedir) pkginc_lib_HEADERS = $(headers) test_programs = \ - test-libpassword \ test-auth-cache \ test-auth \ test-mech noinst_PROGRAMS = $(test_programs) -noinst_HEADERS = test-auth.h crypt-blowfish.h db-lua.h +noinst_HEADERS = test-auth.h db-lua.h test_libs = \ ../lib-dovecot/libdovecot.la -test_libpassword_SOURCES = test-libpassword.c -test_libpassword_LDADD = \ - libpassword.la \ - ../lib-auth/libauth.la \ - ../lib-otp/libotp.la \ - $(CRYPT_LIBS) \ - $(LIBDOVECOT_SQL) \ - $(LIBSODIUM_LIBS) \ - $(test_libs) \ - $(BINARY_LDFLAGS) - -test_libpassword_DEPENDENCIES = libpassword.la -test_libpassword_CPPFLAGS = $(AM_CPPFLAGS) $(BINARY_CFLAGS) - test_auth_cache_SOURCES = auth-cache.c test-auth-cache.c test_auth_cache_LDADD = $(test_libs) test_auth_cache_DEPENDENCIES = $(pkglibexec_PROGRAMS) $(test_libs) diff --git a/src/doveadm/Makefile.am b/src/doveadm/Makefile.am index 247cac488b..ee30ce755d 100644 --- a/src/doveadm/Makefile.am +++ b/src/doveadm/Makefile.am @@ -26,7 +26,6 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/lib-imap-storage \ -I$(top_srcdir)/src/lib-http \ -I$(top_srcdir)/src/lib-dcrypt \ - -I$(top_srcdir)/src/auth \ -I$(top_srcdir)/src/stats \ -DMODULEDIR=\""$(moduledir)"\" \ -DAUTH_MODULE_DIR=\""$(moduledir)/auth"\" \ @@ -39,7 +38,6 @@ AM_CPPFLAGS = \ $(BINARY_CFLAGS) cmd_pw_libs = \ - ../auth/libpassword.la \ ../lib-auth/libauth.la \ ../lib-otp/libotp.la diff --git a/src/lib-auth/Makefile.am b/src/lib-auth/Makefile.am index 47d4136134..3cbbf7edd8 100644 --- a/src/lib-auth/Makefile.am +++ b/src/lib-auth/Makefile.am @@ -1,21 +1,44 @@ -noinst_LTLIBRARIES = libauth-common.la +noinst_LTLIBRARIES = libauth.la AM_CPPFLAGS = \ + $(LIBSODIUM_CFLAGS) \ -I$(top_srcdir)/src/lib \ - -I$(top_srcdir)/src/lib-test + -I$(top_srcdir)/src/lib-test \ + -I$(top_srcdir)/src/lib-otp -libauth_common_la_SOURCES = \ +libauth_la_SOURCES = \ + crypt-blowfish.c \ + mycrypt.c \ auth-scram.c \ - auth-scram-server.c + auth-scram-server.c \ + password-scheme.c \ + password-scheme-crypt.c \ + password-scheme-md5crypt.c \ + password-scheme-scram.c \ + password-scheme-otp.c \ + password-scheme-pbkdf2.c \ + password-scheme-sodium.c + +libauth_la_LIBADD = \ + $(LIBSODIUM_LIBS) \ + $(CRYPT_LIBS) +libauth_la_DEPENDENCIES = \ + $(LIBSODIUM_LIBS) \ + $(CRYPT_LIBS) headers = \ + mycrypt.h \ auth-scram.h \ - auth-scram-server.h + auth-scram-server.h \ + password-scheme.h pkginc_libdir=$(pkgincludedir) pkginc_lib_HEADERS = $(headers) -test_programs = +noinst_HEADERS = crypt-blowfish.h + +test_programs = \ + test-password-scheme noinst_PROGRAMS = $(test_programs) @@ -30,6 +53,17 @@ test_deps = \ ../lib-test/libtest.la \ ../lib/liblib.la +test_password_scheme_SOURCES = \ + test-password-scheme.c +test_password_scheme_LDFLAGS = -export-dynamic +test_password_scheme_LDADD = \ + $(test_libs) \ + ../lib-otp/libotp.la \ + $(CRYPT_LIBS) \ + $(LIBSODIUM_LIBS) +test_password_scheme_DEPENDENCIES = \ + $(test_deps) + check-local: for bin in $(test_programs); do \ if ! $(RUN_TEST) ./$$bin; then exit 1; fi; \ diff --git a/src/auth/crypt-blowfish.c b/src/lib-auth/crypt-blowfish.c similarity index 100% rename from src/auth/crypt-blowfish.c rename to src/lib-auth/crypt-blowfish.c diff --git a/src/auth/crypt-blowfish.h b/src/lib-auth/crypt-blowfish.h similarity index 100% rename from src/auth/crypt-blowfish.h rename to src/lib-auth/crypt-blowfish.h diff --git a/src/auth/mycrypt.c b/src/lib-auth/mycrypt.c similarity index 100% rename from src/auth/mycrypt.c rename to src/lib-auth/mycrypt.c diff --git a/src/auth/mycrypt.h b/src/lib-auth/mycrypt.h similarity index 100% rename from src/auth/mycrypt.h rename to src/lib-auth/mycrypt.h diff --git a/src/auth/password-scheme-crypt.c b/src/lib-auth/password-scheme-crypt.c similarity index 100% rename from src/auth/password-scheme-crypt.c rename to src/lib-auth/password-scheme-crypt.c diff --git a/src/auth/password-scheme-md5crypt.c b/src/lib-auth/password-scheme-md5crypt.c similarity index 100% rename from src/auth/password-scheme-md5crypt.c rename to src/lib-auth/password-scheme-md5crypt.c diff --git a/src/auth/password-scheme-otp.c b/src/lib-auth/password-scheme-otp.c similarity index 100% rename from src/auth/password-scheme-otp.c rename to src/lib-auth/password-scheme-otp.c diff --git a/src/auth/password-scheme-pbkdf2.c b/src/lib-auth/password-scheme-pbkdf2.c similarity index 100% rename from src/auth/password-scheme-pbkdf2.c rename to src/lib-auth/password-scheme-pbkdf2.c diff --git a/src/auth/password-scheme-scram.c b/src/lib-auth/password-scheme-scram.c similarity index 100% rename from src/auth/password-scheme-scram.c rename to src/lib-auth/password-scheme-scram.c diff --git a/src/auth/password-scheme-sodium.c b/src/lib-auth/password-scheme-sodium.c similarity index 100% rename from src/auth/password-scheme-sodium.c rename to src/lib-auth/password-scheme-sodium.c diff --git a/src/auth/password-scheme.c b/src/lib-auth/password-scheme.c similarity index 100% rename from src/auth/password-scheme.c rename to src/lib-auth/password-scheme.c diff --git a/src/auth/password-scheme.h b/src/lib-auth/password-scheme.h similarity index 100% rename from src/auth/password-scheme.h rename to src/lib-auth/password-scheme.h diff --git a/src/auth/test-libpassword.c b/src/lib-auth/test-password-scheme.c similarity index 100% rename from src/auth/test-libpassword.c rename to src/lib-auth/test-password-scheme.c