@Test public void testVersionNormalization() throws Exception { Handshake hs = new Handshake("11.2.3.a"); assertEquals("11.02.03.a", hs.getVersion()); }
private void receivedHahdshake(Handshake handshake) throws CommunicationException { String clientVersion = handshake.getVersion(); this.workContext.setClientVersion(Version.getVersion(clientVersion)); if (usingEncryption) { byte[] returnedPublicKey = handshake.getPublicKey(); byte[] returnedPublicKeyLarge = handshake.getPublicKeyLarge(); boolean large = false; //ensure the key information if (returnedPublicKey == null) { if (returnedPublicKeyLarge == null) { throw new CommunicationException(RuntimePlugin.Event.TEIID40052, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40052)); } large = true; returnedPublicKey = returnedPublicKeyLarge; } if (LogManager.isMessageToBeRecorded(LogConstants.CTX_TRANSPORT, MessageLevel.DETAIL)) { LogManager.logDetail(LogConstants.CTX_TRANSPORT, large?"2048":"1024", "key exchange being used."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } boolean useCbc = handshake.isCbc(); try { this.cryptor = keyGen.getSymmetricCryptor(returnedPublicKey, "08.03".compareTo(clientVersion) > 0, SocketClientInstance.class.getClassLoader(), large, useCbc); //$NON-NLS-1$ } catch (CryptoException e) { throw new CommunicationException(RuntimePlugin.Event.TEIID40053, e); } this.keyGen = null; } else { this.cryptor = new NullCryptor(); } }
serverVersion = handshake.getVersion(); handshake.setVersion();
serverVersion = handshake.getVersion(); handshake.setVersion();