Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code signing windows export fails on non-windows platform #49869

Closed
SkepticalCat0o opened this issue Jun 23, 2021 · 0 comments · Fixed by #49985
Closed

code signing windows export fails on non-windows platform #49869

SkepticalCat0o opened this issue Jun 23, 2021 · 0 comments · Fixed by #49985

Comments

@SkepticalCat0o
Copy link

Godot version

v3.3.2.stable.official

System information

GNU/Linux 6edf56f2a00a (barichello/godot-ci:3.3.2)

Issue description

Windows export fails attempting to code sign on non-windows platform. This seems to occur because godot attempts to use the same path for the -in and -out parameters to osslsigncode, but osslsigncode fails attempting to output to a file that already exists.

# godot -v --export "Windows Desktop" export/test.exe
Godot Engine v3.3.2.stable.official - https://godotengine.org

CORE API HASH: 14308214189771907951
EDITOR API HASH: 5656882008335453207
Loading resource: res://default_env.tres
Construct gdnative interface

Destruct gdnative interface

Class 'BulletPhysicsDirectBodyState' is not exposed, skipping.
Class 'BulletPhysicsDirectSpaceState' is not exposed, skipping.
Class 'BulletPhysicsServer' is not exposed, skipping.
Class 'GDScriptNativeClass' is not exposed, skipping.
Class 'IP_Unix' is not exposed, skipping.
Class 'InputDefault' is not exposed, skipping.
Class 'Physics2DDirectBodyStateSW' is not exposed, skipping.
Class 'Physics2DDirectSpaceStateSW' is not exposed, skipping.
Class 'Physics2DServerSW' is not exposed, skipping.
Class 'ResourceImporterMP3' is not exposed, skipping.
Class 'ResourceImporterOGGVorbis' is not exposed, skipping.
Loading resource: /root/.config/godot/editor_settings-3.tres
EditorSettings: Load OK!
Loaded builtin certs
EditorSettings: Save OK!
savepack: begin: Packing steps: 102
        savepack: step 2: Storing File: res://Main.tscn
        savepack: step 35: Storing File: res://default_env.tres
        savepack: step 68: Storing File: res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex
        savepack: step 68: Storing File: res://icon.png.import
        savepack: step 102: Storing File: res://icon.png
        savepack: step 102: Storing File: res://project.binary
savepack: end
codesign (export/test.exe): Failed to create file: export/test.exe
140257349455744:error:02001011:system library:fopen:File exists:../crypto/bio/bss_file.c:69:fopen('export/test.exe','w+bx')
140257349455744:error:2006D002:BIO routines:BIO_new_file:system lib:../crypto/bio/bss_file.c:78:
Failed

EditorSettings: Save OK!

Steps to reproduce

  1. On a non-windows platform, Install osslsigncode
  2. Create a godot project
  3. Add an export preset for "Windows Desktop"
  4. Enable Codesign and fill out the Codesign options as appropriate for your code signing certificate
  5. Attempt to export the "Windows Desktop" preset. E.g. godot -v --export "Windows Desktop" export/test.exe

You can also get the same error calling osslsigncode directly with the same path for -in and -out:

# osslsigncode sign -pkcs12 $cert_pfx -pass $cert_pwd -n "sign test" -h sha1 -in export/test.exe -out export/test.exe
Failed to create file: export/test.exe
140025075048320:error:02001011:system library:fopen:File exists:../crypto/bio/bss_file.c:69:fopen('test.exe','w+bx')
140025075048320:error:2006D002:BIO routines:BIO_new_file:system lib:../crypto/bio/bss_file.c:78:
Failed

It succeeds if an -out path is specified that does not exist:

# osslsigncode sign -pkcs12 $cert_pfx -pass $cert_pwd -n "sign test" -h sha1 -in export/test.exe -out export/test-signed.exe
Succeeded

Minimal reproduction project

osslsigncode-test.zip
The codesign/identity and the codesign/password fields in export_presets.cfg have been intentionally left blank for obvious reasons, but need to be set with a valid code signing certificate and password to reproduce this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants