Skip to content

Commit

Permalink
Merge pull request #84 from mc1arke/JENKINS-43610-remove-trilead-refe…
Browse files Browse the repository at this point in the history
…rences

[JENKINS-43610] Remove references to Trilead classes
  • Loading branch information
stephenc committed Apr 17, 2017
2 parents b2e31fb + e4dedd9 commit a21b0d3
Showing 1 changed file with 5 additions and 6 deletions.
Expand Up @@ -28,14 +28,14 @@
import com.cloudbees.plugins.credentials.CredentialsSnapshotTaker;
import com.cloudbees.plugins.credentials.SecretBytes;
import com.cloudbees.plugins.credentials.common.StandardCertificateCredentials;
import com.trilead.ssh2.crypto.Base64;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
import hudson.Extension;
import hudson.Util;
import hudson.model.AbstractDescribableImpl;
import hudson.model.Descriptor;
import hudson.remoting.Base64;
import hudson.remoting.Channel;
import hudson.util.FormValidation;
import hudson.util.HttpResponses;
Expand Down Expand Up @@ -602,10 +602,9 @@ public static class DescriptorImpl extends KeyStoreSourceDescriptor {
@NonNull
public static byte[] toByteArray(@Nullable Secret secret) {
if (secret != null) {
try {
return Base64.decode(secret.getPlainText().toCharArray());
} catch (IOException e) {
// ignore
byte[] decoded = Base64.decode(secret.getPlainText());
if (null != decoded) {
return decoded;
}
}
return new byte[0];
Expand All @@ -624,7 +623,7 @@ public static byte[] toByteArray(@Nullable Secret secret) {
public static Secret toSecret(@Nullable byte[] contents) {
return contents == null || contents.length == 0
? null
: Secret.fromString(new String(Base64.encode(contents)));
: Secret.fromString(Base64.encode(contents));
}

/**
Expand Down

0 comments on commit a21b0d3

Please sign in to comment.