]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Move password-scheme code to lib-auth-common.
authorStephan Bosch <stephan.bosch@open-xchange.com>
Thu, 3 Jun 2021 17:26:10 +0000 (19:26 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 27 Jan 2023 09:34:54 +0000 (09:34 +0000)
18 files changed:
configure.ac
src/Makefile.am
src/auth/Makefile.am
src/doveadm/Makefile.am
src/lib-auth/Makefile.am
src/lib-auth/crypt-blowfish.c [moved from src/auth/crypt-blowfish.c with 100% similarity]
src/lib-auth/crypt-blowfish.h [moved from src/auth/crypt-blowfish.h with 100% similarity]
src/lib-auth/mycrypt.c [moved from src/auth/mycrypt.c with 100% similarity]
src/lib-auth/mycrypt.h [moved from src/auth/mycrypt.h with 100% similarity]
src/lib-auth/password-scheme-crypt.c [moved from src/auth/password-scheme-crypt.c with 100% similarity]
src/lib-auth/password-scheme-md5crypt.c [moved from src/auth/password-scheme-md5crypt.c with 100% similarity]
src/lib-auth/password-scheme-otp.c [moved from src/auth/password-scheme-otp.c with 100% similarity]
src/lib-auth/password-scheme-pbkdf2.c [moved from src/auth/password-scheme-pbkdf2.c with 100% similarity]
src/lib-auth/password-scheme-scram.c [moved from src/auth/password-scheme-scram.c with 100% similarity]
src/lib-auth/password-scheme-sodium.c [moved from src/auth/password-scheme-sodium.c with 100% similarity]
src/lib-auth/password-scheme.c [moved from src/auth/password-scheme.c with 100% similarity]
src/lib-auth/password-scheme.h [moved from src/auth/password-scheme.h with 100% similarity]
src/lib-auth/test-password-scheme.c [moved from src/auth/test-libpassword.c with 100% similarity]

index 79f56915388f3f426aebe6d37125b311ef764f44..640270aa170c22c08f794b83115964d340fa3cee 100644 (file)
@@ -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 \
index 7a651af658b9acc1ac4808f9eee22a1cf01f9b31..e262511f4bd20093a464014fc6b98f05f1bd8ef7 100644 (file)
@@ -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 \
index b967781564496aa3347896034d381d353157e4f8..2de1067e117b7a692f25b919224719e99afe91fc 100644 (file)
@@ -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)
index 247cac488b50c1f97997fb8abbbbf8577c7e95db..ee30ce755dc36b98932ac15fa51a66a81967086c 100644 (file)
@@ -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
 
index 47d4136134208379bdfc54b2eaa92c7cfe4e7082..3cbbf7edd818af6ff347bc6f51fdd709d397e073 100644 (file)
@@ -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; \
similarity index 100%
rename from src/auth/mycrypt.c
rename to src/lib-auth/mycrypt.c
similarity index 100%
rename from src/auth/mycrypt.h
rename to src/lib-auth/mycrypt.h