apple / swift-crypto

Open-source implementation of a substantial portion of the API of Apple CryptoKit suitable for use on Linux platforms.
https://apple.github.io/swift-crypto
Apache License 2.0
1.47k stars 166 forks source link

fix failing RSA test 'testHandlingNonStandardKeys' #187

Closed Sajjon closed 1 year ago

Sajjon commented 1 year ago

Fix failing test testHandlingNonStandardKeys

Possible regression from https://github.com/apple/swift-crypto/pull/151 ? The tests failed for me when I set let development = true in Package.swift and run target "My Mac" running 13.5 Beta (22G5059d) on a Macbook M1.

Checklist

If you've made changes to gyb files

Motivation:

Tests should not fail.

Modifications:

Changed from XCTAssertEqual which failed to XCTAssertThrowsError to capture the fact that the test tests PEM and DER representations which were not a multiple of 8 bits in length.

Result:

All tests pass.

Lukasa commented 1 year ago

This is not a regression but a behavioural change, see #185. A fix has been discussed there.