@@ -7,7 +7,7 @@ endif() | |||
find_package(Java) | |||
set(DEFAULT_JAVACFLAGS "-source 1.5 -target 1.5 -Xlint:all,-serial,-cast,-unchecked,-fallthrough,-dep-ann,-deprecation,-rawtypes") | |||
set(DEFAULT_JAVACFLAGS "-source 1.6 -target 1.6 -Xlint:all,-serial,-cast,-unchecked,-fallthrough,-dep-ann,-deprecation,-rawtypes") | |||
set(JAVACFLAGS ${DEFAULT_JAVACFLAGS} CACHE STRING | |||
"Java compiler flags (Default: ${DEFAULT_JAVACFLAGS})") | |||
message(STATUS "Java compiler flags = ${JAVACFLAGS}") |
@@ -103,7 +103,7 @@ public class HostKey{ | |||
public String getKey(){ | |||
return Util.byte2str(Util.toBase64(key, 0, key.length)); | |||
} | |||
public String getFingerPrint(JSch jsch){ | |||
@SuppressWarnings({"static"}) public String getFingerPrint(JSch jsch){ | |||
HASH hash=null; | |||
try{ | |||
Class c=Class.forName(jsch.getConfig("md5")); |
@@ -383,7 +383,7 @@ public abstract class KeyPair{ | |||
return j; | |||
} | |||
private Random genRandom(){ | |||
@SuppressWarnings({"static"}) private Random genRandom(){ | |||
if(random==null){ | |||
try{ | |||
Class c=Class.forName(jsch.getConfig("random")); | |||
@@ -394,7 +394,7 @@ public abstract class KeyPair{ | |||
return random; | |||
} | |||
private HASH genHash(){ | |||
@SuppressWarnings({"static"}) private HASH genHash(){ | |||
try{ | |||
Class c=Class.forName(jsch.getConfig("md5")); | |||
hash=(HASH)(c.newInstance()); | |||
@@ -404,7 +404,7 @@ public abstract class KeyPair{ | |||
} | |||
return hash; | |||
} | |||
private Cipher genCipher(){ | |||
@SuppressWarnings({"static"}) private Cipher genCipher(){ | |||
try{ | |||
Class c; | |||
c=Class.forName(jsch.getConfig("3des-cbc")); | |||
@@ -421,7 +421,7 @@ public abstract class KeyPair{ | |||
h(n) <- hash(h(n-1), passphrase, iv); | |||
key <- (h(0),...,h(n))[0,..,key.length]; | |||
*/ | |||
synchronized byte[] genKey(byte[] passphrase, byte[] iv){ | |||
@SuppressWarnings({"static"}) synchronized byte[] genKey(byte[] passphrase, byte[] iv){ | |||
if(cipher==null) cipher=genCipher(); | |||
if(hash==null) hash=genHash(); | |||
@@ -565,7 +565,7 @@ public abstract class KeyPair{ | |||
} | |||
} | |||
public static KeyPair load(JSch jsch, byte[] prvkey, byte[] pubkey) throws JSchException{ | |||
@SuppressWarnings({"static"}) public static KeyPair load(JSch jsch, byte[] prvkey, byte[] pubkey) throws JSchException{ | |||
byte[] iv=new byte[8]; // 8 | |||
boolean encrypted=true; | |||
@@ -985,7 +985,7 @@ public abstract class KeyPair{ | |||
"Private-MAC: " | |||
}; | |||
static KeyPair loadPPK(JSch jsch, byte[] buf) throws JSchException { | |||
@SuppressWarnings({"static"}) static KeyPair loadPPK(JSch jsch, byte[] buf) throws JSchException { | |||
byte[] pubkey = null; | |||
byte[] prvkey = null; | |||
int lines = 0; |
@@ -59,7 +59,7 @@ public class KeyPairDSA extends KeyPair{ | |||
key_size = (new java.math.BigInteger(P_array)).bitLength(); | |||
} | |||
void generate(int key_size) throws JSchException{ | |||
@SuppressWarnings({"static"}) void generate(int key_size) throws JSchException{ | |||
this.key_size=key_size; | |||
try{ | |||
Class c=Class.forName(jsch.getConfig("keypairgen.dsa")); | |||
@@ -247,7 +247,7 @@ public class KeyPairDSA extends KeyPair{ | |||
return key_size; | |||
} | |||
public byte[] getSignature(byte[] data){ | |||
@SuppressWarnings({"static"}) public byte[] getSignature(byte[] data){ | |||
try{ | |||
Class c=Class.forName((String)jsch.getConfig("signature.dss")); | |||
SignatureDSA dsa=(SignatureDSA)(c.newInstance()); | |||
@@ -267,7 +267,7 @@ public class KeyPairDSA extends KeyPair{ | |||
return null; | |||
} | |||
public Signature getVerifier(){ | |||
@SuppressWarnings({"static"}) public Signature getVerifier(){ | |||
try{ | |||
Class c=Class.forName((String)jsch.getConfig("signature.dss")); | |||
SignatureDSA dsa=(SignatureDSA)(c.newInstance()); |
@@ -71,7 +71,7 @@ public class KeyPairECDSA extends KeyPair{ | |||
(prv_array.length>=48 ? 384 : 256); | |||
} | |||
void generate(int key_size) throws JSchException{ | |||
@SuppressWarnings({"static"}) void generate(int key_size) throws JSchException{ | |||
this.key_size=key_size; | |||
try{ | |||
Class c=Class.forName(jsch.getConfig("keypairgen.ecdsa")); | |||
@@ -282,7 +282,7 @@ public class KeyPairECDSA extends KeyPair{ | |||
return key_size; | |||
} | |||
public byte[] getSignature(byte[] data){ | |||
@SuppressWarnings({"static"}) public byte[] getSignature(byte[] data){ | |||
try{ | |||
Class c=Class.forName((String)jsch.getConfig("signature.ecdsa")); | |||
SignatureECDSA ecdsa=(SignatureECDSA)(c.newInstance()); | |||
@@ -303,7 +303,7 @@ public class KeyPairECDSA extends KeyPair{ | |||
return null; | |||
} | |||
public Signature getVerifier(){ | |||
@SuppressWarnings({"static"}) public Signature getVerifier(){ | |||
try{ | |||
Class c=Class.forName((String)jsch.getConfig("signature.ecdsa")); | |||
final SignatureECDSA ecdsa=(SignatureECDSA)(c.newInstance()); |
@@ -218,7 +218,7 @@ public class KeyPairPKCS8 extends KeyPair { | |||
return kpair.forSSHAgent(); | |||
} | |||
public boolean decrypt(byte[] _passphrase){ | |||
@SuppressWarnings({"static"}) public boolean decrypt(byte[] _passphrase){ | |||
if(!isEncrypted()){ | |||
return true; | |||
} | |||
@@ -330,7 +330,7 @@ or | |||
return false; | |||
} | |||
Cipher getCipher(byte[] id){ | |||
@SuppressWarnings({"static"}) Cipher getCipher(byte[] id){ | |||
Cipher cipher=null; | |||
String name = null; | |||
try{ |
@@ -61,7 +61,7 @@ public class KeyPairRSA extends KeyPair{ | |||
} | |||
} | |||
void generate(int key_size) throws JSchException{ | |||
@SuppressWarnings({"static"}) void generate(int key_size) throws JSchException{ | |||
this.key_size=key_size; | |||
try{ | |||
Class c=Class.forName(jsch.getConfig("keypairgen.rsa")); | |||
@@ -316,7 +316,7 @@ public class KeyPairRSA extends KeyPair{ | |||
return key_size; | |||
} | |||
public byte[] getSignature(byte[] data){ | |||
@SuppressWarnings({"static"}) public byte[] getSignature(byte[] data){ | |||
try{ | |||
Class c=Class.forName((String)jsch.getConfig("signature.rsa")); | |||
SignatureRSA rsa=(SignatureRSA)(c.newInstance()); | |||
@@ -335,7 +335,7 @@ public class KeyPairRSA extends KeyPair{ | |||
return null; | |||
} | |||
public Signature getVerifier(){ | |||
@SuppressWarnings({"static"}) public Signature getVerifier(){ | |||
try{ | |||
Class c=Class.forName((String)jsch.getConfig("signature.rsa")); | |||
SignatureRSA rsa=(SignatureRSA)(c.newInstance()); |
@@ -482,7 +482,7 @@ loop: | |||
return hosts; | |||
} | |||
private synchronized MAC getHMACSHA1(){ | |||
@SuppressWarnings({"static"}) private synchronized MAC getHMACSHA1(){ | |||
if(hmacsha1==null){ | |||
try{ | |||
Class c=Class.forName(jsch.getConfig("hmac-sha1")); |
@@ -2308,7 +2308,7 @@ break; | |||
} | |||
} | |||
public String getConfig(String key){ | |||
@SuppressWarnings({"static"}) public String getConfig(String key){ | |||
Object foo=null; | |||
if(config!=null){ | |||
foo=config.get(key); | |||
@@ -2534,7 +2534,7 @@ break; | |||
catch(Exception e){ return false; } | |||
} | |||
private String[] checkSignatures(String sigs){ | |||
@SuppressWarnings({"static"}) private String[] checkSignatures(String sigs){ | |||
if(sigs==null || sigs.length()==0) | |||
return null; | |||
@@ -25,12 +25,6 @@ public class Exception extends RuntimeException { | |||
} | |||
} | |||
class TimedOut extends Exception { | |||
public TimedOut() { | |||
super("Timed out"); | |||
} | |||
} | |||
class FrameException extends Exception { | |||
public FrameException() { | |||
super("Frame Exception"); |
@@ -0,0 +1,26 @@ | |||
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. | |||
* Copyright (C) 2012 Brian P. Hinz | |||
* | |||
* This is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | |||
* | |||
* This software is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU General Public License | |||
* along with this software; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | |||
* USA. | |||
*/ | |||
package com.tigervnc.rdr; | |||
class TimedOut extends Exception { | |||
public TimedOut() { | |||
super("Timed out"); | |||
} | |||
} |