Bug 26690 - Port padlock states for .onion services to mobilePrior to this patch, TBA was showing all onion services as SSL/TLSencrypted connections(lock icon).This patch fixes the issue adding several new Onion icons to indicateall the various permutations of the Onions services hosted HTTP or HTTPSpages.
I feel like "onion_active" doesn't describe the state well. Can we call it onion_lock (or something similar)? When I see IconType.ONION_ACTIVATE in the code, I don't immediately remember what that means. I think IconType.ONION_LOCK be a little better. And maybe the icons that don't contain locks shouldn't have "lock" in their name? Thoughts?
@@ -100,6 +103,8 @@ public class SecurityModeUtil { final MixedMode displayMixedMode = identity.getMixedModeDisplay(); final TrackingMode trackingMode = identity.getTrackingMode(); final boolean securityException = identity.isSecurityException();+ final boolean isOnionHost = identity.isOnionHost();+ final boolean hasCert = identity.hasCert();
These changes in mobile/android/base/java/org/mozilla/gecko/toolbar/SiteIdentityPopup.java are #27657 (moved), so I'm not sure we should implement this yet (although I like it).
Is this needed? Can the SecurityMode be Verified or Identified without a cert? (I don't see a code path that allows this, but it's possible I missed it)
From the commit message:
{{{
Prior to this patch, TBA was showing all onion services as SSL/TLS
encrypted connections(lock icon).
}}}
Nit: That isn't true, is it? Maybe I'm misreading it. Currently, onion sites served without TLS do not show a lock icon, right?
Yeah, you are right. I updated the commit msg.
{{{
<item
android:drawable="@drawable/ic_lock_onion_active"
android:maxLevel="8"/>
}}}
I feel like "onion_active" doesn't describe the state well. Can we call it onion_lock (or something similar)? When I see IconType.ONION_ACTIVATE in the code, I don't immediately remember what that means. I think IconType.ONION_LOCK be a little better. And maybe the icons that don't contain locks shouldn't have "lock" in their name? Thoughts?
I renamed them.
{{{
@@ -100,6 +103,8 @@ public class SecurityModeUtil {
final MixedMode displayMixedMode = identity.getMixedModeDisplay();
final TrackingMode trackingMode = identity.getTrackingMode();
final boolean securityException = identity.isSecurityException();
final boolean isOnionHost = identity.isOnionHost();
final boolean hasCert = identity.hasCert();
}}}
Nit: Please correct the indentation
Duh! Updated it.
{{{
@@ -119,9 +124,15 @@ public class SecurityModeUtil {
return IconType.DEFAULT;
}
int resId = siteIdentity.isOnionHost() ? R.drawable.ic_lock_onion_disabled : R.drawable.ic_lock_disabled;
mIcon.setImageResource(resId);
}}}
These changes in mobile/android/base/java/org/mozilla/gecko/toolbar/SiteIdentityPopup.java are #27657 (moved), so I'm not sure we should implement this yet (although I like it).
I think we should because without this patch for some cases it is showing the string "Null" and it is ugly and misleading.
{{{
final boolean isIdentityKnown = (siteIdentity.getSecurityMode() == SecurityMode.IDENTIFIED ||
Is this needed? Can the SecurityMode be Verified or Identified without a cert? (I don't see a code path that allows this, but it's possible I missed it)
antonela: I felt the onion icon (not the one for extended validation nor the one showing insecure content) was too big. Compared to the desktop, where the icon stays the same size-wise compared to the lock icon, the onion icon seems to get bigger on mobile. Could we fix that or do you want to leave it as-is?
Oh, and, yes, having the things scheduled for #27657 (moved) already done here for mobile is pretty cool!
Trac: Cc: sysrqb, gk to sysrqb, gk, antonela Keywords: TorBrowserTeam201811R deleted, TorBrowserTeam201811 added Status: needs_review to needs_revision
antonela: I felt the onion icon (not the one for extended validation nor the one showing insecure content) was too big. Compared to the desktop, where the icon stays the same size-wise compared to the lock icon, the onion icon seems to get bigger on mobile. Could we fix that or do you want to leave it as-is?
I just tested the .apk and yes is big. The size should be the same size we have at the lock icon (24px). If we can fix it, would be awesome.
antonela: I felt the onion icon (not the one for extended validation nor the one showing insecure content) was too big. Compared to the desktop, where the icon stays the same size-wise compared to the lock icon, the onion icon seems to get bigger on mobile. Could we fix that or do you want to leave it as-is?
I just tested the .apk and yes is big. The size should be the same size we have at the lock icon (24px). If we can fix it, would be awesome.
Igt0 let me know if you need any asset.
I see the SVG used in #23247 (moved) is 16x16 (by default?), but the PNG used here is showing as 36x36.
The original assets have a white space around the icon, this is why it looks smaller.
Already provided assets with that white space to igt0 for implementation.
Looks good now, thank! Applied to tor-browser-60.3.0esr-8.5-1 (commit e5659b39d8bc51faecac5daa7f2cb9b63d4dccf8).
FWIW: I found a fun bug while testing (thinking first it is related to this patch) where the security state is vanishing while a download is happening if one clicks on the lock icon. But that's actually a Fennec issue which is tracked in https://bugzilla.mozilla.org/show_bug.cgi?id=1511003.
Trac: Resolution: N/Ato fixed Status: needs_review to closed