Closed dezinezync closed 1 month ago
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 main
?
Does your xctest actually fail on your Linux node?
Yes
Are you actually running Crypto from main?
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 Your pasteboard now contains debug info, paste it on Github
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
https://github.com/apple/swift-crypto/commit/ce204da6f612dbcf131afda1f208115202eae644
Environment