Removed autoboxing
private static void addSigHashAlg(Hashtable h, ASN1ObjectIdentifier oid, short hashAlg)
{
- h.put(oid.getId(), hashAlg);
+ h.put(oid.getId(), new Short(hashAlg));
}
private static Hashtable createSigHashAlgs()
@@ -820,7 +820,7 @@ public static void addIfSupported(Vector supportedGroups, TlsCrypto crypto, int
{
if (crypto.hasNamedGroup(namedGroup))
{
- supportedGroups.addElement(namedGroup);
+ supportedGroups.addElement(new Integer(namedGroup));
}
}
@@ -835,12 +835,12 @@ public static void addIfSupported(Vector supportedGroups, TlsCrypto crypto, int[
public static Vector getAllSignatureAlgorithms()
{
Vector v = new Vector(6);
- v.addElement(SignatureAlgorithm.anonymous);
- v.addElement(SignatureAlgorithm.rsa);
- v.addElement(SignatureAlgorithm.dsa);
- v.addElement(SignatureAlgorithm.ecdsa);
- v.addElement(SignatureAlgorithm.ed25519);
- v.addElement(SignatureAlgorithm.ed448);
+ v.addElement(new Short(SignatureAlgorithm.anonymous));
+ v.addElement(new Short(SignatureAlgorithm.rsa));
+ v.addElement(new Short(SignatureAlgorithm.dsa));
+ v.addElement(new Short(SignatureAlgorithm.ecdsa));
+ v.addElement(new Short(SignatureAlgorithm.ed25519));
+ v.addElement(new Short(SignatureAlgorithm.ed448));
return v;
}
@@ -2822,23 +2822,23 @@ public static boolean isValidCipherSuiteForSignatureAlgorithms(int cipherSuite,
case KeyExchangeAlgorithm.DH_anon:
case KeyExchangeAlgorithm.DH_anon_EXPORT:
case KeyExchangeAlgorithm.ECDH_anon:
- return sigAlgs.contains(SignatureAlgorithm.anonymous);
+ return sigAlgs.contains(new Short(SignatureAlgorithm.anonymous));
case KeyExchangeAlgorithm.DHE_RSA:
case KeyExchangeAlgorithm.DHE_RSA_EXPORT:
case KeyExchangeAlgorithm.ECDHE_RSA:
case KeyExchangeAlgorithm.SRP_RSA:
- return sigAlgs.contains(SignatureAlgorithm.rsa);
+ return sigAlgs.contains(new Short(SignatureAlgorithm.rsa));
case KeyExchangeAlgorithm.DHE_DSS:
case KeyExchangeAlgorithm.DHE_DSS_EXPORT:
case KeyExchangeAlgorithm.SRP_DSS:
- return sigAlgs.contains(SignatureAlgorithm.dsa);
+ return sigAlgs.contains(new Short(SignatureAlgorithm.dsa));
case KeyExchangeAlgorithm.ECDHE_ECDSA:
- return sigAlgs.contains(SignatureAlgorithm.ecdsa)
- || sigAlgs.contains(SignatureAlgorithm.ed25519)
- || sigAlgs.contains(SignatureAlgorithm.ed448);
+ return sigAlgs.contains(new Short(SignatureAlgorithm.ecdsa))
+ || sigAlgs.contains(new Short(SignatureAlgorithm.ed25519))
+ || sigAlgs.contains(new Short(SignatureAlgorithm.ed448));
default:
return true;
@@ -2912,13 +2912,13 @@ public static Vector getUsableSignatureAlgorithms(Vector sigHashAlgs)
}
Vector v = new Vector(6);
- v.addElement(SignatureAlgorithm.anonymous);
+ v.addElement(new Short(SignatureAlgorithm.anonymous));
for (int i = 0; i < sigHashAlgs.size(); ++i)
{
SignatureAndHashAlgorithm sigHashAlg = (SignatureAndHashAlgorithm)sigHashAlgs.elementAt(i);
if (sigHashAlg.getHash() >= MINIMUM_HASH_STRICT)
{
- short sigAlg = sigHashAlg.getSignature();
+ Short sigAlg = new Short(sigHashAlg.getSignature());
if (!v.contains(sigAlg))
{
v.addElement(sigAlg);
