fix(security): закрыть трамплин прокси и ограничить итерации pbkdf2
ProxyShortcutActivity больше не экспортирован - чужое приложение могло гасить VPN интентом; ярлык, виджет и плитка стартуют от нашей личности. Число итераций из файла бэкапа ограничено диапазоном.
This commit is contained in:
1 parent
df4c5d9af1
commit
8d07f6d1ab
2 files changed
+4
-9
No files matched your search
@@ -26,13 +26,6 @@
|
|||||||
android:name="android.permission.QUERY_ALL_PACKAGES"
|
android:name="android.permission.QUERY_ALL_PACKAGES"
|
||||||
tools:ignore="PackageVisibilityPolicy,QueryAllPackagesPermission" />
|
tools:ignore="PackageVisibilityPolicy,QueryAllPackagesPermission" />
|
||||||
|
|
||||||
<queries>
|
|
||||||
<intent>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent>
|
|
||||||
</queries>
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".App"
|
android:name=".App"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
@@ -74,10 +67,9 @@
|
|||||||
android:resource="@xml/shortcuts" />
|
android:resource="@xml/shortcuts" />
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<!-- Трамплин внешних входов (ярлыки, виджет, тайл): START с запросом согласия на VPN. -->
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".service.ProxyShortcutActivity"
|
android:name=".service.ProxyShortcutActivity"
|
||||||
android:exported="true"
|
android:exported="false"
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
android:taskAffinity=""
|
android:taskAffinity=""
|
||||||
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
|
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ object BackupCrypto {
|
|||||||
private const val MAGIC = "freeturn-backup"
|
private const val MAGIC = "freeturn-backup"
|
||||||
private const val VERSION = 1
|
private const val VERSION = 1
|
||||||
private const val ITERATIONS = 210_000
|
private const val ITERATIONS = 210_000
|
||||||
|
private const val MIN_ITERATIONS = 100_000
|
||||||
|
private const val MAX_ITERATIONS = 2_000_000
|
||||||
private const val KEY_BITS = 256
|
private const val KEY_BITS = 256
|
||||||
private const val SALT_LEN = 16
|
private const val SALT_LEN = 16
|
||||||
private const val IV_LEN = 12
|
private const val IV_LEN = 12
|
||||||
@@ -56,6 +58,7 @@ object BackupCrypto {
|
|||||||
}
|
}
|
||||||
if (o.optString("magic") != MAGIC) throw FormatException("not a FreeTurn backup")
|
if (o.optString("magic") != MAGIC) throw FormatException("not a FreeTurn backup")
|
||||||
val iter = o.optInt("iter", ITERATIONS)
|
val iter = o.optInt("iter", ITERATIONS)
|
||||||
|
if (iter !in MIN_ITERATIONS..MAX_ITERATIONS) throw FormatException("bad iteration count")
|
||||||
val salt = unb64(o, "salt")
|
val salt = unb64(o, "salt")
|
||||||
val iv = unb64(o, "iv")
|
val iv = unb64(o, "iv")
|
||||||
val ct = unb64(o, "ct")
|
val ct = unb64(o, "ct")
|
||||||
|
|||||||
Reference in new issue
Block a user