mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-24 01:32:16 -05:00
Safeslinger: more simplification
This commit is contained in:
parent
7b51718c92
commit
8cf4e25320
@ -267,7 +267,8 @@ public class ViewKeyShareFragment extends LoaderFragment implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static byte[] getSlingedKeys(Intent data) {
|
private static byte[] getSlingedKeys(Intent data) {
|
||||||
ArrayList<byte[]> theirSecrets = new ArrayList<byte[]>();
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
|
|
||||||
Bundle extras = data.getExtras();
|
Bundle extras = data.getExtras();
|
||||||
if (extras != null) {
|
if (extras != null) {
|
||||||
byte[] d;
|
byte[] d;
|
||||||
@ -275,21 +276,16 @@ public class ViewKeyShareFragment extends LoaderFragment implements
|
|||||||
do {
|
do {
|
||||||
d = extras.getByteArray(ExchangeConfig.extra.MEMBER_DATA + i);
|
d = extras.getByteArray(ExchangeConfig.extra.MEMBER_DATA + i);
|
||||||
if (d != null) {
|
if (d != null) {
|
||||||
theirSecrets.add(d);
|
try {
|
||||||
|
out.write(d);
|
||||||
|
} catch (IOException e) {
|
||||||
|
Log.e(Constants.TAG, "IOException", e);
|
||||||
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
} while (d != null);
|
} while (d != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// concatenate keys
|
|
||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
|
||||||
for (byte[] t : theirSecrets) {
|
|
||||||
try {
|
|
||||||
out.write(t);
|
|
||||||
} catch (IOException e) {
|
|
||||||
Log.e(Constants.TAG, "IOException", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return out.toByteArray();
|
return out.toByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user