-
Notifications
You must be signed in to change notification settings - Fork 51
#5956 Add user ids preservation upon fixing keys #5958
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
Merged
sosnovsky
merged 14 commits into
master
from
issue-5956-preserve-original-userids-during-key-fix
Apr 4, 2025
Merged
Changes from 11 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
12c82ab
feat: add user ids preservation upon fixing keys
e2f4765
refactor: remove console.log()
9bcb908
Merge remote-tracking branch 'origin/master' into issue-5956-preserve…
bc9e909
Merge remote-tracking branch 'origin/master' into issue-5956-preserve…
martgil 9877dbc
test: add test key with image
martgil 6fcfb94
test: add comment to key
martgil 7de818c
test: add test
martgil 5fb71c3
Merge branch 'master' into issue-5956-preserve-original-userids-durin…
martgil c566eb2
refactor: use 120k character limit in case of key with image
martgil 403619e
test: fix failing test
martgil 8613e4b
Merge branch 'master' into issue-5956-preserve-original-userids-durin…
martgil e50a9ba
Merge branch 'master' into issue-5956-preserve-original-userids-durin…
martgil 51b59dd
test: fix failing test
martgil 312d980
test: fix failing test
martgil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ import { KeyInfoWithIdentity, KeyUtil, PubkeyInfoWithLastCheck } from '../core/c | |
import { Buf } from '../core/buf'; | ||
import { GoogleData } from '../mock/google/google-data'; | ||
import Parse from './../util/parse'; | ||
import { OpenPGPKey } from '../core/crypto/pgp/openpgp-key'; | ||
import { KeyWithPrivateFields, OpenPGPKey } from '../core/crypto/pgp/openpgp-key'; | ||
import { BrowserHandle, ControllablePage } from '../browser'; | ||
import { AvaContext } from './tooling'; | ||
import { ConfigurationProvider, HttpClientErr, Status } from '../mock/lib/api'; | ||
|
@@ -1132,6 +1132,38 @@ export const defineSettingsTests = (testVariant: TestVariant, testWithBrowser: T | |
await settingsPage.close(); | ||
}) | ||
); | ||
test( | ||
'settings - fix and import keypair with embedded image generated from gpg2', | ||
testWithBrowser(async (t, browser) => { | ||
t.context.mockApi!.configProvider = new ConfigurationProvider({ | ||
attester: { | ||
pubkeyLookup: {}, | ||
}, | ||
}); | ||
const acct = '[email protected]'; | ||
const settingsPage = await BrowserRecipe.openSettingsLoginApprove(t, browser, acct); | ||
await SetupPageRecipe.manualEnter(settingsPage, '', { | ||
fixKey: true, | ||
key: { | ||
title: '', | ||
armored: testConstants.keyWithEmbeddedImage, | ||
passphrase: 'passphrase', | ||
longid: '1ABCEBCA0A4FB17C', | ||
}, | ||
}); | ||
await SettingsPageRecipe.toggleScreen(settingsPage, 'additional'); | ||
await settingsPage.waitAndClick('@action-open-pubkey-page'); | ||
const myKeyFrame = await settingsPage.getFrame(['my_key.htm']); | ||
const downloadedFile = await myKeyFrame.awaitDownloadTriggeredByClicking('@action-download-prv'); | ||
const fileName = 'flowcrypt-backup-flowcryptcompatibilitygmailcom-0x1ABCEBCA0A4FB17C.asc'; | ||
const parsedKey = (await KeyUtil.parse(downloadedFile[fileName].toString())) as KeyWithPrivateFields; | ||
const originalKey = (await KeyUtil.parse(testConstants.keyWithEmbeddedImage)) as KeyWithPrivateFields; | ||
expect(originalKey.rawKey?.users[2].userID?.userID === undefined); | ||
expect(parsedKey.rawKey?.users[2].userID?.userID === '[email protected] <[email protected]>'); | ||
expect(originalKey.rawKey?.users.length).to.equal(5); | ||
expect(parsedKey.rawKey?.users.length).to.equal(4); | ||
}) | ||
); | ||
test( | ||
'settings - my key page - update private key from file', | ||
testWithBrowser(async (t, browser) => { | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.