From 743e71ff92878678df9e006374be1da41503b0c2 Mon Sep 17 00:00:00 2001 From: Joseph Flinn <58369717+joseph-flinn@users.noreply.github.com> Date: Wed, 13 Dec 2023 02:56:34 -0800 Subject: [PATCH 1/7] Fix branch (#2903) --- .github/workflows/version-bump.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 98a3d0c70..8d04c8c5e 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -38,7 +38,7 @@ jobs: uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 with: repository: bitwarden/mobile - ref: master + ref: main token: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }} - name: Import GPG key From f60c4d94fed36d112850a7f67cd6aa863102d3d3 Mon Sep 17 00:00:00 2001 From: Federico Maccaroni Date: Thu, 14 Dec 2023 13:16:32 -0300 Subject: [PATCH 2/7] PM-3350 Fix crash on Release by adding Interpreter on iOS and also adding System.Security.Cryptography to be ignored by the linker --- src/App/App.csproj | 12 ++++++++---- src/iOS.Autofill/iOS.Autofill.csproj | 6 +++++- src/iOS.Extension/iOS.Extension.csproj | 4 ++++ src/iOS.ShareExtension/iOS.ShareExtension.csproj | 4 ++++ 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/App/App.csproj b/src/App/App.csproj index 88018d992..239a3f64d 100644 --- a/src/App/App.csproj +++ b/src/App/App.csproj @@ -53,10 +53,10 @@ false Automatic - iPhone Developer + iPhone Developer Platforms\iOS\Entitlements.plist - all - + true + -gcc_flags "-L$(ProjectDir)../../lib/ios -largon2 -force_load $(ProjectDir)../../lib/ios/libargon2.a" @@ -66,9 +66,13 @@ Automatic:AppStore iPhone Distribution Platforms\iOS\Entitlements.plist - all + true -gcc_flags "-L$(ProjectDir)../../lib/ios -largon2 -force_load $(ProjectDir)../../lib/ios/libargon2.a" + + + + diff --git a/src/iOS.Autofill/iOS.Autofill.csproj b/src/iOS.Autofill/iOS.Autofill.csproj index a61e81397..5a988c2b9 100644 --- a/src/iOS.Autofill/iOS.Autofill.csproj +++ b/src/iOS.Autofill/iOS.Autofill.csproj @@ -25,7 +25,7 @@ Automatic iPhone Developer Entitlements.plist - all + true @@ -37,11 +37,15 @@ false + true -gcc_flags "-L$(ProjectDir)../../lib/ios -largon2 -force_load $(ProjectDir)../../lib/ios/libargon2.a" iPhone Distribution Automatic:AppStore Entitlements.plist + + + diff --git a/src/iOS.Extension/iOS.Extension.csproj b/src/iOS.Extension/iOS.Extension.csproj index 2e19867a7..0ee903fff 100644 --- a/src/iOS.Extension/iOS.Extension.csproj +++ b/src/iOS.Extension/iOS.Extension.csproj @@ -34,11 +34,15 @@ false + true -gcc_flags "-L$(ProjectDir)../../lib/ios -largon2 -force_load $(ProjectDir)../../lib/ios/libargon2.a" iPhone Distribution Automatic:AppStore Entitlements.plist + + + diff --git a/src/iOS.ShareExtension/iOS.ShareExtension.csproj b/src/iOS.ShareExtension/iOS.ShareExtension.csproj index 68376745a..fa5976b9f 100644 --- a/src/iOS.ShareExtension/iOS.ShareExtension.csproj +++ b/src/iOS.ShareExtension/iOS.ShareExtension.csproj @@ -36,11 +36,15 @@ false + true -gcc_flags "-L$(ProjectDir)../../lib/ios -largon2 -force_load $(ProjectDir)../../lib/ios/libargon2.a" iPhone Distribution Automatic:AppStore Entitlements.plist + + + From 2a8e15146e321d453a37efc1de5813b5648267a1 Mon Sep 17 00:00:00 2001 From: Federico Maccaroni Date: Thu, 14 Dec 2023 14:28:20 -0300 Subject: [PATCH 3/7] PM-3350 Apply Cryptography TrimmerRootAssembly only to iOS --- src/App/App.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App/App.csproj b/src/App/App.csproj index 239a3f64d..61112378d 100644 --- a/src/App/App.csproj +++ b/src/App/App.csproj @@ -69,7 +69,7 @@ true -gcc_flags "-L$(ProjectDir)../../lib/ios -largon2 -force_load $(ProjectDir)../../lib/ios/libargon2.a" - + From 8fc1e9a3b90b9a5b8f70042f4416a0ae5ff52d25 Mon Sep 17 00:00:00 2001 From: Federico Maccaroni Date: Thu, 14 Dec 2023 16:32:04 -0300 Subject: [PATCH 4/7] PM-3350 Updated Plugin.Fingerprint so biometrics work --- src/App/App.csproj | 6 +++--- src/Core/Core.csproj | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/App/App.csproj b/src/App/App.csproj index 61112378d..2c88cc36f 100644 --- a/src/App/App.csproj +++ b/src/App/App.csproj @@ -94,7 +94,7 @@ - + @@ -220,8 +220,8 @@ $(Home)/Library/Developer/Xcode/DerivedData/bitwarden-acgkbpwvmebfiofokotvoerzkqcl/Build/Products $([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\..'))/watchOS/bitwarden.xcarchive/Products/Applications/bitwarden.app/Watch Bitwarden.app - >watchsimulator - >watchos + watchsimulator + watchos $(WatchAppBuildPath)/$(Configuration)-$(WatchAppConfiguration)/$(WatchAppBundle) $(WatchAppBuildPath)/$(WatchAppBundle) diff --git a/src/Core/Core.csproj b/src/Core/Core.csproj index 3471f8e48..f9d70cb33 100644 --- a/src/Core/Core.csproj +++ b/src/Core/Core.csproj @@ -38,7 +38,7 @@ all - + From aad87dfdce5e38554d73b9e77a6bda1f0c2e938e Mon Sep 17 00:00:00 2001 From: Federico Maccaroni Date: Thu, 14 Dec 2023 17:28:10 -0300 Subject: [PATCH 5/7] Update .github/workflows/build.yml setup-xcode commit hash Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 30fe5244f..d224884b1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -493,7 +493,7 @@ jobs: app_ci_output_filename: App_x64_Debug steps: - name: Set XCode version - uses: maxim-lobanov/setup-xcode@v1 + uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 with: xcode-version: 15.0.1 From 741214a1ccec890174f0e553679a43c0ef41a50a Mon Sep 17 00:00:00 2001 From: Federico Maccaroni Date: Thu, 14 Dec 2023 17:32:43 -0300 Subject: [PATCH 6/7] PM-3349 PM-3350 Enabled argon2id and fixed one issue with the Uris when getting the icon image --- .../Android/Services/CryptoPrimitiveService.cs | 10 +++++----- src/Core/Utilities/IconImageConverter.cs | 2 +- src/iOS.Core/Services/CryptoPrimitiveService.cs | 15 +++++++-------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/App/Platforms/Android/Services/CryptoPrimitiveService.cs b/src/App/Platforms/Android/Services/CryptoPrimitiveService.cs index 82f8c2038..5dec269fe 100644 --- a/src/App/Platforms/Android/Services/CryptoPrimitiveService.cs +++ b/src/App/Platforms/Android/Services/CryptoPrimitiveService.cs @@ -41,13 +41,13 @@ namespace Bit.Droid.Services JavaSystem.LoadLibrary("argon2"); int keySize = 32; var key = new byte[keySize]; - //argon2id_hash_raw(iterations, memory, parallelism, - // password, password.Length, salt, salt.Length, key, key.Length); + argon2id_hash_raw(iterations, memory, parallelism, + password, password.Length, salt, salt.Length, key, key.Length); return key; } - //[DllImport("argon2", EntryPoint = "argon2id_hash_raw")] - //private static extern int argon2id_hash_raw(int timeCost, int memoryCost, int parallelism, - // byte[] pwd, int pwdlen, byte[] salt, int saltlen, byte[] hash, int hashlen); + [DllImport("argon2", EntryPoint = "argon2id_hash_raw")] + private static extern int argon2id_hash_raw(int timeCost, int memoryCost, int parallelism, + byte[] pwd, int pwdlen, byte[] salt, int saltlen, byte[] hash, int hashlen); } } diff --git a/src/Core/Utilities/IconImageConverter.cs b/src/Core/Utilities/IconImageConverter.cs index 70225579a..d860aa3d8 100644 --- a/src/Core/Utilities/IconImageConverter.cs +++ b/src/Core/Utilities/IconImageConverter.cs @@ -40,7 +40,7 @@ namespace Bit.App.Utilities string image = null; if (cipher.Login.HasUris) { - foreach (var uri in cipher.Login.Uris) + foreach (var uri in cipher.Login.Uris.Where(u => u.Uri != null)) { var hostnameUri = uri.Uri; var isWebsite = false; diff --git a/src/iOS.Core/Services/CryptoPrimitiveService.cs b/src/iOS.Core/Services/CryptoPrimitiveService.cs index 96d4c00f3..e74432dd5 100644 --- a/src/iOS.Core/Services/CryptoPrimitiveService.cs +++ b/src/iOS.Core/Services/CryptoPrimitiveService.cs @@ -1,8 +1,7 @@ -using Bit.Core.Abstractions; +using System.Runtime.InteropServices; +using Bit.Core.Abstractions; using Bit.Core.Enums; using Foundation; -using System; -using System.Runtime.InteropServices; namespace Bit.iOS.Core.Services { @@ -48,8 +47,8 @@ namespace Bit.iOS.Core.Services var passwordData = NSData.FromArray(password); var saltData = NSData.FromArray(salt); - //argon2id_hash_raw(iterations, memory, parallelism, passwordData.Bytes, passwordData.Length, - // saltData.Bytes, saltData.Length, keyData.MutableBytes, keyData.Length); + argon2id_hash_raw(iterations, memory, parallelism, passwordData.Bytes, passwordData.Length, + saltData.Bytes, saltData.Length, keyData.MutableBytes, keyData.Length); var keyBytes = new byte[keyData.Length]; Marshal.Copy(keyData.Bytes, keyBytes, 0, Convert.ToInt32(keyData.Length)); @@ -61,8 +60,8 @@ namespace Bit.iOS.Core.Services private static extern int CCKeyCerivationPBKDF(uint algorithm, IntPtr password, nuint passwordLen, IntPtr salt, nuint saltLen, uint prf, nuint rounds, IntPtr derivedKey, nuint derivedKeyLength); - //[DllImport("__Internal", EntryPoint = "argon2id_hash_raw")] - //private static extern int argon2id_hash_raw(int timeCost, int memoryCost, int parallelism, IntPtr pwd, - // nuint pwdlen, IntPtr salt, nuint saltlen, IntPtr hash, nuint hashlen); + [DllImport("__Internal", EntryPoint = "argon2id_hash_raw")] + private static extern int argon2id_hash_raw(int timeCost, int memoryCost, int parallelism, IntPtr pwd, + nuint pwdlen, IntPtr salt, nuint saltlen, IntPtr hash, nuint hashlen); } } From 3a40a4cda8d96ed806b0ab39dea9bfb64a792150 Mon Sep 17 00:00:00 2001 From: Federico Maccaroni Date: Thu, 14 Dec 2023 17:52:11 -0300 Subject: [PATCH 7/7] PM-3349 Upgraded Android targetSdkVersion to 34 --- src/App/Platforms/Android/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App/Platforms/Android/AndroidManifest.xml b/src/App/Platforms/Android/AndroidManifest.xml index ca3072fa7..2a9157e00 100644 --- a/src/App/Platforms/Android/AndroidManifest.xml +++ b/src/App/Platforms/Android/AndroidManifest.xml @@ -1,6 +1,6 @@  - +