ebourg / jsign

Java implementation of Microsoft Authenticode for signing Windows executables, installers & scripts
https://ebourg.github.io/jsign
Apache License 2.0
250 stars 107 forks source link

vbs with a comment containing a copyright glyph (©) fails to verify after signature. #168

Closed johm6340 closed 10 months ago

johm6340 commented 10 months ago

Hello If a vbs script file contains a line containing a copyright glyph , jsign signs it, but signtool fails to verify it .

To recreate , use notepad to create a test.vbs file and insert this line ' ©some text

Save it and sign . Then run signtool verify against it . it will fail with SignTool Error: WinVerifyTrust returned error: 0x80096010 The digital signature of the object did not verify.

johm6340 commented 10 months ago

using the --encoding UTF-8 fixes this .

johm6340 commented 10 months ago

According to the jsign tools help text, I think that UTF-8 should be default . so re-opening this for comment.

ebourg commented 10 months ago

Does signtool generate a valid signature for the same file?

johm6340 commented 10 months ago

hi, yes it does .

ebourg commented 10 months ago

Jsign already assumes UTF-8 by default for .vbs files but there is another issue. I think this is a duplicate of #123.

ebourg commented 10 months ago

Could you try again with --encoding windows-1252 ?

johm6340 commented 10 months ago

it verifies just fine . so does --encoding UTF-8

johm6340 commented 10 months ago

looking at the file ( same if I create it in notepad or vim on widows) . The hex looks like 27 c2 a9 73 6f 6d 65 20 74 65 78 74 0d 0a 0d 0a '©some text