Do not update the keys in constructor

This commit is contained in:
Paul Schaub 2018-07-04 16:03:04 +02:00
parent 693ced1fe4
commit 3262582de9
2 changed files with 4 additions and 7 deletions

View File

@ -113,6 +113,9 @@ public class BasicOpenPgpInstantMessagingIntegrationTest extends AbstractOpenPgp
OpenPgpContact bobForAlice = aliceOpenPgp.getOpenPgpContact(bob.asEntityBareJidIfPossible()); OpenPgpContact bobForAlice = aliceOpenPgp.getOpenPgpContact(bob.asEntityBareJidIfPossible());
OpenPgpContact aliceForBob = bobOpenPgp.getOpenPgpContact(alice.asEntityBareJidIfPossible()); OpenPgpContact aliceForBob = bobOpenPgp.getOpenPgpContact(alice.asEntityBareJidIfPossible());
bobForAlice.updateKeys();
aliceForBob.updateKeys();
assertTrue(bobForAlice.getActiveKeys().contains(bobFingerprint)); assertTrue(bobForAlice.getActiveKeys().contains(bobFingerprint));
assertTrue(aliceForBob.getActiveKeys().contains(aliceFingerprint)); assertTrue(aliceForBob.getActiveKeys().contains(aliceFingerprint));

View File

@ -75,12 +75,6 @@ public class OpenPgpContact {
this.jid = jid; this.jid = jid;
this.cryptoProvider = cryptoProvider; this.cryptoProvider = cryptoProvider;
this.connection = connection; this.connection = connection;
try {
this.updateKeys();
} catch (SmackOpenPgpException | InterruptedException | XMPPException.XMPPErrorException | SmackException e) {
LOGGER.log(Level.WARNING, "Initial key update for contact " + getJid() + " failed.", e);
}
} }
/** /**
@ -356,7 +350,7 @@ public class OpenPgpContact {
/** /**
* Process an incoming {@link OpenPgpElement} and return the decrypted and verified {@link OpenPgpContentElement}. * Process an incoming {@link OpenPgpElement} and return the decrypted and verified {@link OpenPgpContentElement}.
* *
* @param element possibly encrypted, possibly signed {@link OpenPgpElement}. * @param element possibly encrypted, possibly signed {@link OpenPgpElement}.
* @return decrypted {@link OpenPgpContentElement} * @return decrypted {@link OpenPgpContentElement}
* @throws XmlPullParserException if the decrypted message does not represent valid XML. * @throws XmlPullParserException if the decrypted message does not represent valid XML.