sassoftware / relic

Relic is a service and a tool for adding digital signatures to operating system packages for Linux and Windows
Apache License 2.0
151 stars 41 forks source link

fix(./token/p11token/rsa.go): toRsaKey exponent []byte to int conversion issue #14

Closed antoinedeschenes closed 2 years ago

antoinedeschenes commented 2 years ago

Fixes #12.

A certificate does not match key in token error pops up when attempting to sign files using a pkcs11 token with an RSA key.

Dumping x509tools.SameKey public keys showed a problem with the rsa.PublicKey.E being different between both keys. Result was 16777472 (0x01000100) from the RSA token vs 65537 (0x00010001) from certificate file, showing an endianness issue.

antoinedeschenes commented 2 years ago

@mtharp