Skip to content

gitian: add a gitian-win-signer descriptor#6303

Merged
laanwj merged 1 commit intobitcoin:masterfrom
theuni:gitian-win-signer
Jun 22, 2015
Merged

gitian: add a gitian-win-signer descriptor#6303
laanwj merged 1 commit intobitcoin:masterfrom
theuni:gitian-win-signer

Conversation

@theuni
Copy link
Member

@theuni theuni commented Jun 18, 2015

This makes Windows signing match the current OSX signing process.

osslsigncode has been patched to detach and re-attach Windows signatures. The changes can be seen here: https://github.com/theuni/osslsigncode/commits/attach-signature

There's a pull-request open upstream for the changes:
https://sourceforge.net/p/osslsigncode/osslsigncode/merge-requests/3/

This work has been back-ported to the stable 1.7.1 release of osslsigncode, so that a smaller patch can be reviewed. Hopefully we'll get the changes merged upstream for the next release so that we can drop the patches here.

For reference, I've pushed the detached sigs that would've been used for 0.11.0rc2 here: bitcoin-core/bitcoin-detached-sigs@329d2e8

For a test, I created a phony tag in my local bitcoin-detached-sigs repository and re-attached the 0.11.0rc2 .exe's from the detached sigs here: bitcoin-core/bitcoin-detached-sigs@329d2e8. No surprise, they matched our release binaries.

If desired, this should be safe to use for 0.11.0-rc3.

This is exactly like the current OSX signing process.

osslsigncode has been patched to detach and re-attach Windows signatures.
The changes can be seen here: https://github.com/theuni/osslsigncode/commits/attach-signature

There's a pull-request open upstream for the changes:
https://sourceforge.net/p/osslsigncode/osslsigncode/merge-requests/3/

This work has been back-ported to the stable 1.7.1 release of osslsigncode, so
that a smaller patch can be reviewed.
@theuni
Copy link
Member Author

theuni commented Jun 19, 2015

ping @jonasschnelli. Looks like the new setban/listbanned stuff introduced a race somewhere.

@theuni
Copy link
Member Author

theuni commented Jun 19, 2015

@jonasschnelli CNode::ClearBanned() doesn't lock, that looks like a good candidate for the issue here.

@jonasschnelli
Copy link
Contributor

@theuni: oh. Thanks for the finding! Will have a look at it.

@jonasschnelli
Copy link
Contributor

@theuni: Fix done. Please check #6307. Thanks.

@laanwj
Copy link
Member

laanwj commented Jun 19, 2015

Nice, utACK, will respin travis after #6307 merged

@theuni
Copy link
Member Author

theuni commented Jun 19, 2015

I probably should've mentioned, this one's much easier to actually test/use than OSX, because it doesn't require crazy toolchain tricks to build.

You can easily play with it by building from the attach-signature branch of https://github.com/theuni/osslsigncode/. It's just a typical ./configure && make. Then you can take a release .exe and strip off its sig:

./osslsigncode extract-signature -pem -in bitcoin-0.11.0rc2-win32-setup.exe -out sig32.pem

re-attach to the unsigned .exe from gitian:

./osslsigncode attach-signature -sigin sig32.pem -in bitcoin-0.11.0-win32-setup.exe -out re-signed.exe

then verify that re-signed.exe == bitcoin-0.11.0rc2-win32-setup.exe

@laanwj
Copy link
Member

laanwj commented Jun 19, 2015

Works for me:

$ sha256sum bitcoin-0.11.0rc2-win64-setup.exe re-signed.exe 
d2f076a051f3e17f0463e388a4a0a261ba977d66b2efcdd639765f98d03476a3  bitcoin-0.11.0rc2-win64-setup.exe
d2f076a051f3e17f0463e388a4a0a261ba977d66b2efcdd639765f98d03476a3  re-signed.exe

@fanquake
Copy link
Member

Also works for me:

