Skip to content

Commit

Permalink
Enable the Zk group library.
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-signal authored and greyson-signal committed May 29, 2020
1 parent 098b298 commit 36df3f2
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 22 deletions.
5 changes: 2 additions & 3 deletions app/build.gradle
Expand Up @@ -126,7 +126,7 @@ android {
buildConfigField "String", "KBS_ENCLAVE_NAME", "\"fe7c1bfae98f9b073d220366ea31163ee82f6d04bead774f71ca8e5c40847bfe\""
buildConfigField "String", "KBS_MRENCLAVE", "\"a3baab19ef6ce6f34ab9ebb25ba722725ae44a8872dc0ff08ad6d83a9489de87\""
buildConfigField "String", "UNIDENTIFIED_SENDER_TRUST_ROOT", "\"BXu6QIKVz5MA8gstzfOgRQGqyLqOwNKHL6INkv3IHWMF\""
buildConfigField "String", "ZKGROUP_SERVER_PUBLIC_PARAMS", "\"\""
buildConfigField "String", "ZKGROUP_SERVER_PUBLIC_PARAMS", "\"AMhf5ywVwITZMsff/eCyudZx9JDmkkkbV6PInzG4p8x3VqVJSFiMvnvlEKWuRob/1eaIetR31IYeAbm0NdOuHH8Qi+Rexi1wLlpzIo1gstHWBfZzy1+qHRV5A4TqPp15YzBPm0WSggW6PbSn+F4lf57VCnHF7p8SvzAA2ZZJPYJURt8X7bbg+H3i+PEjH9DXItNEqs2sNcug37xZQDLm7X0=\""
buildConfigField "String[]", "LANGUAGES", "new String[]{\"" + autoResConfig().collect { s -> s.replace('-r', '_') }.join('", "') + '"}'
buildConfigField "int", "CANONICAL_VERSION_CODE", "$canonicalVersionCode"

Expand Down Expand Up @@ -161,7 +161,6 @@ android {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/proguard/androidx-annotations.pro'
exclude 'lib/*/libzkgroup.so' // TODO: GV2 Remove line to include .so when used
}

buildTypes {
Expand Down Expand Up @@ -201,7 +200,7 @@ android {
buildConfigField "String", "CDS_MRENCLAVE", "\"ba4ebb438bc07713819ee6c98d94037747006d7df63fc9e44d2d6f1fec962a79\""
buildConfigField "String", "KBS_ENCLAVE_NAME", "\"823a3b2c037ff0cbe305cc48928cfcc97c9ed4a8ca6d49af6f7d6981fb60a4e9\""
buildConfigField "String", "UNIDENTIFIED_SENDER_TRUST_ROOT", "\"BbqY1DzohE4NUZoVF+L18oUPrK3kILllLEJh2UnPSsEx\""
buildConfigField "String", "ZKGROUP_SERVER_PUBLIC_PARAMS", "\"\""
buildConfigField "String", "ZKGROUP_SERVER_PUBLIC_PARAMS", "\"ABSY21VckQcbSXVNCGRYJcfWHiAMZmpTtTELcDmxgdFbtp/bWsSxZdMKzfCp8rvIs8ocCU3B37fT3r4Mi5qAemeGeR2X+/YmOGR5ofui7tD5mDQfstAI9i+4WpMtIe8KC3wU5w3Inq3uNWVmoGtpKndsNfwJrCg0Hd9zmObhypUnSkfYn2ooMOOnBpfdanRtrvetZUayDMSC5iSRcXKpdls=\""
}
flipper {
initWith debug
Expand Down
Expand Up @@ -4,7 +4,7 @@

public final class BadGroupIdException extends Exception {

public BadGroupIdException() {
BadGroupIdException() {
super();
}

Expand Down
Expand Up @@ -425,11 +425,7 @@ private void handleMessage(@Nullable SignalServiceContent content, @NonNull Opti
Log.w(TAG, e);
handleCorruptMessage(e.getSender(), e.getSenderDevice(), timestamp, smsMessageId);
} catch (BadGroupIdException e) {
if (!FeatureFlags.ZK_GROUPS) {
Log.w(TAG, "Ignoring message with GV2 - no ZK_GROUP library", e);
} else {
Log.w(TAG, "Ignoring message with bad group id", e);
}
Log.w(TAG, "Ignoring message with bad group id", e);
}
}

Expand Down
Expand Up @@ -262,7 +262,7 @@ public static boolean reactWithAnyEmoji() {

/** Groups v2 send and receive. */
public static boolean groupsV2() {
return org.whispersystems.signalservice.FeatureFlags.ZK_GROUPS && getBoolean(GROUPS_V2, false);
return getBoolean(GROUPS_V2, false);
}

/** Groups v2 send and receive. */
Expand Down Expand Up @@ -507,7 +507,4 @@ enum Change {

/** Read and write versioned profile information. */
public static final boolean VERSIONED_PROFILES = org.whispersystems.signalservice.FeatureFlags.VERSIONED_PROFILES;

/** Enabled ZKGroups library. */
public static final boolean ZK_GROUPS = org.whispersystems.signalservice.FeatureFlags.ZK_GROUPS;
}
Expand Up @@ -41,9 +41,6 @@ private GroupUtil() {
if (groupContext.getGroupV1().isPresent()) {
return GroupId.v1(groupContext.getGroupV1().get().getGroupId());
} else if (groupContext.getGroupV2().isPresent()) {
if (!FeatureFlags.ZK_GROUPS) {
throw new BadGroupIdException();
}
return GroupId.v2(groupContext.getGroupV2().get().getMasterKey());
} else {
throw new AssertionError();
Expand Down
Expand Up @@ -5,9 +5,7 @@
* After a feature has been launched, the flag should be removed.
*/
public final class FeatureFlags {
/** Zero Knowledge Group functions */
public static final boolean ZK_GROUPS = false;

/** Read and write versioned profile information. */
public static final boolean VERSIONED_PROFILES = ZK_GROUPS && false;
public static final boolean VERSIONED_PROFILES = false;
}
Expand Up @@ -3,7 +3,6 @@
import org.signal.zkgroup.ServerPublicParams;
import org.signal.zkgroup.auth.ClientZkAuthOperations;
import org.signal.zkgroup.profiles.ClientZkProfileOperations;
import org.whispersystems.signalservice.FeatureFlags;
import org.whispersystems.signalservice.internal.configuration.SignalServiceConfiguration;

/**
Expand All @@ -24,8 +23,7 @@ public ClientZkOperations(ServerPublicParams serverPublicParams) {
}

public static ClientZkOperations create(SignalServiceConfiguration configuration) {
return FeatureFlags.ZK_GROUPS ? new ClientZkOperations(new ServerPublicParams(configuration.getZkGroupServerPublicParams()))
: new ClientZkOperations(null);
return new ClientZkOperations(new ServerPublicParams(configuration.getZkGroupServerPublicParams()));
}

public ClientZkAuthOperations getAuthOperations() {
Expand Down

0 comments on commit 36df3f2

Please sign in to comment.