Ver código fonte

Do not update the keys in constructor

openpgpContactRework
Paul Schaub 2 anos atrás
pai
commit
3262582de9
2 arquivos alterados com 4 adições e 7 exclusões
  1. +3
    -0
      smack-integration-test/src/main/java/org/jivesoftware/smackx/openpgp/BasicOpenPgpInstantMessagingIntegrationTest.java
  2. +1
    -7
      smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/OpenPgpContact.java

+ 3
- 0
smack-integration-test/src/main/java/org/jivesoftware/smackx/openpgp/BasicOpenPgpInstantMessagingIntegrationTest.java Ver arquivo

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

bobForAlice.updateKeys();
aliceForBob.updateKeys();

assertTrue(bobForAlice.getActiveKeys().contains(bobFingerprint));
assertTrue(aliceForBob.getActiveKeys().contains(aliceFingerprint));



+ 1
- 7
smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/OpenPgpContact.java Ver arquivo

@@ -75,12 +75,6 @@ public class OpenPgpContact {
this.jid = jid;
this.cryptoProvider = cryptoProvider;
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}.
*
*
* @param element possibly encrypted, possibly signed {@link OpenPgpElement}.
* @return decrypted {@link OpenPgpContentElement}
* @throws XmlPullParserException if the decrypted message does not represent valid XML.


Carregando…
Cancelar
Salvar