Skip to content
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

#2614 fix: decryption error for message sent via encrypted contact page #2640

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion FlowCrypt/Core/CoreTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,10 @@ struct MsgBlock: Decodable {

struct AttMeta: Decodable {
let name: String
let data: String
let data: String?
let type: String
let length: Int
let url: String?
let treatAs: String?
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,17 @@ extension MessageAttachment {
}

init?(attMeta: MsgBlock.AttMeta) {
guard let data = Data(base64Encoded: attMeta.data.data()) else {
if let urlString = attMeta.url, let url = URL(string: urlString) {
// Fetch data synchronously from the URL
if let urlData = try? Data(contentsOf: url) {
self.init(name: attMeta.name, data: urlData, mimeType: attMeta.type, treatAs: "encryptedFile")
return
}
return nil
}
guard let attData = attMeta.data, let data = Data(base64Encoded: attData.data()) else {
return nil
}

self.init(name: attMeta.name, data: data, mimeType: attMeta.type, treatAs: attMeta.treatAs)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"acctEmail": "[email protected]",
"full": {
"id": "192d58178bf2ca46",
"threadId": "192d58178bf2ca46",
"labelIds": ["CATEGORY_PERSONAL", "INBOX"],
"snippet": "This message was submitted through a web form. The sender's email address was not verified. -----BEGIN PGP MESSAGE----- wV4DT2ZlSmhZ1GoSAQdAx0ulnySITf0eKoHAeLhiXsFsaVofBF6SSQdyJEAM",
"payload": {
"partId": "",
"mimeType": "multipart/mixed",
"filename": "",
"headers": [
{
"name": "Content-Type",
"value": "multipart/mixed; boundary=\"===============8921743240882101210==\""
},
{
"name": "MIME-Version",
"value": "1.0"
},
{
"name": "Subject",
"value": "Test encrypted message sent via encrypted contact page with attachment"
},
{
"name": "From",
"value": "[email protected]"
},
{
"name": "To",
"value": "[email protected]"
},
{
"name": "Reply-To",
"value": "[email protected]"
},
{
"name": "Date",
"value": "Mon, 28 Oct 2024 23:41:24 +0000"
},
{
"name": "X-SES-Outgoing",
"value": "2024.10.28-69.169.224.13"
}
],
"body": {
"size": 0
},
"parts": [
{
"partId": "0",
"mimeType": "multipart/alternative",
"filename": "",
"headers": [
{
"name": "Content-Type",
"value": "multipart/alternative; boundary=\"===============0980079176639676948==\""
},
{
"name": "MIME-Version",
"value": "1.0"
}
],
"body": {
"size": 0
},
"parts": [
{
"partId": "0.0",
"mimeType": "text/plain",
"filename": "",
"headers": [
{
"name": "MIME-Version",
"value": "1.0"
},
{
"name": "Content-Type",
"value": "text/plain; charset=\"utf-8\""
},
{
"name": "Content-Transfer-Encoding",
"value": "base64"
}
],
"body": {
"size": 820,
"data": "VGhpcyBtZXNzYWdlIHdhcyBzdWJtaXR0ZWQgdGhyb3VnaCBhIHdlYiBmb3JtLiBUaGUgc2VuZGVyJ3MgZW1haWwgYWRkcmVzcyB3YXMgbm90IHZlcmlmaWVkLgoKLS0tLS1CRUdJTiBQR1AgTUVTU0FHRS0tLS0tDQoKCndWNERUMlpsU21oWjFHb1NBUWRBeDB1bG55U0lUZjBlS29IQWVMaGlYc0ZzYVZvZkJGNlNTUWR5SkVBTQpmWE13TU9ZUnNNU0hvQ0tONHdGVGxDTVJ4T2IvNFRDRVlCWkt5Ly84L2VLN3g3SzVBUUpiMkYrNGt1UzQKVW5FRWYrTUowc0RFQWJIOVZEZXJjMS9VMS9GMlBYQUFtOTBKdlk3SVEzVm4vUXl4eHp4czY5dmJncVlLCkMzMGNrMXBObEhRWGM3QmFMZk5HMFFvY3JIRFpmQWhvR0JHLzczVWxxbEkzemFkTC9JLy8rQ2dPbExGUApydVpOdWcrbytNVm42Yk5MdU1Gb1pHc1lueXI1aGdlcmVwZDFJTXF0MlIvdnI0K2U1Zzk5VTF2aGc2RkUKZ29RVmMyazhZS2tlSzlhNHN2MlVyRjFEalU4VzlCZXNXOHN4NmlrZjh2dlg1OXkrbmRqUW5GUStVVjN3CldaUFFGS0xJelVvVUVqYlArZDdQb2FJd1ZQUTJVcjZKZnJxS2VzYkJWOTBwVEhIQUNoc1N1Qzdzcjh5WgpFNmFtVURheEhqUkx4SzNhVTlBNnJiOUwxOWh0a01zelYwU01ZeHdhQ3V5VHJ3eUJ0bXNTMkVJZkhUa24Ka0YxeWx5Y3JpQVpIOEp6ZFVjaWFySkxUNTl4cmUyZk5kRXFYNFcrbjVSS1RUMks1UXFRSDlXbldBZEtnCkJab3NHTGlsTVZqbVVzalNKS0s5ZUVKNlNVZFF4WFpybW9FbXBkckhDY3pJTGtjSXJwSXNMOG90Y2dodwpQSVYrWGhneTl0MHVRQXR2bXBzN1ErOUU4UGpDRmtoOVpKTGpXcmM4c0ljUGtVV293dz09Cj16L0V2Ci0tLS0tRU5EIFBHUCBNRVNTQUdFLS0tLS0NCg=="
}
}
]
}
]
},
"sizeEstimate": 6548,
"historyId": "320850",
"internalDate": "1730158884000"
},
"attachments": {},
"raw": {
"id": "192d58178bf2ca46",
"threadId": "192d58178bf2ca46",
"labelIds": ["CATEGORY_PERSONAL", "INBOX"],
"snippet": "This message was submitted through a web form. The sender's email address was not verified. -----BEGIN PGP MESSAGE----- wV4DT2ZlSmhZ1GoSAQdAx0ulnySITf0eKoHAeLhiXsFsaVofBF6SSQdyJEAM",
"sizeEstimate": 6548,
"raw": "RGVsaXZlcmVkLVRvOiBlMmUuZW50ZXJwcmlzZS50ZXN0QGZsb3djcnlwdC5jb20NClJlY2VpdmVkOiBieSAyMDAyOmEwNTo2MzU5OjVmMDE6YjA6MWMwOmM1YjE6NWYyNCB3aXRoIFNNVFAgaWQgbGYxY3NwMTg1ODIyNnJ3YzsNCiAgICAgICAgTW9uLCAyOCBPY3QgMjAyNCAxNjo0MTo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EyMTA9PS0tDQo=",
"historyId": "320850",
"internalDate": "1730158884000"
}
}
3 changes: 2 additions & 1 deletion appium/api-mocks/apis/google/google-messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ export type GoogleMockMessage =
| 'Test forward message with attached pub key'
| 'Encrypted email with public key attached'
| 'Email with another user public key attached'
| 'Test remote images #2414';
| 'Test remote images #2414'
| 'Test encrypted message sent via encrypted contact page with attachment';
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { MockApi } from 'api-mocks/mock';
import { MockApiConfig } from 'api-mocks/mock-config';
import { SplashScreen, SetupKeyScreen, MailFolderScreen, EmailScreen } from '../../../screenobjects/all-screens';

describe('INBOX: ', () => {
it('user is able to view correct attachment for email sent via encrypted contact page', async () => {
const mockApi = new MockApi();
const subject = 'Test encrypted message sent via encrypted contact page with attachment';

mockApi.fesConfig = MockApiConfig.defaultEnterpriseFesConfiguration;
mockApi.ekmConfig = MockApiConfig.defaultEnterpriseEkmConfiguration;
mockApi.addGoogleAccount('[email protected]', {
messages: [subject],
});

await mockApi.withMockedApis(async () => {
await SplashScreen.mockLogin();
await SetupKeyScreen.setPassPhrase();
await MailFolderScreen.checkInboxScreen();

// check if email is decrypted successfully
await MailFolderScreen.clickOnEmailBySubject(subject);
await EmailScreen.checkOpenedEmail(
'[email protected]',
subject,
'Test encrypted attachment sent via encrypted contact page',
);
await EmailScreen.checkAttachment('manifest.json.pgp');
});
});
});
Loading