VirtualBox

Changeset 95676 in vbox


Ignore:
Timestamp:
Jul 17, 2022 3:01:19 AM (2 years ago)
Author:
vboxsync
Message:

/Config.kmk,openssl,RTSignTool: Build bldRTSignTool with signing capability on windows. bugref:8691

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r95651 r95676  
    903903# Enables full VM encryption support @bugref{9955}.
    904904VBOX_WITH_FULL_VM_ENCRYPTION = 1
     905# Enables the 'sign' command in bldRTSignTool.  We may need this on windows.
     906if1of ($(KBUILD_TARGET), win)
     907 VBOX_WITH_BLD_RTSIGNTOOL_SIGNING = 1
     908endif
    905909## @}
    906910
     
    47794783        $(PATH_STAGE_LIB)/VBox-libssl-x86$(VBOX_SUFF_LIB) \
    47804784        $(PATH_STAGE_LIB)/VBox-libcrypto-x86$(VBOX_SUFF_LIB)
     4785
     4786ifdef VBOX_WITH_BLD_RTSIGNTOOL_SIGNING
     4787 SDK_VBOX_OPENSSL_BLDPROG               := OpenSSL - Build tools verison (i.e. bldRTSignTool)
     4788 SDK_VBOX_OPENSSL_BLDPROG_INCS          ?= $(SDK_VBOX_OPENSSL_VBOX_DEFAULT_INCS)
     4789 SDK_VBOX_OPENSSL_BLDPROG_ORDERDEPS     ?= $(crypto-headers_1_TARGET)
     4790 if  !defined(VBOX_ONLY_SDK) \
     4791  && ("$(SDK_VBOX_OPENSSL_INCS)" == "$(SDK_VBOX_OPENSSL_VBOX_DEFAULT_INCS)")
     4792  SDK_VBOX_OPENSSL_BLDPROG_DEPS         ?= $(SDK_VBOX_OPENSSL_INCS)/openssl/openssl-mangling.h
     4793 endif
     4794 SDK_VBOX_OPENSSL_BLDPROG_LIBS          ?= \
     4795        $(PATH_STAGE_LIB)/VBoxBldProg-libssl$(VBOX_SUFF_LIB) \
     4796        $(PATH_STAGE_LIB)/VBoxBldProg-libcrypto$(VBOX_SUFF_LIB)
     4797endif
    47814798
    47824799SDK_VBOX_OPENSSL2              := This is what you should be using!  It links against VBoxRT.
  • trunk/src/VBox/Runtime/tools/Makefile.kmk

    r95675 r95676  
    7474  # RTSignTool - Signing utility - build version.  Signed on windows so we can get the certificate from it.
    7575  BLDPROGS += bldRTSignTool
    76   bldRTSignTool_TEMPLATE := VBoxAdvBldProg
    77   bldRTSignTool_INCS     := ../include
    78   bldRTSignTool_SOURCES  := RTSignTool.cpp
    79   bldRTSignTool_DEFS     := IPRT_IN_BUILD_TOOL
    80   bldRTSignTool_LIBS.win := Crypt32.lib NCrypt.lib
     76  bldRTSignTool_TEMPLATE  := VBoxAdvBldProg
     77  bldRTSignTool_INCS      := ../include
     78  bldRTSignTool_SOURCES   := RTSignTool.cpp
     79  bldRTSignTool_DEFS      := IPRT_IN_BUILD_TOOL
     80  bldRTSignTool_LIBS.win  := Crypt32.lib NCrypt.lib
    8181  bldRTSignTool_POST_CMDS.win = $(VBOX_SIGN_IMAGE_CMDS)
    8282  if defined(VBOX_WITH_DARWIN_R0_DARWIN_IMAGE_VERIFICATION) && defined(VBOX_SIGNING_MODE)
    8383   bldRTSignTool_POST_CMDS.darwin = $(call VBOX_SIGN_MACHO_FN,$(out),org.virtualbox.org.bldtool.$(target))
     84  endif
     85  ifndef VBOX_WITH_BLD_RTSIGNTOOL_SIGNING
     86   bldRTSignTool_DEFS     += IPRT_SIGNTOOL_NO_SIGNING
     87  else # RuntimeBldProg is missing a lot and is built w/o IPRT_WITH_OPENSSL. So, include missing and rebuilt openssl deps.
     88   bldRTSignTool_SDKS     += VBOX_OPENSSL_BLDPROG
     89   bldRTSignTool_DEFS     += IPRT_WITH_OPENSSL
     90   bldRTSignTool_SOURCES  += \
     91       ../common/string/RTStrICmpAscii.cpp \
     92        ../common/checksum/alt-sha3.cpp \
     93       ../common/crypto/store-inmem.cpp \
     94       ../common/crypto/store-cert-add-basic.cpp \
     95       ../common/crypto/rsa-core.cpp \
     96       ../common/crypto/rsa-asn1-decoder.cpp \
     97       ../common/crypto/rsa-init.cpp \
     98       ../common/crypto/rsa-sanity.cpp \
     99       ../common/crypto/RTCrStoreCertAddFromJavaKeyStore.cpp \
     100       ../common/crypto/pkix-signature-core.cpp \
     101       ../common/crypto/pkix-signature-builtin.cpp \
     102       ../common/crypto/pkix-signature-rsa.cpp \
     103       \
     104       ../common/crypto/store.cpp \
     105       ../common/crypto/digest-builtin.cpp \
     106        ../common/crypto/iprt-openssl.cpp\
     107       ../common/crypto/key.cpp \
     108       ../common/crypto/key-file.cpp \
     109        ../common/crypto/key-openssl.cpp \
     110        ../common/crypto/pkcs7-core.cpp \
     111        ../common/crypto/pkcs7-sign.cpp \
     112        ../common/crypto/RTCrRandBytes-openssl.cpp
     113
    84114  endif
    85115 endif
  • trunk/src/VBox/Runtime/tools/RTSignTool.cpp

    r95675 r95676  
    15621562}
    15631563
    1564 #ifndef IPRT_IN_BUILD_TOOL
     1564#ifndef IPRT_SIGNTOOL_NO_SIGNING
    15651565
    15661566static PRTCRPKCS7ATTRIBUTE SignToolPkcs7_AuthAttribAppend(PRTCRPKCS7ATTRIBUTES pAuthAttribs)
     
    26282628}
    26292629
    2630 #endif /* !IPRT_IN_BUILD_TOOL */
     2630#endif /* !IPRT_SIGNTOOL_NO_SIGNING */
    26312631
    26322632
     
    30983098*   Option handlers shared by 'sign-exe', 'sign-cat', 'add-timestamp-exe-signature' and others.                                  *
    30993099*********************************************************************************************************************************/
    3100 #ifndef IPRT_IN_BUILD_TOOL
     3100#ifndef IPRT_SIGNTOOL_NO_SIGNING
    31013101
    31023102static RTEXITCODE HandleOptAddCert(PRTCRSTORE phStore, const char *pszFile)
     
    33373337}
    33383338
    3339 #endif /* !IPRT_IN_BUILD_TOOL */
     3339#endif /* !IPRT_SIGNTOOL_NO_SIGNING */
    33403340
    33413341
     
    33433343*   The 'add-timestamp-exe-signature' command.                                                                                   *
    33443344*********************************************************************************************************************************/
    3345 #ifndef IPRT_IN_BUILD_TOOL
     3345#ifndef IPRT_SIGNTOOL_NO_SIGNING
    33463346
    33473347static RTEXITCODE HelpAddTimestampExeSignature(PRTSTREAM pStrm, RTSIGNTOOLHELP enmLevel)
     
    34483448}
    34493449
    3450 #endif /*!IPRT_IN_BUILD_TOOL */
     3450#endif /*!IPRT_SIGNTOOL_NO_SIGNING */
    34513451
    34523452
     
    34543454*   The 'sign-exe' command.                                                                                   *
    34553455*********************************************************************************************************************************/
    3456 #ifndef IPRT_IN_BUILD_TOOL
     3456#ifndef IPRT_SIGNTOOL_NO_SIGNING
    34573457
    34583458static RTEXITCODE HelpSign(PRTSTREAM pStrm, RTSIGNTOOLHELP enmLevel)
     
    36283628}
    36293629
    3630 #endif /*!IPRT_IN_BUILD_TOOL */
     3630#endif /*!IPRT_SIGNTOOL_NO_SIGNING */
    36313631
    36323632
     
    52065206    { "add-nested-exe-signature",       HandleAddNestedExeSignature,        HelpAddNestedExeSignature },
    52075207    { "add-nested-cat-signature",       HandleAddNestedCatSignature,        HelpAddNestedCatSignature },
    5208 #ifndef IPRT_IN_BUILD_TOOL
     5208#ifndef IPRT_SIGNTOOL_NO_SIGNING
    52095209    { "add-timestamp-exe-signature",    HandleAddTimestampExeSignature,     HelpAddTimestampExeSignature },
    52105210    { "sign",                           HandleSign,                         HelpSign },
  • trunk/src/libs/openssl-3.0.3/Config.kmk

    r95261 r95676  
    320320TEMPLATE_LIBCRYPTOTST_LIBS    = $(PATH_STAGE_LIB)/VBox-libcrypto$(VBOX_SUFF_LIB) $(TEMPLATE_VBOXR3TSTEXE_LIBS)
    321321
     322
     323ifdef VBOX_WITH_BLD_RTSIGNTOOL_SIGNING
     324#
     325# Build program versions of LIBCRYPTO and SUBLIBCRYPTO for bldRTSignTool.
     326#
     327TEMPLATE_VBoxLibCryptoBldProg = Build program template the OpenSSL crypto library.
     328TEMPLATE_VBoxLibCryptoBldProg_EXTENDS       := VBoxAdvBldProg
     329TEMPLATE_VBoxLibCryptoBldProg_DEFS           = $(TEMPLATE_VBoxAdvBldProg_DEFS) $(TEMPLATE_LIBCRYPTO_DEFS)
     330TEMPLATE_VBoxLibCryptoBldProg_CFLAGS.win     = $(TEMPLATE_VBoxAdvBldProg_CFLAGS.win) $(subst $(TEMPLATE_VBoxR3RuntimeDllNonPedantic_CFLAGS.win),, $(TEMPLATE_LIBCRYPTO_CFLAGS.win))
     331TEMPLATE_VBoxLibCryptoBldProg_CFLAGS.win    += -wd4057 # refcount.h(137): warning C4057: 'function': 'volatile long *' differs in indirection to slightly different base types from 'volatile int *'
     332TEMPLATE_VBoxLibCryptoBldProg_CFLAGS.win    += -wd4100 # refcount.h(135): warning C4100: 'lock': unreferenced formal parameter
     333TEMPLATE_VBoxLibCryptoBldProg_CFLAGS.win    += -wd4132 # curve25519.c(5497): warning C4132: 'allzeroes': const object should be initialized
     334TEMPLATE_VBoxLibCryptoBldProg_CFLAGS.win    += -wd4189 # eng_list.c(373): warning C4189: 'load_dir': local variable is initialized but not referenced
     335TEMPLATE_VBoxLibCryptoBldProg_CFLAGS.win    += -wd4245 # bn_div.c(353): warning C4245: '=': conversion from '__int64' to 'unsigned __int64', signed/unsigned mismatch
     336TEMPLATE_VBoxLibCryptoBldProg_CFLAGS.win    += -wd4255 # ctype.c(314): warning C4255: 'ossl_c_locale': no function prototype given: converting '()' to '(void)'
     337TEMPLATE_VBoxLibCryptoBldProg_CFLAGS.win    += -wd4267 # p12_utl.c(23): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
     338TEMPLATE_VBoxLibCryptoBldProg_CFLAGS.win    += -wd4389 # encoder_pkey.c(110): warning C4389: '!=': signed/unsigned mismatch
     339TEMPLATE_VBoxLibCryptoBldProg_CFLAGS.win    += -wd4668 # limits.h(70): warning C4668: '__STDC_WANT_SECURE_LIB__' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
     340TEMPLATE_VBoxLibCryptoBldProg_CFLAGS.win    += -wd4702 # ctrl_params_translate.c(681) : warning C4702: unreachable code
     341TEMPLATE_VBoxLibCryptoBldProg_CFLAGS.freebsd = $(TEMPLATE_VBoxAdvBldProg_CFLAGS.freebsd) $(subst $(TEMPLATE_VBoxR3RuntimeDllNonPedantic_CFLAGS.freebsd),, $(TEMPLATE_LIBCRYPTO_CFLAGS.freebsd))
     342TEMPLATE_VBoxLibCryptoBldProg_INCS           = $(TEMPLATE_LIBCRYPTO_INCS) $(TEMPLATE_VBoxAdvBldProg_INCS)
     343TEMPLATE_VBoxLibCryptoBldProg_INTERMEDIATES  = $(TEMPLATE_VBoxAdvBldProg_INTERMEDIATES) $(TEMPLATE_LIBCRYPTO_INTERMEDIATES)
     344
     345TEMPLATE_VBoxSubLibCryptoBldProg = Build program template a OpenSSL crypto sub-library.
     346TEMPLATE_VBoxSubLibCryptoBldProg_EXTENDS    := VBoxLibCryptoBldProg
     347TEMPLATE_VBoxSubLibCryptoBldProg_INSTTYPE    = none
     348endif # VBOX_WITH_BLD_RTSIGNTOOL_SIGNING
     349
     350
    322351#
    323352# 32-bit version of LIBCRYPTO and SUBLIBCRYPTO.
  • trunk/src/libs/openssl-3.0.3/crypto/Makefile.kmk

    r94828 r95676  
    153153
    154154
     155ifdef VBOX_WITH_BLD_RTSIGNTOOL_SIGNING
     156#
     157# The build program libcrypto version.
     158#
     159LIBRARIES += VBoxBldProg-libcrypto
     160VBoxBldProg-libcrypto          = For bldRTSignTool
     161VBoxBldProg-libcrypto_EXTENDS  = VBox-libcrypto
     162VBoxBldProg-libcrypto_TEMPLATE = VBoxLibCryptoBldProg
     163VBoxBldProg-libcrypto_DEFS     = $(VBox-libcrypto_DEFS)
     164VBoxBldProg-libcrypto_SOURCES  = \
     165        $(filter %.c %.cpp,$(VBox-libcrypto_SOURCES)) \
     166        $(PATH_STAGE_LIB)/VBoxBldProg-libproviders$(VBOX_SUFF_LIB) \
     167        $(foreach sublib,$(VBOX_CRYPTO_SUBLIBS), $(VBoxBldProg-$(sublib)_1_TARGET))
     168define def_VBoxBldProg_libcrypto_inherit
     169 LIBRARIES += VBoxBldProg-$(sublib)
     170 VBoxBldProg-$(sublib) = bldRTSignTool version of $(sublib)
     171 VBoxBldProg-$(sublib)_EXTENDS    = $(sublib)
     172 VBoxBldProg-$(sublib)_EXTENDS_BY = appending
     173 VBoxBldProg-$(sublib)_TEMPLATE   = VBoxSubLibCryptoBldProg
     174 VBoxBldProg-$(sublib)_DEFPATH    = $($(sublib)_DEFPATH)
     175 ## @todo kBuild: DEFPATH isn't inherited! FIXME!
     176endef
     177$(foreach sublib,$(VBOX_CRYPTO_SUBLIBS), $(eval $(def_VBoxBldProg_libcrypto_inherit)))
     178
     179endif # VBOX_WITH_BLD_RTSIGNTOOL_SIGNING
     180
     181
    155182#
    156183# ...
  • trunk/src/libs/openssl-3.0.3/providers/Makefile.kmk

    r94320 r95676  
    7575endif
    7676
     77
     78ifdef VBOX_WITH_BLD_RTSIGNTOOL_SIGNING
     79#
     80# The build program libproviders version.
     81#
     82LIBRARIES += VBoxBldProg-libproviders
     83VBoxBldProg-libproviders          = For bldRTSignTool
     84VBoxBldProg-libproviders_EXTENDS  = VBox-libproviders
     85VBoxBldProg-libproviders_TEMPLATE = VBoxLibCryptoBldProg
     86VBoxBldProg-libproviders_SOURCES  = \
     87        $(filter %.c,$(VBox-libproviders_SOURCES)) \
     88        $(foreach sublib,$(VBOX_CRYPTO_PROVIDERS_SUBLIBS), $(VBoxBldProg-$(sublib)_1_TARGET))
     89
     90define def_VBoxBldProg_libproviders_inherit
     91 LIBRARIES += VBoxBldProg-$(sublib)
     92 VBoxBldProg-$(sublib) = bldRTSignTool version of $(sublib)
     93 VBoxBldProg-$(sublib)_EXTENDS    = $(sublib)
     94 VBoxBldProg-$(sublib)_EXTENDS_BY = appending
     95 VBoxBldProg-$(sublib)_TEMPLATE   = VBoxSubLibCryptoBldProg
     96 VBoxBldProg-$(sublib)_DEFPATH    = $($(sublib)_DEFPATH)
     97 ## @todo kBuild: DEFPATH isn't inherited! FIXME!
     98endef
     99$(foreach sublib,$(VBOX_CRYPTO_PROVIDERS_SUBLIBS), $(eval $(def_VBoxBldProg_libproviders_inherit)))
     100
     101endif # VBOX_WITH_BLD_RTSIGNTOOL_SIGNING
     102
     103
    77104include $(FILE_KBUILD_SUB_FOOTER)
    78105
  • trunk/src/libs/openssl-3.0.3/ssl/Makefile.kmk

    r94320 r95676  
    9191endif
    9292
     93
     94ifdef VBOX_WITH_BLD_RTSIGNTOOL_SIGNING
     95 #
     96 # The build program version.
     97 #
     98 LIBRARIES += VBoxBldProg-libssl
     99 VBoxBldProg-libssl_EXTENDS = VBox-libssl
     100 VBoxBldProg-libssl_TEMPLATE = VBoxLibCryptoBldProg
     101endif # VBOX_WITH_BLD_RTSIGNTOOL_SIGNING
     102
    93103include $(FILE_KBUILD_SUB_FOOTER)
    94104
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette