krb5 commit: Build and install SPAKE module for Windows

Greg Hudson <[email protected]>
Newsgroups gmane.comp.encryption.kerberos.cvs
Message-ID <[email protected]>
https://github.com/krb5/krb5/commit/7692be7ccc3c5c993fdb43a11f51580cb56f7b5b
commit 7692be7ccc3c5c993fdb43a11f51580cb56f7b5b
Author: Greg Hudson <[email protected]>
Date:   Wed May 16 10:17:34 2018 -0700

    Build and install SPAKE module for Windows
    
    For now only the edwards25519 group is supported, since we are not
    adding an OpenSSL dependency.
    
    ticket: 8657

 src/Makefile.in                        |   11 +++++++++--
 src/config/win-pre.in                  |    2 ++
 src/lib/krb5_32.def                    |   11 +++++++++++
 src/plugins/preauth/spake/Makefile.in  |   18 ++++++++++++++++++
 src/plugins/preauth/spake/spake.def    |    3 +++
 src/windows/installer/wix/config.wxi   |    1 +
 src/windows/installer/wix/features.wxi |    3 +++
 src/windows/installer/wix/files.wxi    |   21 +++++++++++++++++++++
 src/windows/installer/wix/platform.wxi |    6 ++++++
 9 files changed, 74 insertions(+), 2 deletions(-)

diff --git a/src/Makefile.in b/src/Makefile.in
index bd7a2dc..fee0ea7 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -31,7 +31,7 @@ SUBDIRS=util include lib \
 	plugins/tls/k5tls \
 	kdc kadmin slave clients appl tests \
 	config-files build-tools man doc @po@
-WINSUBDIRS=include util lib ccapi windows clients appl
+WINSUBDIRS=include util lib ccapi windows clients appl plugins\preauth\spake
 BUILDTOP=$(REL).
 
 SRCS =  
@@ -153,7 +153,8 @@ WINMAKEFILES=Makefile \
 	util\wshelper\Makefile \
 	windows\Makefile windows\lib\Makefile windows\ms2mit\Makefile \
 	windows\kfwlogon\Makefile windows\leashdll\Makefile \
-	windows\leash\Makefile windows\leash\htmlhelp\Makefile
+	windows\leash\Makefile windows\leash\htmlhelp\Makefile \
+	plugins\preauth\spake\Makefile
 
 ##DOS##Makefile-windows: $(MKFDEP) $(WINMAKEFILES)
 
@@ -279,6 +280,8 @@ WINMAKEFILES=Makefile \
 ##DOS##	$(WCONFIG) config < [email protected] > $@
 ##DOS##windows\leash\htmlhelp\Makefile: windows\leash\htmlhelp\Makefile.in $(MKFDEP)
 ##DOS##	$(WCONFIG) config < [email protected] > $@
+##DOS##plugins\preauth\spake\Makefile: plugins\preauth\spake\Makefile.in $(MKFDEP)
+##DOS##	$(WCONFIG) config < [email protected] > $@
 
 clean-windows:: Makefile-windows
 
@@ -430,6 +433,8 @@ install-windows:
 	@if not exist "$(KRB_INSTALL_DIR)\include\gssapi\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\include\gssapi"
 	@if not exist "$(KRB_INSTALL_DIR)\lib\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\lib"
 	@if not exist "$(KRB_INSTALL_DIR)\bin\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\bin"
+	@if not exist "$(KRB_INSTALL_DIR)\bin\plugins\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\bin\plugins"
+	@if not exist "$(KRB_INSTALL_DIR)\bin\plugins\preauth\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\bin\plugins\preauth"
 	copy include\krb5.h "$(KRB_INSTALL_DIR)\include\."
 	copy include\krb5\krb5.h "$(KRB_INSTALL_DIR)\include\krb5\."
 	copy include\win-mac.h "$(KRB_INSTALL_DIR)\include\."
@@ -485,6 +490,8 @@ install-windows:
 	$(INSTALLDBGSYMS) clients\kdeltkt\$(OUTPRE)kdeltkt.pdb "$(KRB_INSTALL_DIR)\bin\."
 	$(INSTALLDBGSYMS) clients\kpasswd\$(OUTPRE)kpasswd.pdb "$(KRB_INSTALL_DIR)\bin\."
 	$(INSTALLDBGSYMS) clients\kswitch\$(OUTPRE)kswitch.pdb "$(KRB_INSTALL_DIR)\bin\."
