diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2021-06-15 23:34:30 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2021-06-16 11:37:12 +0000 |
commit | 273000f895d656cc220ee4886f28334d50062b59 (patch) | |
tree | 114185870dbbb414d246ff72c69101a8c44953fd | |
parent | fb3b51013323d76c301a36c20fb4b53cc93fb45b (diff) |
codesign: Add new codesign.timestampAlgorithm property
We need this property on Windows when we use the
codesign.signingTimestamp property. This property should be set with
the "sha256" value in case when the app is to be distributed over the
App Store; otherwise the the codesign.signingTimestamp property is
quite useless.
Fixes: QBS-1651
Change-Id: Iacc5f80b8acf81ea1a34f55416e6966c41b0e727
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
-rw-r--r-- | doc/reference/modules/codesign-module.qdoc | 16 | ||||
-rw-r--r-- | share/qbs/modules/codesign/codesign.js | 4 | ||||
-rw-r--r-- | share/qbs/modules/codesign/signtool.qbs | 7 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata-windows/codesign/codesign.qbs | 2 |
4 files changed, 29 insertions, 0 deletions
diff --git a/doc/reference/modules/codesign-module.qdoc b/doc/reference/modules/codesign-module.qdoc index d0aba4688..45e247a6a 100644 --- a/doc/reference/modules/codesign-module.qdoc +++ b/doc/reference/modules/codesign-module.qdoc @@ -343,6 +343,22 @@ */ /*! + \qmlproperty string codesign::timestampAlgorithm + + Specifies the default timestamp algorithm used together with the + \c signingTimestamp property. The possible values are \c sha1, \c sha256. + + \note If this value is not set, then the default sha1 algorithm + will be used. + + \since Qbs 1.19.2 + + \defaultvalue \c undefined + + \windowsproperty +*/ + +/*! \qmlproperty string codesign::certificatePath Specifies the full path to the signing certificate file (*.pfx). diff --git a/share/qbs/modules/codesign/codesign.js b/share/qbs/modules/codesign/codesign.js index 8159a77bc..10fa7575f 100644 --- a/share/qbs/modules/codesign/codesign.js +++ b/share/qbs/modules/codesign/codesign.js @@ -443,6 +443,10 @@ function prepareSigntool(project, product, inputs, outputs, input, output) { if (signingTimestamp) args.push("/tr", signingTimestamp); + var timestampAlgorithm = product.codesign.timestampAlgorithm; + if (timestampAlgorithm) + args.push("/td", timestampAlgorithm); + var certificatePath = product.codesign.certificatePath; if (certificatePath) args.push("/f", certificatePath); diff --git a/share/qbs/modules/codesign/signtool.qbs b/share/qbs/modules/codesign/signtool.qbs index 02a2c978e..d0dda3a31 100644 --- a/share/qbs/modules/codesign/signtool.qbs +++ b/share/qbs/modules/codesign/signtool.qbs @@ -70,6 +70,13 @@ CodeSignModule { allowedValues: ["sha1", "sha256", "sha384", "sha512"] } + property string timestampAlgorithm + PropertyOptions { + name: "timestampAlgorithm" + description: "Name of the timestamp algorithm." + allowedValues: ["sha1", "sha256"] + } + property path certificatePath PropertyOptions { name: "certificatePath" diff --git a/tests/auto/blackbox/testdata-windows/codesign/codesign.qbs b/tests/auto/blackbox/testdata-windows/codesign/codesign.qbs index ef6447ab7..f9f49e636 100644 --- a/tests/auto/blackbox/testdata-windows/codesign/codesign.qbs +++ b/tests/auto/blackbox/testdata-windows/codesign/codesign.qbs @@ -14,6 +14,7 @@ Project { codesign.hashAlgorithm: project.hashAlgorithm codesign.subjectName: project.subjectName codesign.signingTimestamp: project.signingTimestamp + codesign.timestampAlgorithm: "sha256" install: true installDir: "" property bool dummy: { @@ -31,6 +32,7 @@ Project { codesign.hashAlgorithm: project.hashAlgorithm codesign.subjectName: project.subjectName codesign.signingTimestamp: project.signingTimestamp + codesign.timestampAlgorithm: "sha256" install: true installDir: "" property bool dummy: { |