Skip to content

Commit

Permalink
Merge pull request #227 from oleg-nenashev/facelift/JNLP3_deprecate
Browse files Browse the repository at this point in the history
Explicitly deprecate and Restrict JNLP3 utility classes.
  • Loading branch information
oleg-nenashev authored Nov 16, 2017
2 parents 7efdd3f + ce173d9 commit b83957e
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
*/
package org.jenkinsci.remoting.engine;

import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;

import java.io.IOException;
import java.security.GeneralSecurityException;
import java.util.Random;
Expand All @@ -32,11 +35,16 @@
import javax.crypto.spec.SecretKeySpec;

/**
* Provides ciphers required by the JNLP3 protocol.
*
* {@link javax.crypto.Cipher}s that will be used to construct an encrypted
* {@link hudson.remoting.Channel} after a successful handshake.
*
* @deprecated JNLP3 protocol is deprecated
* @author Akshay Dayal
*/
@Deprecated
@Restricted(NoExternalUse.class)
class ChannelCiphers {

private final byte[] aesKey;
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/org/jenkinsci/remoting/engine/EngineUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
*/
package org.jenkinsci.remoting.engine;

import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;

import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.IOException;
Expand All @@ -34,12 +37,16 @@
import java.util.logging.Logger;

/**
* Engine utility methods.
* Engine utility methods for JNLP3.
*
* Internal class. DO NOT USE FROM OUTSIDE.
*
* @deprecated JNLP3 protocol is deprecated
* @author Akshay Dayal
*/
@Restricted(NoExternalUse.class)
@Deprecated
//TODO: @RestrictedSince
public class EngineUtil {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,18 @@
import java.security.GeneralSecurityException;
import java.security.spec.KeySpec;
import org.jenkinsci.remoting.util.Charsets;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;

/**
* {@link Cipher}s that will be used to during the handshake
* process for JNLP3 protocol.
*
* @deprecated JNLP3 protocol is deprecated
* @author Akshay Dayal
*/
@Deprecated
@Restricted(NoExternalUse.class)
class HandshakeCiphers {

private final SecretKey secretKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
/**
* Represents the connection state of a {@link JnlpProtocol3Handler} connection.
*
* @deprecated JNLP3 protocol is deprecated
* @since 3.0
*/
@Deprecated
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/org/jenkinsci/remoting/engine/Jnlp3Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,18 @@
import java.util.Arrays;
import java.util.Random;
import org.jenkinsci.remoting.util.Charsets;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;

/**
* Utility methods for JNLP3.
*
* @deprecated JNLP3 Protocol is deprecated.
* @author Akshay Dayal
*/
class Jnlp3Util {
@Restricted(NoExternalUse.class)
@Deprecated
/*package*/ class Jnlp3Util {

/**
* Generate a random 128bit key.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ public static boolean[] useNioHub() {
@DataPoints
public static Factory[] protocols() {
return new Factory[]{
//TODO: Disable JNLP-1 tests by default?
new Factory() {
@Override
public JnlpProtocolHandler<? extends JnlpConnectionState> create(JnlpClientDatabase db,
Expand Down Expand Up @@ -731,6 +732,7 @@ public String toString() {
return "JNLP2-connect";
}
},
//TODO: Disable JNLP3 tests by default?
new Factory() {
@Override
public JnlpProtocolHandler<? extends JnlpConnectionState> create(JnlpClientDatabase db,
Expand Down

0 comments on commit b83957e

Please sign in to comment.