Skip to content

Commit

Permalink
Merge pull request #116 from timja/remove-trilead
Browse files Browse the repository at this point in the history
Remove trilead reference
  • Loading branch information
dwnusbaum authored Jan 30, 2020
2 parents b5157af + d43d165 commit 2615fa5
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import com.jcraft.jzlib.GZIPInputStream;
import com.jcraft.jzlib.GZIPOutputStream;
import com.trilead.ssh2.crypto.Base64;
import hudson.console.AnnotatedLargeText;
import hudson.console.ConsoleAnnotationOutputStream;
import hudson.console.ConsoleAnnotator;
Expand All @@ -37,6 +36,9 @@
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import static java.lang.Math.abs;

import java.nio.charset.StandardCharsets;
import java.util.Base64;
import java.util.concurrent.TimeUnit;
import javax.crypto.Cipher;
import javax.crypto.CipherInputStream;
Expand Down Expand Up @@ -69,7 +71,7 @@ public static <T> ConsoleAnnotator<T> createAnnotator(T context) throws IOExcept
@SuppressWarnings("deprecation") // TODO still used in the AnnotatedLargeText version
Cipher sym = PASSING_ANNOTATOR.decrypt();
try (ObjectInputStream ois = new ObjectInputStreamEx(new GZIPInputStream(
new CipherInputStream(new ByteArrayInputStream(Base64.decode(base64.toCharArray())), sym)),
new CipherInputStream(new ByteArrayInputStream(Base64.getDecoder().decode(base64.getBytes(StandardCharsets.UTF_8))), sym)),
Jenkins.get().pluginManager.uberClassLoader,
ClassFilter.DEFAULT)) {
long timestamp = ois.readLong();
Expand Down Expand Up @@ -98,7 +100,7 @@ public static void setAnnotator(ConsoleAnnotator<?> annotator) throws IOExceptio
}
StaplerResponse rsp = Stapler.getCurrentResponse();
if (rsp != null) {
rsp.setHeader("X-ConsoleAnnotator", new String(Base64.encode(baos.toByteArray())));
rsp.setHeader("X-ConsoleAnnotator", new String(Base64.getEncoder().encode(baos.toByteArray()), StandardCharsets.US_ASCII));
}
}

Expand Down

0 comments on commit 2615fa5

Please sign in to comment.