3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 20:18:18 +00:00

fix generation of assembly-sign-input to take escape sequences and absolute paths

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2018-12-12 10:14:38 -08:00
parent db3e5ce070
commit 8d23ad2f7e

View file

@ -1937,7 +1937,7 @@ class DotNetCoreDLLComponent(Component):
import uuid import uuid
guid = str(uuid.uuid4()) guid = str(uuid.uuid4())
path = BUILD_DIR path = os.path.abspath(BUILD_DIR).replace("\\","\\\\")
assemblySignStr = """ assemblySignStr = """
{ {
"Version": "1.0.0", "Version": "1.0.0",
@ -1946,19 +1946,19 @@ class DotNetCoreDLLComponent(Component):
[ [
{ {
"SourceLocationType": "UNC", "SourceLocationType": "UNC",
"SourceRootDirectory": "c:\\ESRP\\input", "SourceRootDirectory": "c:\\\\ESRP\\\\input",
"DestinationLocationType": "UNC", "DestinationLocationType": "UNC",
"DestinationRootDirectory": "c:\\ESRP\\output", "DestinationRootDirectory": "c:\\\\ESRP\\\\output",
"SignRequestFiles": [ "SignRequestFiles": [
{ {
"CustomerCorrelationId": "%s", "CustomerCorrelationId": "%s",
"SourceLocation": "%s\\libz3.dll", "SourceLocation": "%s\\\\libz3.dll",
"DestinationLocation": "%s\\libz3.dll" "DestinationLocation": "%s\\\\libz3.dll"
}, },
{ {
"CustomerCorrelationId": "%s", "CustomerCorrelationId": "%s",
"SourceLocation": "%s\\Microsoft.Z3.dll", "SourceLocation": "%s\\\\Microsoft.Z3.dll",
"DestinationLocation": "%s\\Microsoft.Z3.dll" "DestinationLocation": "%s\\\\Microsoft.Z3.dll"
} }
], ],
"SigningInfo": { "SigningInfo": {
@ -1969,9 +1969,9 @@ class DotNetCoreDLLComponent(Component):
"Parameters" : { "Parameters" : {
"OpusName": "Microsoft", "OpusName": "Microsoft",
"OpusInfo": "http://www.microsoft.com", "OpusInfo": "http://www.microsoft.com",
"FileDigest": "/fd \"SHA256\"", "FileDigest": "/fd \\"SHA256\\"",
"PageHash": "/NPH", "PageHash": "/NPH",
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" "TimeStamp": "/tr \\"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\\" /td sha256"
}, },
"ToolName" : "sign", "ToolName" : "sign",
"ToolVersion" : "1.0" "ToolVersion" : "1.0"
@ -1988,10 +1988,10 @@ class DotNetCoreDLLComponent(Component):
} }
] ]
} """ % (guid, path, path, guid, path, path) } """ % (guid, path, path, guid, path, path)
assemblySign = os.path.join('dotnet', 'assembly-sign-input.json') assemblySign = os.path.join(os.path.abspath(BUILD_DIR), 'dotnet', 'assembly-sign-input.json')
with open(os.path.join(BUILD_DIR, assemblySign), 'w') as ous: with open(assemblySign, 'w') as ous:
ous.write(assemblySignStr) ous.write(assemblySignStr)
outputFile = os.path.join(BUILD_DIR, 'dotnet', "output.json") outputFile = os.path.join(os.path.abspath(BUILD_DIR), 'dotnet', "esrp-out.json")
esrpCmdLine = ["esrpclient.exe", "sign", "-a", "C:\\esrp\\config\\authorization.json", "-p", "C:\\esrp\\config\\policy.json", "-i", assemblySign, "-o", outputFile] esrpCmdLine = ["esrpclient.exe", "sign", "-a", "C:\\esrp\\config\\authorization.json", "-p", "C:\\esrp\\config\\policy.json", "-i", assemblySign, "-o", outputFile]
MakeRuleCmd.write_cmd(out, ' '.join(esrpCmdLine)) MakeRuleCmd.write_cmd(out, ' '.join(esrpCmdLine))