Skip to content

Commit

Permalink
Update otr4j.
Browse files Browse the repository at this point in the history
  • Loading branch information
cobratbq committed Jun 24, 2019
1 parent 8715640 commit 55f6a04
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 9 deletions.
Binary file modified lib/installer-exclude/otr4j.jar
Binary file not shown.
8 changes: 7 additions & 1 deletion src/net/java/sip/communicator/plugin/otr/OtrContactMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,13 @@ else if (ACTION_COMMAND_CB_ENABLE.equals(actionCommand))
OtrActivator.scOtrEngine.getContactPolicy(contact.contact);
boolean state = ((JCheckBoxMenuItem) e.getSource()).isSelected();

policy.setEnableManual(state);
if (state) {
policy.setEnableManual();
} else {
policy.setAllowV2(false);
policy.setAllowV3(false);
policy.setAllowV4(false);
}
OtrActivator.scOtrEngine.setContactPolicy(contact.contact, policy);
}

Expand Down
21 changes: 16 additions & 5 deletions src/net/java/sip/communicator/plugin/otr/ScOtrEngineImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import net.java.sip.communicator.service.protocol.Contact;
import net.java.sip.communicator.service.protocol.ContactResource;
import net.java.sip.communicator.service.protocol.Message;
import net.java.sip.communicator.service.protocol.OperationFailedException;
import net.java.sip.communicator.service.protocol.OperationSetBasicInstantMessaging;
import net.java.sip.communicator.service.protocol.OperationSetBasicInstantMessagingTransport;
import net.java.sip.communicator.service.protocol.ProtocolProviderService;
Expand Down Expand Up @@ -113,6 +114,17 @@ public ClientProfile getClientProfile(final SessionID sessionID) {
this.forgingKey, this.versions, getLocalKeyPair(sessionID).getPublic());
}

@Override
public void publishClientProfilePayload(final byte[] bytes) {
// FIXME TODO
}

@Override
public byte[] restoreClientProfilePayload() {
// FIXME TODO
return new byte[0];
}

