-
Notifications
You must be signed in to change notification settings - Fork 26
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
Feat/add argon2 and kyber #1291
Open
TamaraFinogina
wants to merge
9
commits into
PB-2666-implement-pqc-on-drive
Choose a base branch
from
feat/add-argon2-and-kyber
base: PB-2666-implement-pqc-on-drive
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ecb4219
switch to Argon2id with default paramaters
f7dd6ad
add kyber keys and post-quantum part to encryption/decryption of mnem…
cec628a
revert changes to jest.config.js
5b211ce
fix pgp tests
84450a8
fix all but playwright tests
31caea6
exclude failing tests (playwright and cypress)
6f65cec
remove redundant changes
74557c0
put spyOn before the calls
4689dfe
add patch for @internxt/sdk for the built
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 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 |
---|---|---|
@@ -1,11 +1,10 @@ | ||
{ | ||
"editor.formatOnPaste": true, | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true, | ||
"source.fixAll.format": true | ||
}, | ||
"svg.preview.background": "editor" | ||
} | ||
|
||
"editor.formatOnPaste": true, | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit", | ||
"source.fixAll.format": "explicit" | ||
}, | ||
"svg.preview.background": "editor" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
|
@@ -3,11 +3,12 @@ | |
"version": "v1.0.320", | ||
"private": true, | ||
"dependencies": { | ||
"@dashlane/pqc-kem-kyber512-browser": "^1.0.0", | ||
"@headlessui/react": "1.7.5", | ||
"@iconscout/react-unicons": "^1.1.6", | ||
"@internxt/inxt-js": "=1.2.21", | ||
"@internxt/lib": "^1.2.0", | ||
"@internxt/sdk": "^1.5.15", | ||
"@internxt/sdk": "1.5.17", | ||
"@phosphor-icons/react": "^2.1.7", | ||
"@popperjs/core": "^2.11.6", | ||
"@reduxjs/toolkit": "^1.6.0", | ||
|
@@ -17,6 +18,7 @@ | |
"@stripe/stripe-js": "^3.5.0", | ||
"@typeform/embed-react": "^1.19.0", | ||
"@types/uuid": "^8.3.4", | ||
"argon2": "^0.41.1", | ||
"asmcrypto.js": "git+https://github.com/asmcrypto/asmcrypto.js.git", | ||
"assert": "^2.1.0", | ||
"axios": "^0.21.1", | ||
|
@@ -43,6 +45,7 @@ | |
"lodash": "^4.17.21", | ||
"openpgp": "^5.9.0", | ||
"os-browserify": "^0.3.0", | ||
"patch-package": "^8.0.0", | ||
"path-browserify": "^1.0.1", | ||
"prettysize": "^2.0.0", | ||
"query-string": "^6.13.8", | ||
|
@@ -80,25 +83,27 @@ | |
"url": "^0.11.3", | ||
"util": "^0.12.5", | ||
"uuid": "^8.3.2", | ||
"vitest": "^2.1.1", | ||
"web-vitals": "^0.2.4", | ||
"xlsx-preview": "^1.0.4" | ||
}, | ||
"scripts": { | ||
"postinstall": "patch-package", | ||
"preinstall": "node scripts/use-yarn.js", | ||
"prepare": "husky install", | ||
"dev": "craco start", | ||
"start": "craco start", | ||
"build": "craco build", | ||
"vercel:install": "yarn run add:npmrc && yarn install", | ||
"test:unit": "jest src/ && jest test/unit", | ||
"test:unit": "vitest run test/unit && vitest run src/ ", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting change, with Vitest the problems with global meta variable has gone? |
||
"test:e2e": "node ./cypress-transform-dotenv.js && cypress run --project test/e2e", | ||
"cypress:open": "node ./cypress-transform-dotenv.js && cypress open --project test/e2e", | ||
"test:playwright": "yarn playwright test", | ||
"test:chromium": "yarn playwright test --project=chromium", | ||
"test:firefox": "yarn playwright test --project=firefox", | ||
"test:safari": "yarn playwright test --project=webkit", | ||
"test:edge": "yarn playwright test --project=edge", | ||
"test": "npm run test:unit && npm run test:e2e", | ||
"test": "vitest run", | ||
"eject": "react-scripts eject", | ||
"format": "prettier \"{src,test}/**/*.{ts,tsx}\" --write", | ||
"lint:ts": "eslint \"./{src,test}/**/*.{ts,tsx}\"", | ||
|
@@ -129,14 +134,12 @@ | |
"@internxt/prettier-config": "^1.0.1", | ||
"@playwright/test": "^1.44.1", | ||
"@testing-library/dom": "^7.26.0", | ||
"@testing-library/jest-dom": "^6.1.3", | ||
"@testing-library/react": "^11.1.0", | ||
"@testing-library/user-event": "^12.1.10", | ||
"@types/analytics-node": "^3.1.3", | ||
"@types/async": "^3.2.7", | ||
"@types/file-saver": "^2.0.3", | ||
"@types/filesystem": "^0.0.32", | ||
"@types/jest": "^29.5.5", | ||
"@types/lodash": "^4.14.172", | ||
"@types/node": "^12.0.0", | ||
"@types/openpgp": "^4.4.18", | ||
|
@@ -148,6 +151,7 @@ | |
"@types/segment-analytics": "^0.0.34", | ||
"@types/streamsaver": "^2.0.1", | ||
"@types/wicg-file-system-access": "^2020.9.4", | ||
"@vitest/browser": "^2.1.1", | ||
"autoprefixer": "^10.4.16", | ||
"buffer": "^6.0.3", | ||
"cross-env": "^7.0.3", | ||
|
@@ -171,7 +175,6 @@ | |
"stylelint-config-standard": "^20.0.0", | ||
"stylelint-scss": "^3.17.2", | ||
"tailwindcss": "^3.3.4", | ||
"ts-jest": "27.1.5", | ||
"typescript": "^4.4.2", | ||
"webpack-bundle-analyzer": "^4.9.1" | ||
}, | ||
|
This file contains 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 |
---|---|---|
@@ -0,0 +1,108 @@ | ||
diff --git a/node_modules/@internxt/sdk/.DS_Store b/node_modules/@internxt/sdk/.DS_Store | ||
new file mode 100644 | ||
index 0000000..945abaa | ||
Binary files /dev/null and b/node_modules/@internxt/sdk/.DS_Store differ | ||
diff --git a/node_modules/@internxt/sdk/dist/auth/index.js b/node_modules/@internxt/sdk/dist/auth/index.js | ||
index 0389bcd..aa76d63 100644 | ||
--- a/node_modules/@internxt/sdk/dist/auth/index.js | ||
+++ b/node_modules/@internxt/sdk/dist/auth/index.js | ||
@@ -75,6 +75,8 @@ var Auth = /** @class */ (function () { | ||
salt: registerDetails.salt, | ||
privateKey: registerDetails.keys.privateKeyEncrypted, | ||
publicKey: registerDetails.keys.publicKey, | ||
+ privateKyberKey: registerDetails.keys.privateKyberKeyEncrypted, | ||
+ publicKyberKey: registerDetails.keys.publicKyberKey, | ||
revocationKey: registerDetails.keys.revocationCertificate, | ||
referral: registerDetails.referral, | ||
referrer: registerDetails.referrer, | ||
@@ -96,6 +98,8 @@ var Auth = /** @class */ (function () { | ||
salt: registerDetails.salt, | ||
privateKey: registerDetails.keys.privateKeyEncrypted, | ||
publicKey: registerDetails.keys.publicKey, | ||
+ privateKyberKey: registerDetails.keys.privateKyberKeyEncrypted, | ||
+ publicKyberKey: registerDetails.keys.publicKyberKey, | ||
revocationKey: registerDetails.keys.revocationCertificate, | ||
referral: registerDetails.referral, | ||
referrer: registerDetails.referrer, | ||
@@ -136,9 +140,11 @@ var Auth = /** @class */ (function () { | ||
case 1: | ||
securityDetails = _a.sent(); | ||
encryptedSalt = securityDetails.encryptedSalt; | ||
- encryptedPasswordHash = cryptoProvider.encryptPasswordHash(details.password, encryptedSalt); | ||
- return [4 /*yield*/, cryptoProvider.generateKeys(details.password)]; | ||
+ return [4 /*yield*/, cryptoProvider.encryptPasswordHash(details.password, encryptedSalt)]; | ||
case 2: | ||
+ encryptedPasswordHash = _a.sent(); | ||
+ return [4 /*yield*/, cryptoProvider.generateKeys(details.password)]; | ||
+ case 3: | ||
keys = _a.sent(); | ||
return [2 /*return*/, this.client | ||
.post('/access', { | ||
@@ -148,6 +154,8 @@ var Auth = /** @class */ (function () { | ||
privateKey: keys.privateKeyEncrypted, | ||
publicKey: keys.publicKey, | ||
revocateKey: keys.revocationCertificate, | ||
+ publicKyberKey: keys.publicKyberKey, | ||
+ privateKyberKey: keys.privateKyberKeyEncrypted, | ||
}, this.basicHeaders()) | ||
.then(function (data) { | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
@@ -169,6 +177,8 @@ var Auth = /** @class */ (function () { | ||
publicKey: keys.publicKey, | ||
privateKey: keys.privateKeyEncrypted, | ||
revocationKey: keys.revocationCertificate, | ||
+ publicKyberKey: keys.publicKyberKey, | ||
+ privateKyberKey: keys.privateKyberKeyEncrypted, | ||
}, this.headersWithToken(token)); | ||
}; | ||
/** | ||
diff --git a/node_modules/@internxt/sdk/dist/auth/types.d.ts b/node_modules/@internxt/sdk/dist/auth/types.d.ts | ||
index c104ac5..d9ec1b8 100644 | ||
--- a/node_modules/@internxt/sdk/dist/auth/types.d.ts | ||
+++ b/node_modules/@internxt/sdk/dist/auth/types.d.ts | ||
@@ -33,9 +33,11 @@ export interface Keys { | ||
privateKeyEncrypted: string; | ||
publicKey: string; | ||
revocationCertificate: string; | ||
+ publicKyberKey: string; | ||
+ privateKyberKeyEncrypted: string; | ||
} | ||
export interface CryptoProvider { | ||
- encryptPasswordHash: (password: Password, encryptedSalt: string) => string; | ||
+ encryptPasswordHash: (password: Password, encryptedSalt: string) => Promise<string>; | ||
generateKeys: (password: Password) => Promise<Keys>; | ||
} | ||
export declare class UserAccessError extends Error { | ||
diff --git a/node_modules/@internxt/sdk/dist/drive/users/types.d.ts b/node_modules/@internxt/sdk/dist/drive/users/types.d.ts | ||
index 60143e8..f6038c6 100644 | ||
--- a/node_modules/@internxt/sdk/dist/drive/users/types.d.ts | ||
+++ b/node_modules/@internxt/sdk/dist/drive/users/types.d.ts | ||
@@ -15,6 +15,7 @@ export interface ChangePasswordPayload { | ||
export declare type UpdateProfilePayload = Partial<Pick<UserSettings, 'name' | 'lastname'>>; | ||
export declare type PreCreateUserResponse = { | ||
publicKey: string; | ||
+ publicKyberKey: string; | ||
user: { | ||
uuid: UUID; | ||
email: string; | ||
@@ -28,6 +29,7 @@ export declare type FriendInvite = { | ||
}; | ||
export declare type UserPublicKeyResponse = { | ||
publicKey: string; | ||
+ publicKyberKey: string; | ||
}; | ||
export declare type VerifyEmailChangeResponse = { | ||
oldEmail: string; | ||
diff --git a/node_modules/@internxt/sdk/dist/shared/types/userSettings.d.ts b/node_modules/@internxt/sdk/dist/shared/types/userSettings.d.ts | ||
index 1a78d69..b855661 100644 | ||
--- a/node_modules/@internxt/sdk/dist/shared/types/userSettings.d.ts | ||
+++ b/node_modules/@internxt/sdk/dist/shared/types/userSettings.d.ts | ||
@@ -18,6 +18,8 @@ export interface UserSettings { | ||
mnemonic: string; | ||
privateKey: string; | ||
publicKey: string; | ||
+ privateKyberKey: string; | ||
+ publicKyberKey: string; | ||
revocationKey: string; | ||
teams?: boolean; | ||
appSumoDetails: AppSumoDetails | null; |
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has to be added to the gitignore, as it is part of the vs code configuration.