VirtualBox

Changeset 64917 in vbox


Ignore:
Timestamp:
Dec 16, 2016 4:33:46 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
112330
Message:

Config.kmk: Alternative mode of signing windows drivers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r64915 r64917  
    30553055  $(error VBOX_SIGNING_MODE must be either 'test' or 'release'. The value '$(VBOX_SIGNING_MODE)' is not recognized.)
    30563056 endif
    3057  # Corp code signing.
     3057 # Corp code signing client.
    30583058 VBOX_CCS_CLIENT_JAR := $(firstword $(rsort \
    30593059        $(wildcard $(KBUILD_DEVTOOLS)/common/ccs/v*/Client.jar)) \
     
    30683068 # @param  $3  The directory to put the signed file in. Defaults to $(dir $2).
    30693069 # @param  $4  Additional options.
    3070  VBOX_CCS_SIGN_CMD    = $(VBOX_JAVA) -jar "$(VBOX_CCS_CLIENT_JAR)" \
     3070 VBOX_CCS_SIGN_CMD    = $(VBOX_RETRY) $(VBOX_JAVA) -jar "$(VBOX_CCS_CLIENT_JAR)" \
    30713071        sign -user "$(VBOX_CCS_USER)" -global_uid "$(VBOX_CCS_GLOBAL_UID)" -server "$(VBOX_CCS_SERVER)" \
    30723072                -sign_method "$1" -file_to_sign "$2" -signed_location "$(if $3,$3,$(dir $2))" $4
     
    31343134        ,/sha1 "$(subst $(SP),,$(VBOX_CERTIFICATE_SHA2_FINGERPRINT))",) # Still using SHA-1 for fingerprinting, it's good enough for that!
    31353135
    3136   ## Commands for signing a driver image after link.
    3137   VBOX_SIGN_DRIVER_CMDS ?= $(if $(eq $(tool_do),LINK_LIBRARY),,$(call VBOX_SIGN_IMAGE_FN,$(out),,2))
    31383136  ## Sign a file (generic).
    31393137  # @param 1  The file to sign.
     
    31433141  # @param 5  Disables dual signing if non-empty.
    31443142  ifndef VBOX_SIGN_FILE_FN
    3145    ifdef VBOX_CERTIFICATE_SHA2_SUBJECT_NAME
     3143   ifeq ($(VBOX_WITH_CORP_CODE_SIGNING), all)
     3144    VBOX_SIGN_FILE_FN     = $(call VBOX_CCS_SIGN_CMD,driver,$1,$(dir $1))
     3145   else ifdef VBOX_CERTIFICATE_SHA2_SUBJECT_NAME
    31463146    VBOX_SIGN_FILE_FN     = $(VBOX_SIGNTOOL) \
    31473147        sign /fd sha1\
     
    31783178  endif
    31793179
     3180  ## Corp code signing for drivers and catalogs, plan B.
     3181  #
     3182  # Since the corp code signing cannot dual signing and doesn't even have a
     3183  # SHA-1 cert, we have to get creative:
     3184  #   1. Sign $1 using local SHA-1 certificate.
     3185  #   2. Make temporary copy of $1 as $1.ccs
     3186  #   3. Do SHA-256 corp code signing of $1.ccs
     3187  #   4. Add the SHA-256 signature from $1.ccs to $1 using bldRTSignTool.
     3188  #   5. Delete $1.ccs.
     3189  #
     3190  # @param 1  The file to sign.
     3191  # @param 2  File description. Optional.
     3192  # @param 3  Additional parameters. Optional.
     3193  # @param 4  Set to 2 if the expression will be expanded twice before chopped into commands (for _CMDS).
     3194  # @param 5  Disables dual signing if non-empty.
     3195  #
     3196  # @remarks The parameters are the same as VBOX_SIGN_FILE_FN.
     3197  VBOX_SIGN_IMAGE_PLAN_B_FN = $(warning VBOX_SIGN_IMAGE_PLAN_B_FN: 1=$1 2=$2 3=$3 4=$4 5=$5)$(VBOX_SIGNTOOL) \
     3198        sign /fd sha1\
     3199        $(VBOX_CROSS_CERTIFICATE_FILE_ARGS) \
     3200        $(VBOX_CERTIFICATE_STORE_ARGS) \
     3201        $(VBOX_CERTIFICATE_SUBJECT_NAME_ARGS) \
     3202        $(VBOX_CERTIFICATE_FINGERPRINT_ARGS) \
     3203        $(VBOX_TSA_URL_ARGS) \
     3204        $(if $(strip $(2)),/d "$(strip $(2))",) \
     3205        $(3) \
     3206        $(1) \
     3207        $(if-expr "$5" == "",\
     3208        $(if-expr "$4" == "2",$$(NLTAB),$(NLTAB))$(RM) -f -- "$1.ccs" \
     3209        $(if-expr "$4" == "2",$$(NLTAB),$(NLTAB))$(CP) -- "$1" "$1.ccs" \
     3210        $(if-expr "$4" == "2",$$(NLTAB),$(NLTAB))$(call VBOX_CCS_SIGN_CMD,driver$(if-expr "$3" == "/ph",_pagehash,),$1.ccs,$(dir $1.ccs),-digest_algo SHA2) \
     3211        $(if-expr "$4" == "2",$$(NLTAB),$(NLTAB))$(VBOX_RTSIGNTOOL) add-nested-$(if-expr "$(suffix $1)" == ".cat",cat,exe)-signature -v "$1" "$1.ccs" \
     3212        $(if-expr "$4" == "2",$$(NLTAB),$(NLTAB))$(RM) -f -- "$1.ccs" \
     3213        ,)
     3214
    31803215  ## Sign an executable image.
    31813216  # @param 1  The file to sign.
     
    31843219  VBOX_SIGN_IMAGE_FN     ?= $(call VBOX_SIGN_FILE_FN,$(1),$(2),/ph,$(3))
    31853220
     3221  ## Commands for signing a driver image after link.
     3222  if defined(VBOX_WITH_CORP_CODE_SIGNING) && "$(VBOX_WITH_CORP_CODE_SIGNING)" != "all"
     3223   VBOX_SIGN_DRIVER_CMDS ?= $(if $(eq $(tool_do),LINK_LIBRARY),,$(call VBOX_SIGN_IMAGE_PLAN_B_FN,$(out),,/ph,2))
     3224   VBOX_SIGN_DRIVER_ORDERDEPS ?= $(VBOX_RTSIGNTOOL)
     3225  else
     3226   VBOX_SIGN_DRIVER_CMDS ?= $(if $(eq $(tool_do),LINK_LIBRARY),,$(call VBOX_SIGN_IMAGE_FN,$(out),,2))
     3227  endif
     3228
    31863229  ## Create a security catalog file.
    31873230  # @param 1  The directory containing the stuff to sign.
    31883231  # @param 2  The expected .cat name. (Inf2Cat lowercases it)
    31893232  # @param 3  The list of OSes, separated by ';'.
    3190   VBOX_MAKE_CAT_HLP_FN ?= \
    3191         $(RM) -f $(2)\
    3192         $(NL)$(TAB)$(VBOX_INF2CAT) /driver:$(strip $(1)) /os:$(strip $(subst ;,$(COMMA),$(3))) /verbose \
    3193         $(NL)$(TAB)$(MV) $(2) $(2) \
    3194         $(NL)$(TAB)$(call VBOX_SIGN_FILE_FN,$(2),,,$(NL)$(TAB))
     3233  ifndef VBOX_MAKE_CAT_HLP_FN
     3234   VBOX_MAKE_CAT_HLP_FN = \
     3235        $(RM) -f -- "$(2)"\
     3236        $(NL)$(TAB)$(VBOX_INF2CAT) "/driver:$(strip $(1))" "/os:$(strip $(subst ;,$(COMMA),$(3)))" /verbose \
     3237        $(NL)$(TAB)$(MV) -- "$(2)" "$(2)"
     3238   if defined(VBOX_WITH_CORP_CODE_SIGNING) && "$(VBOX_WITH_CORP_CODE_SIGNING)" != "all"
     3239    VBOX_MAKE_CAT_HLP_FN += $(NL)$(TAB)$(call VBOX_SIGN_IMAGE_PLAN_B_FN,$(2),,,$(NL)$(TAB))
     3240   else
     3241    VBOX_MAKE_CAT_HLP_FN += $(NL)$(TAB)$(call         VBOX_SIGN_FILE_FN,$(2),,,$(NL)$(TAB))
     3242   endif
     3243  endif
    31953244  VBOX_MAKE_CAT64_FN   ?= $(call VBOX_MAKE_CAT_HLP_FN,$(1),$(2),XP_X64;Server2003_X64;Vista_X64)
    31963245  VBOX_MAKE_CAT32_FN   ?= $(call VBOX_MAKE_CAT_HLP_FN,$(1),$(2),2000;XP_X86;Server2003_X86;Vista_X86)
     
    39754024TEMPLATE_VBoxR0_LIBS.x86            = \
    39764025        $(PATH_SDK_$(VBOX_WINDDK)_LIB.x86)/int64.lib
     4026TEMPLATE_VBoxR0_ORDERDEPS           = $(VBOX_SIGN_DRIVER_ORDERDEPS)
    39774027TEMPLATE_VBoxR0_POST_CMDS           = $(VBOX_SIGN_DRIVER_CMDS)
    39784028endif # pe
     
    40884138  TEMPLATE_VBOXR0DRV_LDFLAGS          += -IntegrityCheck
    40894139 endif
     4140 TEMPLATE_VBOXR0DRV_ORDERDEPS          = $(VBOX_SIGN_DRIVER_ORDERDEPS)
    40904141 TEMPLATE_VBOXR0DRV_POST_CMDS          = $(VBOX_SIGN_DRIVER_CMDS)
    40914142endif
Note: See TracChangeset for help on using the changeset viewer.

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