You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Ensure a modifed message results in a false / invalid signature verification
462
+
// Ensure a modified message results in a false / invalid signature verification
463
463
XCTAssertFalse(try rsa.verify(signature:Data(base64Encoded: test.value)!.bytes, for: message.key.bytes +[0x00], variant: variant),"Signature<\(test.key)>::Verified a signature for an incorrect message `\(message.key)`")
464
464
if !message.key.bytes.isEmpty {
465
465
XCTAssertFalse(try rsa.verify(signature:Data(base64Encoded: test.value)!.bytes, for: message.key.bytes.dropLast(), variant: variant),"Signature<\(test.key)>::Verified a signature for an incorrect message `\(message.key)`")
466
466
}
467
-
// Ensure a modifed signature results in a false / invalid signature verification (we replace the last element with a 1 in case the signature is all 0's)
467
+
// Ensure a modified signature results in a false / invalid signature verification (we replace the last element with a 1 in case the signature is all 0's)
468
468
XCTAssertFalse(try rsa.verify(signature:Data(base64Encoded: test.value)!.bytes.shuffled().dropLast()+[0x01], for: message.key.bytes, variant: variant),"Signature<\(test.key)>::Verified a False signature for message `\(message.key)`")
469
469
// Ensure an invalid signature results in an error being thrown
470
470
XCTAssertThrowsError(try rsa.verify(signature:Data(base64Encoded: test.value)!.bytes.dropLast(), for: message.key.bytes, variant: variant),"Signature<\(test.key)>::Verified a False signature for message `\(message.key)`")
@@ -557,12 +557,12 @@ final class RSATests: XCTestCase {
557
557
558
558
// Ensure the signature is valid for the test fixtures rawMessage
// Ensure a modifed message results in a false / invalid signature verification
560
+
// Ensure a modified message results in a false / invalid signature verification
561
561
XCTAssertFalse(try rsa.verify(signature:Data(base64Encoded: test.value)!.bytes, for: message.key.bytes +[0x00], variant: variant),"Signature<\(test.key)>::Verified a signature for an incorrect message `\(message.key)`")
562
562
if !message.key.bytes.isEmpty {
563
563
XCTAssertFalse(try rsa.verify(signature:Data(base64Encoded: test.value)!.bytes, for: message.key.bytes.dropLast(), variant: variant),"Signature<\(test.key)>::Verified a signature for an incorrect message `\(message.key)`")
564
564
}
565
-
// Ensure a modifed signature results in a false / invalid signature verification (we replace the last element with a 1 in case the signature is all 0's)
565
+
// Ensure a modified signature results in a false / invalid signature verification (we replace the last element with a 1 in case the signature is all 0's)
566
566
XCTAssertFalse(try rsa.verify(signature:Data(base64Encoded: test.value)!.bytes.shuffled().dropLast()+[0x01], for: message.key.bytes, variant: variant),"Signature<\(test.key)>::Verified a False signature for message `\(message.key)`")
567
567
// Ensure an invalid signature results in an error being thrown
568
568
XCTAssertThrowsError(try rsa.verify(signature:Data(base64Encoded: test.value)!.bytes.dropLast(), for: message.key.bytes, variant: variant),"Signature<\(test.key)>::Verified a False signature for message `\(message.key)`")
0 commit comments