@Override
public OtrPolicy getSessionPolicy(SessionID sessionID)
{
Expand All @@ -121,7 +133,6 @@ public OtrPolicy getSessionPolicy(SessionID sessionID)

@Override
public void injectMessage(SessionID sessionID, String messageText)
throws OtrException
{
OtrContact otrContact = getOtrContact(sessionID);
Contact contact = otrContact.contact;
Expand Down Expand Up @@ -175,9 +186,9 @@ public void injectMessage(SessionID sessionID, String messageText)
{
imOpSet.sendInstantMessage(contact, resource, message);
}
catch (OperationFailedException e)
catch (final OperationFailedException e)
{
throw new OtrException(e);
throw new IllegalStateException("Failed to send injected message.", e);
}
}

Expand Down Expand Up @@ -337,11 +348,11 @@ private SmpProgressDialog acquireSMPProgressDialog(final OtrContact contact) {
}

@Override
public String getReplyForUnreadableMessage(SessionID sessionID)
public String getReplyForUnreadableMessage(final SessionID sessionID, final String s)
{
AccountID accountID =
OtrActivator.getAccountIDByUID(sessionID.getAccountID());

// FIXME Use 's' for OTRv4 error identifier such that we can offer translated error messages.
return OtrActivator.resourceService.getI18NString(
"plugin.otr.activator.unreadablemsgreply",
new String[] {accountID.getDisplayName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
*
* @author George Politis
*/
// FIXME is this class being used?
@SuppressWarnings("serial")
public class OtrConfigurationPanel extends TransparentPanel
{
Expand Down Expand Up @@ -301,8 +300,14 @@ public void actionPerformed(ActionEvent e)
{
OtrPolicy otrPolicy = OtrActivator.scOtrEngine().getGlobalPolicy();

otrPolicy.setEnableManual(((JCheckBox) e.getSource())
.isSelected());
final boolean selected = ((JCheckBox) e.getSource()).isSelected();
if (selected) {
otrPolicy.setEnableManual();
} else {
otrPolicy.setAllowV2(false);
otrPolicy.setAllowV3(false);
otrPolicy.setAllowV4(false);
}

OtrActivator.scOtrEngine().setGlobalPolicy(otrPolicy);

Expand Down

22 comments on commit 55f6a04

@Neustradamus
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cobratbq: I see a lot of branches/commits about Jitsi and otr4j, can you create PRs?
Thanks in advance.

@cobratbq
Copy link
Owner Author

@cobratbq cobratbq commented on 55f6a04 Apr 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated: 2020-04-13

@Neustradamus I am not actively working on these improvements anymore. I would be happy to merge this work, but there are a few issues:

  1. OTRv4 spec is not fully completed yet. The work in the enable-otrv4 branch is an intermediate trial at cleaning up GUI code and introducing the otr4j OTRv4 support which has a slightly different API.
  2. the OTRv4 support for otr4j contains many new files and changes specifically for OTR protocol version 4. Because the work is not completed yet, merging the changes now would introduce a significant amount .. maybe 25% or more .. of - for now useless - code into a working code base. (Although, to be fair, protocol support for version 2 and version 3 should be in working order.)
  3. Control flow for protocol versions 3 and 4 has been significantly refactored and restructured. Thorough testing is needed to ensure that I have not introduced errors in the process. (The enable-otrv4 branch was intended to start testing while OTRv4 work was still in progress.)
  4. The committed library is an arbitrary build, so the changes may not be compatible with the latest version of otr4j OTRv4 work.
  5. Latest work on OTRv4 support can be found in my gitlab repository
    Progress, status, work to be executed (FIXME, TODO) have been documented in detail in that code base, so anyone willing to pick up this work should have quite some information to work with.)
  6. The library's API has changed superficially. It is guaranteed to break any program that previously depended on otr4j, but semantically there are few changes, so adoption is still straightforward. The enable-otrv4 branch can function as an example of the changes needed.
  7. One characteristic of the many changes that have been introduced is strictness. This in itself may have introduced some behavior not originally anticipated. I believe this is important to keep in mind.
  8. The otr4j code-base is still on the original LGPL version 3 license.
  9. Some early commits are by different people, so we'd need to align on approval for the license change.
  10. The temporary Ed448 library used to start OTRv4 development is not a published library. It was always built locally and then used. The Ed448 library 'Joldilocks' should be replaced with professional code once available in libraries such as BouncyCastle.

I'm happy to give some pointers, but someone else would need to put in the effort to merge the work.

NOTE that I've based the OTRv4 support for otr4j on an existing fork at the time which already included some additional work not by me. So this may be something to keep in mind if you start merging changes back into github.com/jitsi/... repos.

@cobratbq
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Neustradamus actually, I'll see what I can do in coming days ... though I'm not sure if everything is low-hanging fruit.
@gpolitis would you guys be happy to receive an incomplete work w.r.t. OTRv4 support? There will be rough edges and certainly needs testing before merging in master. I'll gather more points of attention in the comment above this one, so that you have an idea what you'd be adopting.

@Neustradamus
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cobratbq: Thanks for your reply!
Mirror is important, a lot of companies do this...

The current stable OTR is perfect in actual OTR4J from Jitsi?

It will be nice to request at redsolution team to transfer otr4j repository in otr4j organization.
Redirection will be here etc.
And do it like new main source...

PS : Please unarchive the current otr4j/otr4j...

@cobratbq
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Neustradamus I do no longer have (shared) ownership over otr4j/otr4j. Only the original owner @eighthave has ownership now. You should check with him.

@Neustradamus
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eighthave: How we can solve this otr4j problem?

Can you add @cobratbq owner?
I can be owner?

We do not want the otr4j dead.

Thanks in advance.

@eighthave
Copy link

@eighthave eighthave commented on 55f6a04 Apr 14, 2020 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Neustradamus
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cobratbq: Have you validated the request from @eighthave: Only 7 days for validation, if not, a new is needed.
Better to have the main, I am ready to be owner too of course and unarchived too :)

@cobratbq
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the time I started migrating to github.com/otr4j/otr4j, I reached out to all known otr4j developers and nobody was interested in joining. To be fair, @eighthave has always been clear in his intentions - both when initiating the fork years ago and also when priorities shifted - so absolutely no criticism towards him. I am not sure if this initiative was received well or appreciated though, as I've noticed some complete unresponsiveness to emails etc. in the past year. Although I have not been able to discover a reason for this yet.

In case this gave the wrong impression, I removed excess owners from the project .. 2 years ago .. because of a lot of stale accounts that didn't even respond in the issue in which I discussed my intentions at the time. (The issue still exists, but Issues need to be enabled first.) Also, to be clear, I have no bad intentions towards the original otr4j repo github.com/jitsi/otr4j, and would be just as happy to merge the completed work there, if this helps to avoid confusion and concentrate efforts. I am not sure how @gpolitis and others from the jitsi-team feel about it tho.

Well, apparently more people are interested in the progress of otr4j now. That is good. I would suggest taking up ownership with a few owners as shared initiative (and @eighthave can leave the organization if he wants to).

@Neustradamus note that so far otr4j/otr4j is not an authoritative repository for any release yet. Maven packages and such have been published by Jitsi-team. The OTRv4 effort is as-of-yet incomplete.
As for the redsolution link that all otr4j repo's enjoy. That link should simply be severed. It can only be done as a service request at github.com. Ideally, otr4j/otr4j should have fork-relationship towards jitsi/otr4j and jitsi/otr4j be the original. That best illustrates the reality of the situation.

@eighthave
Copy link

@eighthave eighthave commented on 55f6a04 Apr 14, 2020 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Neustradamus
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cobratbq: The goal is to have a prefect project (Mirror GitHub and GitLab) on otr4j organization.
I think there will be no problems with Jitsi to have rights and "import" all on it and Redsolution to transfer...

@cobratbq
Copy link
Owner Author

@cobratbq cobratbq commented on 55f6a04 Apr 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good to me! I added @cobratbq again as an owner.

I am added to organization, but added as member: corrected.

@eighthave
Copy link

@eighthave eighthave commented on 55f6a04 Apr 14, 2020 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Neustradamus
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cobratbq: Can you create a ticket on:

Note: You must "import" all from otr4j repository -> jitsi repository -> remove otr4j repository -> transfer jitsi repository to otr4j -> "import" all -> redsolution repository -> remove otr4j repository -> transfer redsolution repository -> otr4j organization :)

@cobratbq
Copy link
Owner Author

@cobratbq cobratbq commented on 55f6a04 Apr 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To what extent is this discussed already? Do they have any clue about what is happening and why these requests are made?
Note: gpolitis is member of Jitsi/otr4j. Hopefully he will leave comment stating their intentions, willingness to participate. Again, I am fairly impartial to in what way we're going to unify the projects.

@cobratbq
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Neustradamus I've invited you. Please accept, as I prefer to make this a collaborative effort. It is probably good if you take on this initiative of merging/streamlining the forks yourself, as you also initiated it.

@Neustradamus
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cobratbq: I have not 2FA...

@cobratbq
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cobratbq: I have not 2FA...

Would you be okay with setting up 2FA using Google Authenticator on a smartphone? That would be your second factor.
Otherwise I can disable the requirement and trust the wisdom of members :-)

@Neustradamus
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can do it temporary...

@eighthave
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish you all lots of successes! I support this effort! I've removed myself since I don't have the bandwidth to track it, and I haven't worked on messaging for years. Feel free to ping me with questions though.

@Neustradamus
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cobratbq: Done, thanks!
@eighthave: I would not the death of the project...

@cobratbq
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.