diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-09-04 14:59:39 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-09-04 14:59:39 +0200 |
commit | 8cf4e25320dae710360e5a8d6c8ee92143db3fdd (patch) | |
tree | 20680f4be87fa5ac298f8ab4313efd9986f268a0 | |
parent | 7b51718c92d9bb7c8fca5dfc1415ac273bc93bb3 (diff) | |
download | open-keychain-8cf4e25320dae710360e5a8d6c8ee92143db3fdd.tar.gz open-keychain-8cf4e25320dae710360e5a8d6c8ee92143db3fdd.tar.bz2 open-keychain-8cf4e25320dae710360e5a8d6c8ee92143db3fdd.zip |
Safeslinger: more simplification
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyShareFragment.java | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyShareFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyShareFragment.java index 14d147a24..72242a6cc 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyShareFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyShareFragment.java @@ -267,7 +267,8 @@ public class ViewKeyShareFragment extends LoaderFragment implements } private static byte[] getSlingedKeys(Intent data) { - ArrayList<byte[]> theirSecrets = new ArrayList<byte[]>(); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + Bundle extras = data.getExtras(); if (extras != null) { byte[] d; @@ -275,21 +276,16 @@ public class ViewKeyShareFragment extends LoaderFragment implements do { d = extras.getByteArray(ExchangeConfig.extra.MEMBER_DATA + i); if (d != null) { - theirSecrets.add(d); + try { + out.write(d); + } catch (IOException e) { + Log.e(Constants.TAG, "IOException", e); + } i++; } } 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(); } |