-
Notifications
You must be signed in to change notification settings - Fork 169
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
Difference in RSA Signature on macOS vs Ubuntu #254
Comments
Hrm, how confident are you of this? I can't reproduce this locally with a docker image: I see this passing in both environments. |
I hit this bug on a production server. So to verify, I tunnelled my dev setup to a temporary remote host to verify, and it works as expected, no changes in code. I forgot to mention in the OP: the local code, running on macOS, is a debug build, while the server build is a release/production build, if that is of any consequence. |
I'm really struggling to find a way to make this reproduce at all. Does your xctest actually fail on your Linux node? Are you actually running Crypto from |
Yes
Yes, the specific commit mentioned in the OP. I'll setup Ubuntu 22.04.4 LTS in UTM as a VM tomorrow morning to figure out if I can reproduce this locally as well, and get back to you with my findings. |
Thank you, that would be helpful. I tried the 5.10 docker image, both arm64 and amd64, without success. |
I can reproduce this on a Ubuntu 22.04.4 VM running in UTM (host: macOS 14.6.1 ARM) : ➜ testPKG ./.build/release/CryptoMe Actual true Expected false ➜ testPKG ./.build/checkouts/swift-crypto/scripts/environment.sh This will replace your current pasteboard. Continue? [y/n]y Swift version: Swift version 5.10.1 (swift-5.10.1-RELEASE) Target: aarch64-unknown-linux-gnu Unix version: Linux ubuntuutm 6.8.0-40-generic #40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:53:10 UTC 2 aarch64 aarch64 aarch64 GNU/Linux Creating a debug build has no impact on this: ➜ testPKG ./.build/debug/CryptoMe Actual true Expected false |
@Lukasa I've created a more condensed sample code and it validates correctly on all three platforms: macOS (local), Ubuntu (UTM VM), and the production server (UTM VM). I apologise for the confusion, and I appreciate your patience. I'm closing this thread, as I continue to investigate this further on my end. |
No need to apologise, raising it here was absolutely the right thing to do. I hope you were able to get pointed in the right direction! Thanks for the issue. ✨ |
New Issue Checklist
main
branch)Expected behavior
When generating a signature using
_RSA.Signing.PrivateKey(pemRepresentation:).signature(for:padding:)
, the method should generate identical signatures on macOS 14.6.1 (development machine) versus Ubuntu 22.04.4 LTS.Actual behavior
When generating a signature using
_RSA.Signing.PrivateKey(pemRepresentation:).signature(for:padding:)
, the method generates different outputs on macOS 14.6.1 (development machine) versus Ubuntu 22.04.4 LTS.Steps to reproduce
Test case code for reproducing the behaviour:
Swift Crypto version/commit hash
ce204da
Environment
The text was updated successfully, but these errors were encountered: