You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setting a Zone to "Use Encryption" and attempting to connect, the client crashes.
Client code:
// SmartFox connection
var sfs:SmartFox;
...
// Event listener
sfs.addEventListener(SFSEvent.CRYPTO_INIT, onCryptoInit);
...
// Calling initCrypto to trigger "onCryptoInit" event listener
sfs.initCrypto();
...
// Login to Zone
private function onCryptoInit(evt:SFSEvent)
{
if (evt.params.success)
sfs.send(new LoginRequest("username", "password", sfs.config.zone));
}
The problem is that using cast to convert an openfl or flash ByteArray to a crypto ByteArray results in a null value. For example, in the encrypt function in DefaultPacketEncrypter, Crypto.getCipher(ALGORITHM, cast ck.key, cast padding); causes a crash because the ck.key cast results in a null.
Called from hxcpp::__hxcpp_main
Called from ApplicationMain::main ApplicationMain.hx line 25
Called from ApplicationMain::create ApplicationMain.hx line 130
Called from lime.app.Application::exec lime/app/Application.hx line 150
Called from lime._internal.backend.native.NativeApplication::exec lime/_internal/backend/native/NativeApplication.hx line 146
Called from lime._internal.backend.native.NativeApplication::handleApplicationEvent lime/_internal/backend/native/NativeApplication.hx line 175
Called from lime.app._Event_Int_Void::dispatch lime/_internal/macros/EventMacro.hx line 91
Called from lime.system.ThreadPool::__update lime/system/ThreadPool.hx line 185
Called from lime.app._Event_Dynamic_Void::dispatch lime/_internal/macros/EventMacro.hx line 91
Called from lime._internal.backend.native.NativeHTTPRequest::multiThreadPool_onProgress lime/_internal/backend/native/NativeHTTPRequest.hx line 570
Called from lime.app.Promise_haxe_io_Bytes::complete lime/app/Promise.hx line 108
Called from lime._internal.backend.native.NativeHTTPRequest::loadText lime/_internal/backend/native/NativeHTTPRequest.hx line 349
Called from lime.app.Promise_String::complete lime/app/Promise.hx line 108
Called from lime.net._HTTPRequest_String::load lime/net/HTTPRequest.hx line 146
Called from lime.app.Promise::complete lime/app/Promise.hx line 108
Called from openfl.net.URLLoader::load openfl/net/URLLoader.hx line 318
Called from openfl.events.EventDispatcher::dispatchEvent openfl/events/EventDispatcher.hx line 246
Called from openfl.events.EventDispatcher::__dispatchEvent openfl/events/EventDispatcher.hx line 402
Called from com.smartfoxserver.v2.util.CryptoInitializer::onHttpResponse com/smartfoxserver/v2/util/CryptoInitializer.hx line 85
Called from openfl.events.EventDispatcher::dispatchEvent openfl/events/EventDispatcher.hx line 246
Called from openfl.events.EventDispatcher::__dispatchEvent openfl/events/EventDispatcher.hx line 402
Called from TitleState::onCryptoInit TitleState.hx line 298
Called from TitleState::selectLogin TitleState.hx line 280
Called from TitleState::sendLogin TitleState.hx line 226
Called from com.smartfoxserver.v2.SmartFox::send com/smartfoxserver/v2/SmartFox.hx line 1888
Error : Null Object Reference
The text was updated successfully, but these errors were encountered:
When setting a Zone to "Use Encryption" and attempting to connect, the client crashes.
Client code:
The problem is that using
cast
to convert an openfl or flash ByteArray to a crypto ByteArray results in a null value. For example, in theencrypt
function inDefaultPacketEncrypter
,Crypto.getCipher(ALGORITHM, cast ck.key, cast padding);
causes a crash because theck.key
cast results in a null.The text was updated successfully, but these errors were encountered: