From 531e03797496fcdcefce9b49a333055829fb5049 Mon Sep 17 00:00:00 2001 From: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Date: Wed, 25 Oct 2023 00:17:29 -0600 Subject: [PATCH] Bugfix/argon2 mem usage (#2474) * reduce argon2 memory usage * update FE argon2 * fix missing typedefs --- backend/src/disk/mount/backup.rs | 4 ++-- frontend/package-lock.json | 6 ++++-- frontend/package.json | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/backend/src/disk/mount/backup.rs b/backend/src/disk/mount/backup.rs index a3e239b2b..a19056241 100644 --- a/backend/src/disk/mount/backup.rs +++ b/backend/src/disk/mount/backup.rs @@ -84,7 +84,7 @@ impl BackupMountGuard { argon2::hash_encoded( password.as_bytes(), &rand::random::<[u8; 16]>()[..], - &argon2::Config::default(), + &argon2::Config::rfc9106_low_mem(), ) .with_kind(crate::ErrorKind::PasswordHashGeneration)?, ); @@ -134,7 +134,7 @@ impl BackupMountGuard { argon2::hash_encoded( new_password.as_bytes(), &rand::random::<[u8; 16]>()[..], - &argon2::Config::default(), + &argon2::Config::rfc9106_low_mem(), ) .with_kind(crate::ErrorKind::PasswordHashGeneration)?, ); diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 5e2a730fe..40a67f4d9 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -23,7 +23,7 @@ "@ng-web-apis/common": "^2.0.0", "@ng-web-apis/mutation-observer": "^2.0.0", "@ng-web-apis/resize-observer": "^2.0.0", - "@start9labs/argon2": "^0.1.0", + "@start9labs/argon2": "^0.2.2", "@start9labs/emver": "^0.1.5", "@taiga-ui/addon-charts": "3.20.0", "@taiga-ui/cdk": "3.20.0", @@ -5283,7 +5283,9 @@ } }, "node_modules/@start9labs/argon2": { - "version": "0.1.0" + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@start9labs/argon2/-/argon2-0.2.2.tgz", + "integrity": "sha512-OEJYDIicwwWg0NgG3d2GSO2Qs65B0LY9dIrlXFIJZJ1mo9vcDIU0kC2Yp8dg4XMt2U16ncsgru98s9I+y5Yuaw==" }, "node_modules/@start9labs/emver": { "version": "0.1.5", diff --git a/frontend/package.json b/frontend/package.json index 28e90e9a8..e001b4484 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -48,7 +48,7 @@ "@ng-web-apis/common": "^2.0.0", "@ng-web-apis/mutation-observer": "^2.0.0", "@ng-web-apis/resize-observer": "^2.0.0", - "@start9labs/argon2": "^0.1.0", + "@start9labs/argon2": "^0.2.2", "@start9labs/emver": "^0.1.5", "@taiga-ui/addon-charts": "3.20.0", "@taiga-ui/cdk": "3.20.0",