1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-22 10:37:59 +01:00

Limit the scope of local variables in proceedTLSReceived()

This commit is contained in:
Florian Schmaus 2017-11-23 08:15:52 +01:00
parent 32f681c6e5
commit 573358b459

View file

@ -684,10 +684,6 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
* @throws Exception if an exception occurs.
*/
private void proceedTLSReceived() throws NoSuchAlgorithmException, CertificateException, IOException, KeyStoreException, NoSuchProviderException, UnrecoverableKeyException, KeyManagementException, SmackException {
SSLContext context = this.config.getCustomSSLContext();
KeyStore ks = null;
KeyManager[] kms = null;
PasswordCallback pcb = null;
SmackDaneVerifier daneVerifier = null;
if (config.getDnssecMode() == DnssecMode.needsDnssecAndDane) {
@ -701,6 +697,10 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
}
}
SSLContext context = this.config.getCustomSSLContext();
KeyStore ks = null;
PasswordCallback pcb = null;
if (context == null) {
final String keyStoreType = config.getKeystoreType();
final CallbackHandler callbackHandler = config.getCallbackHandler();
@ -745,6 +745,8 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
}
}
KeyManager[] kms = null;
if (ks != null) {
String keyManagerFactoryAlgorithm = KeyManagerFactory.getDefaultAlgorithm();
KeyManagerFactory kmf = KeyManagerFactory.getInstance(keyManagerFactoryAlgorithm);