From 8850a2950c7c1158710fa3d6436ad6d41db6f425 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Sat, 4 Jul 2020 20:02:33 +0200 Subject: [PATCH] Remove unnecessary lines from OX backup restore function The manual construction of the public key ring as done in the removed lines is already performed in the BCUtil method called a line above. --- .../java/org/jivesoftware/smackx/ox/OpenPgpManager.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/OpenPgpManager.java b/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/OpenPgpManager.java index ce49dbde6..cf070bdf1 100644 --- a/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/OpenPgpManager.java +++ b/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/OpenPgpManager.java @@ -482,13 +482,6 @@ public final class OpenPgpManager extends Manager { provider.getStore().importSecretKey(getJidOrThrow(), secretKeys); provider.getStore().importPublicKey(getJidOrThrow(), BCUtil.publicKeyRingFromSecretKeyRing(secretKeys)); - ByteArrayOutputStream buffer = new ByteArrayOutputStream(2048); - for (PGPSecretKey sk : secretKeys) { - PGPPublicKey pk = sk.getPublicKey(); - if (pk != null) pk.encode(buffer); - } - PGPPublicKeyRing publicKeys = new PGPPublicKeyRing(buffer.toByteArray(), new BcKeyFingerprintCalculator()); - provider.getStore().importPublicKey(getJidOrThrow(), publicKeys); return new OpenPgpV4Fingerprint(secretKeys); }