strip leading 0x05 off omemo fingerprints

This commit is contained in:
Daniel Gultsch 2015-12-27 18:37:31 +01:00
parent 703d95fcf8
commit 7bb67ee660

View file

@ -697,13 +697,16 @@ public abstract class XmppActivity extends Activity {
trustToggle.setVisibility(View.VISIBLE); trustToggle.setVisibility(View.VISIBLE);
trustToggle.setOnCheckedChangeListener(onCheckedChangeListener); trustToggle.setOnCheckedChangeListener(onCheckedChangeListener);
trustToggle.setOnClickListener(onClickListener); trustToggle.setOnClickListener(onClickListener);
view.setOnLongClickListener(new View.OnLongClickListener() { final View.OnLongClickListener purge = new View.OnLongClickListener() {
@Override @Override
public boolean onLongClick(View v) { public boolean onLongClick(View v) {
showPurgeKeyDialog(account, fingerprint); showPurgeKeyDialog(account, fingerprint);
return true; return true;
} }
}); };
view.setOnLongClickListener(purge);
key.setOnLongClickListener(purge);
keyType.setOnLongClickListener(purge);
boolean x509 = trust == XmppAxolotlSession.Trust.TRUSTED_X509 || trust == XmppAxolotlSession.Trust.INACTIVE_TRUSTED_X509; boolean x509 = trust == XmppAxolotlSession.Trust.TRUSTED_X509 || trust == XmppAxolotlSession.Trust.INACTIVE_TRUSTED_X509;
switch (trust) { switch (trust) {
case UNTRUSTED: case UNTRUSTED:
@ -753,7 +756,7 @@ public abstract class XmppActivity extends Activity {
keyType.setText(getString(x509 ? R.string.omemo_fingerprint_x509 : R.string.omemo_fingerprint)); keyType.setText(getString(x509 ? R.string.omemo_fingerprint_x509 : R.string.omemo_fingerprint));
} }
key.setText(CryptoHelper.prettifyFingerprint(fingerprint)); key.setText(CryptoHelper.prettifyFingerprint(fingerprint.substring(2)));
keys.addView(view); keys.addView(view);
return true; return true;
} }
@ -763,7 +766,7 @@ public abstract class XmppActivity extends Activity {
builder.setTitle(getString(R.string.purge_key)); builder.setTitle(getString(R.string.purge_key));
builder.setIconAttribute(android.R.attr.alertDialogIcon); builder.setIconAttribute(android.R.attr.alertDialogIcon);
builder.setMessage(getString(R.string.purge_key_desc_part1) builder.setMessage(getString(R.string.purge_key_desc_part1)
+ "\n\n" + CryptoHelper.prettifyFingerprint(fingerprint) + "\n\n" + CryptoHelper.prettifyFingerprint(fingerprint.substring(2))
+ "\n\n" + getString(R.string.purge_key_desc_part2)); + "\n\n" + getString(R.string.purge_key_desc_part2));
builder.setNegativeButton(getString(R.string.cancel), null); builder.setNegativeButton(getString(R.string.cancel), null);
builder.setPositiveButton(getString(R.string.accept), builder.setPositiveButton(getString(R.string.accept),