Skip to content

Commit d7a769b

Browse files
authored
Merge pull request #3752 from bbirman/test-failure-notification
Fix testNotificationTransformNonRSASecret failure
2 parents f38dfb6 + a2c0222 commit d7a769b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

libs/SalesforceSDKCore/SalesforceSDKCoreTests/SFSDKEncryptedPushNotificationTests.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,13 @@ - (void)testNotificationTransformNonRSASecret {
190190
NSError *nonRSASecretError = nil;
191191
BOOL result = [SFSDKPushNotificationDecryption decryptNotificationContent:notifContent error:&nonRSASecretError];
192192
XCTAssertFalse(result);
193-
XCTAssertEqual(nonRSASecretError.code, SFSDKPushNotificationErrorSecretDecryptionFailed);
193+
if (@available(iOS 17.4, *)) {
194+
// As of 17.4, decrypting a bad key with PKCS1 returns data instead of nil, so the secret decryption doesn't fail
195+
// at the same point as before but using it later to decrypt the content still fails
196+
XCTAssertEqual(nonRSASecretError.code, SFSDKPushNotificationErrorContentDecryptionFailed);
197+
} else {
198+
XCTAssertEqual(nonRSASecretError.code, SFSDKPushNotificationErrorSecretDecryptionFailed);
199+
}
194200
}
195201

196202
- (void)testNotificationTransformMalformedContent {

0 commit comments

Comments
 (0)