xxx:osslsigncode $ ./osslsigncode extract-signature -pem -in bitcoin-0.11.0rc2-win32-setup.exe -out sig32.pem
Succeeded
xxx:osslsigncode $ ./osslsigncode attach-signature -sigin sig32.pem -in bitcoin-0.11.0-win32-setup.exe -out re-signed.exe
Current PE checksum   : 00BA7F5F
Calculated PE checksum: 00BA7F5F

Message digest algorithm  : SHA1
Current message digest    : 056184C31F9A1E67688A628181A254CD220105EA
Calculated message digest : 056184C31F9A1E67688A628181A254CD220105EA

Signature verification: ok

Number of signers: 1
    Signer #0:
        Subject: /C=US/postalCode=98104/ST=WA/L=Seattle/street=Ste 300/street=71 Columbia St/O=The Bitcoin Foundation, Inc./CN=The Bitcoin Foundation, Inc.
        Issuer : /C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO Code Signing CA 2
        Serial : 84A31812495BFAA126E4F1CF3E93A111

Number of certificates: 3
    Cert #0:
        Subject: /C=US/postalCode=98104/ST=WA/L=Seattle/street=Ste 300/street=71 Columbia St/O=The Bitcoin Foundation, Inc./CN=The Bitcoin Foundation, Inc.
        Issuer : /C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO Code Signing CA 2
        Serial : 84A31812495BFAA126E4F1CF3E93A111
    ------------------
    Cert #1:
        Subject: /C=US/postalCode=98104/ST=WA/L=Seattle/street=Ste 300/street=71 Columbia St/O=The Bitcoin Foundation, Inc./CN=The Bitcoin Foundation, Inc.
        Issuer : /C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO Code Signing CA 2
        Serial : 84A31812495BFAA126E4F1CF3E93A111
    ------------------
    Cert #2:
        Subject: /C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO Time Stamping Signer
        Issuer : /C=US/ST=UT/L=Salt Lake City/O=The USERTRUST Network/OU=http://www.usertrust.com/CN=UTN-USERFirst-Object
        Serial : 9FEAC811B0F16247A5FC20D80523ACE6

Signature successfully attached.
xxx:osslsigncode $ shasum -a 256 bitcoin-0.11.0rc2-win32-setup.exe re-signed.exe
46b8bd99b9adcf2def6686e39dd06e1b8c34297ec24f1a45fb21526bba682721  bitcoin-0.11.0rc2-win32-setup.exe
46b8bd99b9adcf2def6686e39dd06e1b8c34297ec24f1a45fb21526bba682721  re-signed.exe

@laanwj laanwj merged commit d08cfc2 into bitcoin:master Jun 22, 2015
laanwj added a commit that referenced this pull request Jun 22, 2015
d08cfc2 gitian: add a gitian-win-signer descriptor (Cory Fields)
laanwj pushed a commit that referenced this pull request Jun 22, 2015
This is exactly like the current OSX signing process.

osslsigncode has been patched to detach and re-attach Windows signatures.
The changes can be seen here: https://github.com/theuni/osslsigncode/commits/attach-signature

There's a pull-request open upstream for the changes:
https://sourceforge.net/p/osslsigncode/osslsigncode/merge-requests/3/

This work has been back-ported to the stable 1.7.1 release of osslsigncode, so
that a smaller patch can be reviewed.

Github-Pull: #6303
Rebased-From: d08cfc2
@laanwj
Copy link
Member

laanwj commented Jun 22, 2015

Cherry-picked to 0.11 as b711599

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I'm misreading, you end up with the version not part of the setup filenames, don't you?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

erm, kinda. It spits out files with version in the name, but you move it back into inputs without the version (same as osx). It's done that way so that we don't have to constantly update the gitian descriptor.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, yeah, I got that, but the expected output after following this process is that the file is present in inputs, without the version. Now that I look at it, the same discrepancy is present for OS X.

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants