echo "Make Windows RegistrationWizard"
make -j3 -f Makefile.mingw${version} $2
if test -f RegistrationWizard.exe; then
+ ../../win32/sign-binaries RegistrationWizard.exe
cp -f RegistrationWizard.exe ../../win32/release${version}
fi
rm -f RegistrationWizard.exe
echo "Make Windows bat"
make -j3 -f Makefile.mingw${version} $2
if test -f bat.exe; then
- cp -f bat.exe ../win32/release${version}
+ cp -f bat.exe ../win32/release${version}
elif test -f release/bat.exe; then
cp -f release/bat.exe ../win32/release${version}
else
cp -f debug/bat.exe ../win32/release${version}
fi
+ ../win32/sign-binaries ../win32/release${version}/bat.exe
rm -f bat.exe release/bat.exe debug/bat.exe
fi
}
else
cp -f debug/bacula-tray-monitor.exe ../../win32/release${version}
fi
+ ../../win32/sign-binaries ../../win32/release${version}/bacula-tray-monitor.exe
rm -f bacula-tray-monitor.exe release/bacula-tray-monitor.exe debug/bacula-tray-monitor.exe
cd ..
}
@echo "Linking $@"
$(call checkdir,$@)
$(ECHO_CMD)$(CXX) $(CFLAGS) $(LDFLAGS) -mconsole $^ $(1) -o $@
+ $(BUILDDIR)/sign-binaries $@
endef
define link_winapp
@echo "Linking $@"
$(call checkdir,$@)
$(ECHO_CMD)$(CXX) $(CFLAGS) $(LDFLAGS) -mwindows $^ $(1) -o $@
+ $(BUILDDIR)/sign-binaries $@
endef
define makedbg
@echo "Linking $@"
$(call checkdir,$@)
$(ECHO_CMD)$(CXX) $(LDFLAGS) -mdll -mwindows -Wl,--out-implib,$(OBJDIR)/bacula.a $^ $(LIBS_DLL) -o $@
+ $(BUILDDIR)/sign-binaries $@
bacula$(WIN_VERSION).def: $(DLL_OBJS)
./make_def$(WIN_VERSION) $(DLL_OBJS) >bacula$(WIN_VERSION).def.new && \
--- /dev/null
+#!/bin/sh
+# Copyright (C) 2000-2020 Kern Sibbald
+# License: BSD 2-Clause; see file LICENSE-FOSS
+#
+# Sign binaries if possible with sign_exe script
+
+DIR=$1
+
+if [ "$DIR" = "" ]; then
+ echo "Usage: $0 <directory> | <file> <file> <file>"
+ exit 1
+fi
+
+if ! which sign_exe > /dev/null 2> /dev/null
+then
+ exit 0
+fi
+
+RET=0
+
+if [ -d "$DIR" ]; then
+ for F in "$DIR"/*.exe "$DIR"/*.dll
+ do
+ sign_exe "$F"
+ RET=`expr $RET + $?`
+ done
+
+else
+ for F in $*
+ do
+ sign_exe "$F"
+ RET=`expr $RET + $?`
+ done
+fi
+
+exit $RET
--- /dev/null
+#!/bin/sh
+# Copyright (C) 2000-2020 Kern Sibbald
+# License: BSD 2-Clause; see file LICENSE-FOSS
+#
+# Check if binaries are signed
+
+DIR=$1
+
+if [ "$DIR" = "" ]; then
+ echo "Usage: $0 <directory> | <file> <file> <file>"
+ exit 1
+fi
+
+if ! which osslsigncode > /dev/null 2> /dev/null
+then
+ echo "INFO: Not checking signature"
+ exit 0
+fi
+
+# Custom program to sign an executable
+if ! which sign_exe > /dev/null 2> /dev/null
+then
+ echo "INFO: Not checking signature"
+ exit 0
+fi
+
+RET=0
+
+if [ -d "$DIR" ]; then
+ for F in "$DIR"/*.exe "$DIR"/*.dll
+ do
+ osslsigncode verify "$F" | grep "Signature verification: ok"
+ if [ $? != 0 ]; then
+ echo "Signature verification: failed for $F"
+ RET=1
+ fi
+ done
+
+else
+ for F in $*
+ do
+ osslsigncode verify "$F" | grep "Signature verification: ok"
+ if [ $? != 0 ]; then
+ echo "Signature verification: failed for $F"
+ RET=1
+ fi
+ done
+fi
+
+if [ $RET != 0 ]; then
+ echo "ERROR: Some files are not signed correctly"
+fi
+exit $RET
include ../Makefile.inc
+PWD := $(shell pwd)
+
VERSION := $(shell sed -ne 's/^.define[ \t]VERSION[ \t][ \t]*"\(.*\)"/\1/p' < ../../version.h)
RELEASE ?= $(shell awk '/define RELEASE [0-9]+/ { print $$3 }' ../../version.h)
$(INSTALL_EXE): winbacula.nsi $(addprefix release32/,$(BACULA_BINARIES) $(SCRIPT_FILES) $(CAT_FILES) $(DEPKGS_BINARIES) $(NONGCC_BINARIES) $(NONGCC_LIBRARIES) $(MINGW_BINARIES) $(SSL_FILES) $(DIRD_FILES) $(LICENSE_FILES) )
echo "makensis -V3 $(DEFINES) winbacula.nsi"
makensis -V3 $(DEFINES) winbacula.nsi
+ ../sign-binaries ../release32/bacula-*$(VERSION).exe
+
include $(BUILDDIR)/Makefile.rules
include ../Makefile.inc
+PWD := $(shell pwd)
+
VERSION := $(shell sed -ne 's/^.define[ \t]VERSION[ \t][ \t]*"\(.*\)"/\1/p' < ../../version.h)
RELEASE ?= $(shell awk '/define RELEASE [0-9]+/ { print $$3 }' ../../version.h)
$(INSTALL_EXE): winbacula.nsi $(addprefix release64/,$(BACULA_BINARIES) $(DEPKGS_BINARIES) $(SSL_FILES) $(LICENSE_FILES))
makensis -V3 $(DEFINES) winbacula.nsi
echo " "
+ ../sign-binaries ../release64/bacula-*$(VERSION).exe
include $(BUILDDIR)/Makefile.rules