From b7dd26af05f222edd27042416eda609e9b45adbf Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Wed, 29 Jun 2022 15:46:17 +0200 Subject: [PATCH] Bump pgpainless-core to 1.3.1 --- smack-openpgp/build.gradle | 2 +- .../org/jivesoftware/smackx/ox/element/OpenPgpElement.java | 4 +++- .../smackx/ox/store/abstr/AbstractOpenPgpKeyStore.java | 5 ++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/smack-openpgp/build.gradle b/smack-openpgp/build.gradle index fb27fd70e..937636273 100644 --- a/smack-openpgp/build.gradle +++ b/smack-openpgp/build.gradle @@ -8,7 +8,7 @@ dependencies { api project(':smack-extensions') api project(':smack-experimental') - api 'org.pgpainless:pgpainless-core:1.1.1' + api 'org.pgpainless:pgpainless-core:1.3.1' testImplementation "org.bouncycastle:bcprov-jdk15on:${bouncyCastleVersion}" diff --git a/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/element/OpenPgpElement.java b/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/element/OpenPgpElement.java index b94e537da..8954064f9 100644 --- a/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/element/OpenPgpElement.java +++ b/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/element/OpenPgpElement.java @@ -26,6 +26,7 @@ import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.util.StringUtils; import org.jivesoftware.smack.util.XmlStringBuilder; +import org.jivesoftware.smack.util.stringencoder.Base64; import org.jivesoftware.smackx.ox.util.Util; /** @@ -51,7 +52,8 @@ public class OpenPgpElement implements ExtensionElement { } public InputStream toInputStream() { - return new ByteArrayInputStream(base64EncodedOpenPgpMessage.getBytes(Util.UTF8)); + return new ByteArrayInputStream( + Base64.decode(base64EncodedOpenPgpMessage.getBytes(Util.UTF8))); } /** diff --git a/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/store/abstr/AbstractOpenPgpKeyStore.java b/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/store/abstr/AbstractOpenPgpKeyStore.java index 0c261ccb6..f2027fb27 100644 --- a/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/store/abstr/AbstractOpenPgpKeyStore.java +++ b/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/store/abstr/AbstractOpenPgpKeyStore.java @@ -19,7 +19,6 @@ package org.jivesoftware.smackx.ox.store.abstr; import java.io.IOException; import java.security.InvalidAlgorithmParameterException; import java.security.NoSuchAlgorithmException; -import java.security.NoSuchProviderException; import java.util.Collections; import java.util.Date; import java.util.HashMap; @@ -247,7 +246,7 @@ public abstract class AbstractOpenPgpKeyStore implements OpenPgpKeyStore { @Override public PGPSecretKeyRing generateKeyRing(BareJid owner) - throws PGPException, NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmParameterException { - return PGPainless.generateKeyRing().modernKeyRing("xmpp:" + owner.toString(), null); + throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException { + return PGPainless.generateKeyRing().modernKeyRing("xmpp:" + owner.toString()); } }