+	copy plugins\preauth\spake\$(OUTPRE)$(SPAKELIB).dll "$(KRB_INSTALL_DIR)\bin\plugins\preauth\."
+	$(INSTALLDBGSYMS) plugins\preauth\spake\$(OUTPRE)$(SPAKELIB).pdb "$(KRB_INSTALL_DIR)\bin\plugins\preauth\."
 
 check-prerecurse: runenv.py
 	$(RM) $(SKIPTESTS)
diff --git a/src/config/win-pre.in b/src/config/win-pre.in
index 52152c3..8190415 100644
--- a/src/config/win-pre.in
+++ b/src/config/win-pre.in
@@ -201,6 +201,7 @@ SLIB=$(BUILDTOP)\lib\$(OUTPRE)k5sprt32.lib
 GLIB=$(BUILDTOP)\lib\$(OUTPRE)gssapi32.lib
 DLIB=wshelp32
 CCLIB=krbcc32
+SPAKELIB=spake32
 WLIB=
 
 !if  ("$(CPU)" == "IA64" ) || ("$(CPU)" == "AMD64" ) || ("$(CPU)" == "ALPHA64" )
@@ -212,6 +213,7 @@ SLIB=$(BUILDTOP)\lib\$(OUTPRE)k5sprt64.lib
 GLIB=$(BUILDTOP)\lib\$(OUTPRE)gssapi64.lib
 DLIB=wshelp64
 CCLIB=krbcc64
+SPAKELIB=spake64
 WLIB=
 
 !endif
diff --git a/src/lib/krb5_32.def b/src/lib/krb5_32.def
index f7b428e..7dee65d 100644
--- a/src/lib/krb5_32.def
+++ b/src/lib/krb5_32.def
@@ -473,3 +473,14 @@ EXPORTS
 
 ; new in 1.16
 	k5_enctype_to_ssf				@438 ; PRIVATE GSSAPI
+
+; new in 1.17
+; private symbols used by SPAKE client module
+	profile_get_string				@439 ; PRIVATE
+	profile_release_string				@440 ; PRIVATE
+	k5_sha256					@441 ; PRIVATE
+	krb5_encrypt_helper				@442 ; PRIVATE
+	encode_krb5_spake_factor			@443 ; PRIVATE
+	encode_krb5_pa_spake				@444 ; PRIVATE
+	decode_krb5_pa_spake				@445 ; PRIVATE
+	k5_free_pa_spake				@446 ; PRIVATE
diff --git a/src/plugins/preauth/spake/Makefile.in b/src/plugins/preauth/spake/Makefile.in
index dd1b907..d127e92 100644
--- a/src/plugins/preauth/spake/Makefile.in
+++ b/src/plugins/preauth/spake/Makefile.in
@@ -13,6 +13,8 @@ RELDIR=../plugins/preauth/spake
 SHLIB_EXPDEPS=$(KRB5_BASE_DEPLIBS)
 SHLIB_EXPLIBS=$(KRB5_BASE_LIBS) $(SPAKE_OPENSSL_LIBS)
 
+WINLIBS = $(SLIB) $(KLIB) $(CLIB)
+
 STLIBOBJS=util.o iana.o groups.o openssl.o edwards25519.o \
 	spake_client.o spake_kdc.o
 
@@ -25,6 +27,15 @@ SRCS= \
 	$(srcdir)/spake_client.c \
 	$(srcdir)/spake_kdc.c
 
+# Don't include spake_kdc.c in the Windows object list since we don't
+# need it.
+OBJS=	$(OUTPRE)util.$(OBJEXT) \
+	$(OUTPRE)iana.$(OBJEXT) \
+	$(OUTPRE)groups.$(OBJEXT) \
+	$(OUTPRE)openssl.$(OBJEXT) \
+	$(OUTPRE)edwards25519.$(OBJEXT) \
+	$(OUTPRE)spake_client.$(OBJEXT)
+
 t_vectors: t_vectors.o $(STLIBOBJS) $(SHLIB_EXPDEPS)
 	$(CC_LINK) -o $@ t_vectors.o $(STLIBOBJS) $(SHLIB_EXPLIBS)
 
@@ -35,5 +46,12 @@ clean-unix:: clean-liblinks clean-libs clean-libobjs
 check-unix: t_vectors
 	$(RUN_TEST_LOCAL_CONF) ./t_vectors
 
+all-windows: $(OUTPRE)$(SPAKELIB).dll
+clean-windows::
+	$(RM) $(OUTPRE)$(SPAKELIB).dll
+
+$(OUTPRE)$(SPAKELIB).dll: spake.def $(OBJS)
+	link /dll $(LOPTS) -def:spake.def -out:$*.dll $(OBJS) $(WINLIBS)
+
 @libnover_frag@
 @libobj_frag@
diff --git a/src/plugins/preauth/spake/spake.def b/src/plugins/preauth/spake/spake.def
new file mode 100644
index 0000000..1b2cf4d
--- /dev/null
+++ b/src/plugins/preauth/spake/spake.def
@@ -0,0 +1,3 @@
+EXPORTS
+
+	clpreauth_spake_initvt
diff --git a/src/windows/installer/wix/config.wxi b/src/windows/installer/wix/config.wxi
index ae0efaf..313f2f1 100644
--- a/src/windows/installer/wix/config.wxi
+++ b/src/windows/installer/wix/config.wxi
@@ -39,6 +39,7 @@
         <?error CPU is not set ?>
     <?endif?>
     <?define BinDir="$(env.KRB_INSTALL_DIR)\bin\"?>
+    <?define PreauthDir=$(env.KRB_INSTALL_DIR)\bin\plugins\preauth?>
     <?define LibDir="$(env.KRB_INSTALL_DIR)\lib\"?>
     <?define InstallerVersion="450"?>
     <?if $(env.CPU) = "i386"?>
diff --git a/src/windows/installer/wix/features.wxi b/src/windows/installer/wix/features.wxi
index 5fe17f0..dbfab4f 100644
--- a/src/windows/installer/wix/features.wxi
+++ b/src/windows/installer/wix/features.wxi
@@ -51,6 +51,7 @@
                     Level="$(var.DebugSymLowLevel)" 
                     Title="!(loc.StrKerberosClientDebugTitle)">
                     <ComponentRef Id="cmf_bin_debug"/>
+                    <ComponentRef Id="cmf_preauth_debug"/>
 		    <ComponentRef Id="cmp_ClientSystemDebug"/>
                     <?include runtime_debug.wxi?>
 	        </Feature>
@@ -64,6 +65,7 @@
           <ComponentRef Id="cmf_leashw64_dll" />
           <ComponentRef Id="cmf_wshelp64_dll" />
           <ComponentRef Id="cmf_xpprof64_dll" />
+          <ComponentRef Id="cmf_spake64_dll" />
        <?endif?>
 
             <ComponentRef Id="cmf_comerr32_dll" />
@@ -86,6 +88,7 @@
             <ComponentRef Id="cmf_mit2ms_exe" />
             <ComponentRef Id="cmf_wshelp32_dll" />
             <ComponentRef Id="cmf_xpprof32_dll" />
+            <ComponentRef Id="cmf_spake32_dll" />
 
             <ComponentRef Id="cmf_leashw32_dll" />
 
diff --git a/src/windows/installer/wix/files.wxi b/src/windows/installer/wix/files.wxi
index faf16b7..d1382a8 100644
--- a/src/windows/installer/wix/files.wxi
+++ b/src/windows/installer/wix/files.wxi
@@ -346,6 +346,27 @@
                     </Component>
                 <?endif?>
 
+                  <Directory Id="dirplugins" Name="plugins">
+                    <Directory Id="dirpreauth" Name="preauth" FileSource="$(var.PreauthDir)">
+                      <Component Win64="$(var.Win64)" Id="cmf_spake32_dll" Guid="$(var.cmf_spake32_dll_guid)" DiskId="1">
+                        <File Id="fil_spake32_dll" Name="$(var.cmf_spake32_dll_name)" KeyPath="yes" />
+                      </Component>
+                      <?if $(var.Platform) = "x64"?>
+                        <Component Win64="$(var.Win64)" Id="cmf_spake64_dll" Guid="$(var.cmf_spake64_dll_guid)" DiskId="1">
+                          <File Id="fil_spake64_dll" Name="$(var.cmf_spake64_dll_name)" KeyPath="yes" />
+                        </Component>
+                      <?endif?>
+                      <?ifdef DebugSyms?>
+                        <Component Win64="$(var.Win64)" Id="cmf_preauth_debug" Guid="$(var.cmf_preauth_debug_guid)" DiskId="1">
+                          <?if $(var.Platform) = "Intel" ?>
+                            <File Id="fil_spake32_pdb" Name="spake32.pdb" />
+                          <?else?>
+                            <File Id="fil_spake32_pdb" Name="spake64.pdb" />
+                          <?endif?>
+                        </Component>
+                      <?endif?>
+                    </Directory> <!-- /preauth -->
+                  </Directory> <!-- /plugins -->
                 </Directory> <!-- /bin -->
                 
                 <Directory Id="dirinc" Name="include" FileSource="$(var.IncDir)">
diff --git a/src/windows/installer/wix/platform.wxi b/src/windows/installer/wix/platform.wxi
index 1051386..118f411 100644
--- a/src/windows/installer/wix/platform.wxi
+++ b/src/windows/installer/wix/platform.wxi
@@ -18,6 +18,8 @@
   <?define cmf_wshelp32_dll_name="wshelp32.dll"?>
   <?define cmf_xpprof32_dll_guid="A7DF8BAF-7188-4C24-89FB-C8EB51571FD2"?>
   <?define cmf_xpprof32_dll_name="xpprof32.dll"?>
+  <?define cmf_spake32_dll_guid="36A1695B-A2B4-4A93-8C35-733A121923D4"?>
+  <?define cmf_spake32_dll_name="spake32.dll"?>
   <?if $(var.Platform) = "x64" ?>
         <?define UpgradeCode="6DA9CD86-6028-4852-8C94-452CAC229244"?>
         <?define PISystemFolder="System64Folder"?>
@@ -95,6 +97,8 @@
         <?define cmf_wshelp64_dll_name="wshelp64.dll"?>
         <?define cmf_xpprof64_dll_guid="B1112677-50A4-4430-846B-F824C859E3DF"?>
         <?define cmf_xpprof64_dll_name="xpprof64.dll"?>
+        <?define cmf_spake64_dll_guid="0E97B52A-EC8E-494C-BF5D-83AAACFEFDBA"?>
+        <?define cmf_spake64_dll_name="spake64.dll"?>
         <?define cmf_nidmgr32_dll_guid="8538212A-9BD5-4d62-BF29-36D853385F0A"?>
         <?define cmf_nidmgr32_dll_name="nidmgr64.dll"?>
         <?define cmf_nidmgr32_dll_w2k_guid="01655D48-C596-48f8-A0C3-5DB3FC833444"?>
@@ -103,6 +107,7 @@
         <?define cmf_krb5cred_en_us_dll_guid="223B7E9D-290F-40b8-89B3-F8337A8E082D"?>
         <?define cmf_krb5cred_en_us_dll_name="krb5cred_en_us.dll"?>
         <?define cmf_bin_debug_guid="F3432C85-89D9-4bd6-BD82-4ED49A118338"?>
+        <?define cmf_preauth_debug_guid="53491A4E-CB96-44D9-9B92-4ADF37C3A2D6"?>
 <?elseif $(var.Platform) = "Intel"?>
         <?define UpgradeCode="61211594-AAA1-4A98-A299-757326763CC7"?>
         <?define PISystemFolder="SystemFolder"?>
@@ -169,6 +174,7 @@
         <?define cmf_krb5cred_en_us_dll_guid="EA9ABE05-A85B-43BB-8741-50D3C3128632"?>
         <?define cmf_krb5cred_en_us_dll_name="krb5cred_en_us.dll"?>
         <?define cmf_bin_debug_guid="C8468854-8261-4781-8119-A612636841E3"?>
+        <?define cmf_preauth_debug_guid="169C0A38-EB79-4AA9-B78B-998B55084ECD"?>
 <?else?>
         <?error Unknown platform?>
 <?endif?>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.