From e7e9bed758028e1555c9cbbcaaa29fe5504db280 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 6 Jun 2016 14:58:11 +0300 Subject: update xmpp library --- deps/com.juick.xmpp | 2 +- src/main/java/com/juick/CrosspostComponent.java | 4 ++-- src/main/java/com/juick/xmpp/s2s/ConnectionRouter.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/deps/com.juick.xmpp b/deps/com.juick.xmpp index 8ea3766e..34376f06 160000 --- a/deps/com.juick.xmpp +++ b/deps/com.juick.xmpp @@ -1 +1 @@ -Subproject commit 8ea3766e846f6477e7e2bbdc9dd7ebed0113dc7c +Subproject commit 34376f06b21627cb3b62c649cf723813d3f45182 diff --git a/src/main/java/com/juick/CrosspostComponent.java b/src/main/java/com/juick/CrosspostComponent.java index c277ee68..d5f13ab2 100644 --- a/src/main/java/com/juick/CrosspostComponent.java +++ b/src/main/java/com/juick/CrosspostComponent.java @@ -23,7 +23,7 @@ import com.juick.xmpp.Message; import com.juick.xmpp.Stream; import com.juick.xmpp.StreamComponent; import com.juick.xmpp.extensions.JuickMessage; -import com.juick.xmpp.utils.Base64; +import org.apache.commons.codec.binary.Base64; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; @@ -307,7 +307,7 @@ public class CrosspostComponent implements ServletContextListener, Stream.Strea Mac mac = Mac.getInstance("HmacSHA1"); mac.init(signingKey); byte[] rawHmac = mac.doFinal(base.getBytes()); - return Base64.encode(rawHmac); + return Base64.encodeBase64String(rawHmac); } catch (Exception e) { logger.log(Level.SEVERE, "twitterSignature: " + e.getMessage(), e); diff --git a/src/main/java/com/juick/xmpp/s2s/ConnectionRouter.java b/src/main/java/com/juick/xmpp/s2s/ConnectionRouter.java index 2a1fed5d..61ae89e0 100644 --- a/src/main/java/com/juick/xmpp/s2s/ConnectionRouter.java +++ b/src/main/java/com/juick/xmpp/s2s/ConnectionRouter.java @@ -7,8 +7,8 @@ import com.juick.xmpp.Message; import com.juick.xmpp.extensions.JuickMessage; import com.juick.xmpp.extensions.Nickname; import com.juick.xmpp.extensions.XOOB; -import com.juick.xmpp.utils.SHA1; import com.juick.xmpp.utils.XmlUtils; +import org.apache.commons.codec.digest.DigestUtils; import org.xmlpull.v1.XmlPullParser; import java.io.IOException; @@ -50,7 +50,7 @@ public class ConnectionRouter extends Connection implements Runnable { throw new Exception("FAIL ON FIRST PACKET"); } - msg = "" + SHA1.encode(streamID + "secret") + ""; + msg = "" + DigestUtils.sha1Hex(streamID + "secret") + ""; writer.write(msg); writer.flush(); -- cgit v1.2.3