Kaffeine/telegram-qt

Successful authorization, but error of RPC Error 401: AUTH_KEY_UNREGISTERED

gggrafff opened this issue · 6 comments

Добрый день, с Вами можно общаться по-русски?
Good afternoon.
I want to use libTelegramQt. I perform operations just as it is made in testApp. Authorization takes place successfully, the status of connection becomes ConnectionStateAuthenticated. But at any requests which demand auth_key_id I receive an error of RPC Error 401: AUTH_KEY_UNREGISTERED.
In the console of debugging I watch, auth_key successfully remains at authorization and goes when sending requests.
Prompt what to pay attention to what I can incorrectly do?
I cause restoreConnection, connection is restored, auth_key remains, further getInitialUsers automatically is caused (), both inquiries return mistakes. My also any other calls of methods.
What do these variables in Utis.cpp mean?

static const QByteArray s_hardcodedRsaDataKey ("0c150023e2f70db7985ded064759cfecf0af328e69a41daf4d6f01b53813"
"5a6f91f8f8b2a0ec9ba9720ce352efcf6c5680ffc424bd634864902de0b4"
"bd6d49f4e580230e3ae97d95c8b19442b3c0a10d8f5633fecedd6926a7f6"
"dab0ddb7d457f9ea81b8465fcd6fffeed114011df91c059caedaf97625f6"
"c96ecc74725556934ef781d866b34f011fce4d835a090196e9a5f0e4449a"
"f7eb697ddb9076494ca5f81104a305b6dd27665722c46b60e5df680fb16b"
"210607ef217652e60236c255f6a28315f4083a96791d7214bf64c1df4fd0"
"db1944fb26a2a57031b32eee64ad15a8ba68885cde74a5bfc920f6abf59b"
"a5c75506373e7130f9042da922179251f");
static const QByteArray s_hardcodedRsaDataExp("010001");
static const quint64 s_hardcodedRsaDataFingersprint(0xc3b42b026ce86b21);

How to change their value? In case of application registration I was given out only RSA PUBLIC KEY which differs on length from hardcodedRsaDataKey. If I add the RSA PUBLIC KEY instead of hardcodedRsaDataKey, then at me there does not take place connection with the server.
Thanks.
I apply a conclusion from the debugging console.

Отладка запущена
&"warning: GDB: Failed to set controlling terminal: \320\235\320\265\320\277\321\200\320\270\320\274\320\265\320\275\320\270\320\274\321\213\320\271 \320\272 \320\264\320\260\320\275\320\275\320\276\320\274\321\203 \321\203\321\201\321\202\321\200\320\276\320\271\321\201\321\202\320\262\321\203 ioctl\n"
bool CTelegramDispatcher::restoreConnection(const QByteArray&) Format version: 4
bool CTelegramDispatcher::restoreConnection(const QByteArray&) "149.154.167.50"
restoreConnection установил authKey= "\x91\x06\xA1""9\xC8\xB5\xE7\x8C\x9C\xD9o\x94h6\xAC\xDB\x04\x87\xA7\xF4\x8F\xCD\xAD!\x90\x8E\xC7\xB7,\xB9\xBB\x19\x9E\x9E\x85\xE2 \xB4\xDB\x17\xC1\xDFkC\xE1\x89v~P\xDEi\xC7\xA2\x96v!Fto\x1D\xF7\xB5V\xA6o\xCB;'\x8D{\xA1Y\x00\xF9hsJsQb\xB7\xE7Zq\xE3\x82\xFB\xBC=q\x98\xA9\xAB\x04\xF7SP\xC4\xB0\xB5)\xF6\xF0\xFC&\xE6\x1E\x97\xE7T'\xD3""A\x05\x83.\x8A\x83.\xE7\xB6V\x98\xBE\x02hD\f\x01""B\x8D\xB4\xEE{\x18\xBB\xC2LE\xE8""5\xFA\x9C@]\xF8=\xF4Ko\xB3\xB6\x0E\x14\xAC\x92\xA7\xE8\x91zJ\x05\xC6\x0B\x10x\xE4@\xB8\\V1\x07QIw\x04\xC4\x88\x89\xE9/\xE9q\x95\xAE\xD8\x8F\xA5\xA3\x03}\xB2\xD2\xFC\xA9xb\x9C\x16\xC2.\xB4\xD0\x10\xD6uOr\xB9T\x1BM\xF9\xDD^k\x8D""1t\x8B\xEE&qA\xCB\xF5\xC6\xB5p\x97$\xFD\xAB""dD;\x16""3\x13RMe\x98\xCA""d\x99T\xF9\xC1'C\xFF\xFA\xF5v"
CTelegramConnection* CTelegramDispatcher::createConnection(const TLDcOption&) 2 "149.154.167.50" 443
void CTelegramConnection::setAuthKey(const QByteArray&) key: "9106a139c8b5e78c9cd96f946836acdb0487a7f48fcdad21908ec7b72cb9bb199e9e85e220b4db17c1df6b43e189767e50de69c7a296762146746f1df7b556a66fcb3b278d7ba15900f968734a735162b7e75a71e382fbbc3d7198a9ab04f75350c4b0b529f6f0fc26e61e97e75427d34105832e8a832ee7b65698be0268440c01428db4ee7b18bbc24c45e835fa9c405df83df44b6fb3b60e14ac92a7e8917a4a05c60b1078e440b85c56310751497704c48889e92fe97195aed88fa5a3037db2d2fca978629c16c22eb4d010d6754f72b9541b4df9dd5e6b8d31748bee267141cbf5c6b5709724fdab64443b163313524d6598ca649954f9c12743fffaf576" keyId: 5415603553999387343 auxHash: 15739787217883350970
void CTelegramDispatcher::setConnectionState(TelegramNamespace::ConnectionState) TelegramNamespace::ConnectionState(ConnectionStateConnecting)
void CTelegramDispatcher::onConnectionStatusChanged(int, int, quint32) status CTelegramConnection::ConnectionStatus(ConnectionStatusConnecting) reason CTelegramConnection::ConnectionStatusReason(ConnectionStatusReasonLocal) dc 2
void CTelegramConnection::startAuthTimer()
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) CTelegramConnection(0xb2602b68) auth CTelegramConnection::AuthState(AuthStateSignedIn) dc 2
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) Delayed packages: () 0
CTelegramDispatcher::continueInitialization( CTelegramDispatcher::InitializationStep(StepSignIn) ) on top of QFlags<CTelegramDispatcher::InitializationStep>(StepFirst)
отправка m_authId= 5415603553999387343
void CTelegramConnection::stopAuthTimer()
void CTelegramDispatcher::onConnectionStatusChanged(int, int, quint32) status CTelegramConnection::ConnectionStatus(ConnectionStatusConnected) reason CTelegramConnection::ConnectionStatusReason(ConnectionStatusReasonRemote) dc 2
void CTelegramConnection::onTransportReadyRead() Received different server salt: 8062699163366606297 (remote) vs 4406907682947276709 (local)
"Bad message 6476463135250790104/1: Code 48 (Incorrect server salt)."
отправка m_authId= 5415603553999387343
Local serverSalt fixed to 8062699163366606297
void CTelegramConnection::processMessageAck(CTelegramStream&) Package 6476463135753301244 acked
Core: Got DC Configuration.
1 "149.154.175.50" 443
1 "2001:0b28:f23d:f001:0000:0000:0000:000a" 443
2 "149.154.167.51" 443
2 "2001:067c:04e8:f002:0000:0000:0000:000a" 443
3 "149.154.175.100" 443
3 "2001:0b28:f23d:f003:0000:0000:0000:000a" 443
4 "149.154.167.92" 443
4 "2001:067c:04e8:f004:0000:0000:0000:000a" 443
4 "149.154.165.120" 443
5 "91.108.56.180" 443
5 "2001:0b28:f23f:f005:0000:0000:0000:000a" 443
CTelegramDispatcher::continueInitialization( CTelegramDispatcher::InitializationStep(StepDcConfiguration) ) on top of QFlags<CTelegramDispatcher::InitializationStep>(StepSignIn)
void CTelegramDispatcher::setConnectionState(TelegramNamespace::ConnectionState) TelegramNamespace::ConnectionState(ConnectionStateAuthenticated)
отправка m_authId= 5415603553999387343
отправка m_authId= 5415603553999387343
void CTelegramDispatcher::ensureMainConnectToWantedDc() Nothing to do. Wanted DC is already connected.
bool CTelegramConnection::processRpcError(CTelegramStream&, quint64, TLValue) "RPC Error 401: AUTH_KEY_UNREGISTERED for message 6476463136461970800 UsersGetUsers (dc 2|149.154.167.50:443)"
void CTelegramConnection::processMessageAck(CTelegramStream&) Package 6476463136461970804 acked
bool CTelegramConnection::processRpcError(CTelegramStream&, quint64, TLValue) "RPC Error 401: AUTH_KEY_UNREGISTERED for message 6476463136461970804 UsersGetUsers (dc 2|149.154.167.50:443)"
QThread: Destroyed while thread is still running
Отладка завершена

I not rather precisely described a problem. Now I noted that in case of normal authorization methods are executed:

void CTelegramDispatcher::setConnectionState(TelegramNamespace::ConnectionState) TelegramNamespace::ConnectionState(ConnectionStateAuthenticated)
quint64 CTelegramConnection::requestPhoneCode(const QString&) requestPhoneCode "79xxxxxxxxx" 2
отправка m_authId= 16548352270544066920
void CTelegramDispatcher::getContacts()
отправка m_authId= 16548352270544066920
void CTelegramDispatcher::getInitialDialogs()
отправка m_authId= 16548352270544066920
void CTelegramDispatcher::onUpdatesReceived(const TLUpdates&, quint64)
Updates too long!
void CTelegramDispatcher::getUpdatesState()
отправка m_authId= 16548352270544066920
void CTelegramConnection::processMessageAck(CTelegramStream&) Package 6476612737027658404 acked
void CTelegramConnection::processMessageAck(CTelegramStream&) Package 6476612737031953372 acked
void CTelegramConnection::processMessageAck(CTelegramStream&) Package 6476612737031953376 acked
void CTelegramDispatcher::onConnectionStatusChanged(int, int, quint32) status CTelegramConnection::ConnectionStatus(ConnectionStatusDisconnected) reason CTelegramConnection::ConnectionStatusReason(ConnectionStatusReasonRemote) dc 2
void CTelegramDispatcher::onConnectionStatusChanged(int, int, quint32) A connection is unexpectedly terminated! CTelegramConnection(0xb260c2a8)
void CTelegramDispatcher::onConnectionFailed(CTelegramConnection*) CTelegramConnection(0xb260c2a8) 2 "149.154.167.51"
CTelegramConnection* CTelegramDispatcher::createConnection(const TLDcOption&) 2 "149.154.167.51" 443
QAbstractSocket::waitForBytesWritten() is not allowed in UnconnectedState
retry timer triggered
void CTelegramDispatcher::onConnectionStatusChanged(int, int, quint32) status CTelegramConnection::ConnectionStatus(ConnectionStatusConnecting) reason CTelegramConnection::ConnectionStatusReason(ConnectionStatusReasonLocal) dc 2
void CTelegramConnection::startAuthTimer()

But if I right after authorization call other methods, then they return an error.

After restoration of the auth_key_id connection remains to the same, but:

отправка m_authId= 12482595960546587518
отправка m_authId= 12482595960546587518
void CTelegramDispatcher::ensureMainConnectToWantedDc() Nothing to do. Wanted DC is already connected.
bool CTelegramConnection::processRpcError(CTelegramStream&, quint64, TLValue) "RPC Error 401: AUTH_KEY_UNREGISTERED for message 6476610161842577008 UsersGetUsers (dc 2|149.154.167.51:443)"
void CTelegramConnection::processMessageAck(CTelegramStream&) Package 6476610161842577012 acked
bool CTelegramConnection::processRpcError(CTelegramStream&, quint64, TLValue) "RPC Error 401: AUTH_KEY_UNREGISTERED for message 6476610161842577012 UsersGetUsers (dc 2|149.154.167.51:443)"

The post of #16 looked. I don't cause logOut.

Here an output in the debugging console in case of authorization and attempt to execute methods. It is suspicious that he several times during this time unites. And shall be? testApp did not manage to be compiled, otherwise would look how it behaves.

Отладка запущена
&"warning: GDB: Failed to set controlling terminal: \320\235\320\265\320\277\321\200\320\270\320\274\320\265\320\275\320\270\320\274\321\213\320\271 \320\272 \320\264\320\260\320\275\320\275\320\276\320\274\321\203 \321\203\321\201\321\202\321\200\320\276\320\271\321\201\321\202\320\262\321\203 ioctl\n"
CTelegramDispatcher::tryNextBuiltInDcAddress(): Dc index 0
CTelegramConnection* CTelegramDispatcher::createConnection(const TLDcOption&) 0 "149.154.175.50" 443
void CTelegramDispatcher::setConnectionState(TelegramNamespace::ConnectionState) TelegramNamespace::ConnectionState(ConnectionStateConnecting)
void CTelegramDispatcher::onConnectionStatusChanged(int, int, quint32) status CTelegramConnection::ConnectionStatus(ConnectionStatusConnecting) reason CTelegramConnection::ConnectionStatusReason(ConnectionStatusReasonLocal) dc 0
void CTelegramConnection::startAuthTimer()
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) CTelegramConnection(0xb26029b8) auth CTelegramConnection::AuthState(AuthStatePqRequested) dc 0
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) Delayed packages: () 0
void CTelegramDispatcher::onConnectionStatusChanged(int, int, quint32) status CTelegramConnection::ConnectionStatus(ConnectionStatusConnected) reason CTelegramConnection::ConnectionStatusReason(ConnectionStatusReasonRemote) dc 0
bool CTelegramConnection::acceptPqAuthorization(const QByteArray&)
bool CTelegramConnection::acceptPqAuthorization(const QByteArray&) Client nonce: �H����y�ߙնhf9�S��M���
bool CTelegramConnection::acceptPqAuthorization(const QByteArray&) Server nonce: "5317ab4d1982de00ca08554a8cb5117c"
bool CTelegramConnection::acceptPqAuthorization(const QByteArray&) PQ: 1060555248267074401
bool CTelegramConnection::acceptPqAuthorization(const QByteArray&) P: 1016727163
bool CTelegramConnection::acceptPqAuthorization(const QByteArray&) Q: 1043107027
bool CTelegramConnection::acceptPqAuthorization(const QByteArray&) FingerPrints: QVector(14101943622620965665)
void CTelegramConnection::requestDhParameters()
void CTelegramConnection::requestDhParameters() New nonce: "79408716b86cf7c9ec5f9a71057b2cf15de6169a4bb590ae1aa54e83769ed05b"
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) CTelegramConnection(0xb26029b8) auth CTelegramConnection::AuthState(AuthStateDhRequested) dc 0
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) Delayed packages: () 0
bool CTelegramConnection::acceptDhAnswer(const QByteArray&)
void CTelegramConnection::generateDh()
m_b "L\xBC\xC5+\x02\xE6\x89\x87\xC1\xBF\xC7\x9Dp\x18~\x1Eg\xA1\xF7!\x9F\xEF\x1E\x88z\xA2\xE3\xCE\xF6\tt9\xAA\x8D\x18q\\E\xC7\xB6\x03\\\x8D""B(\xBC\xB8n\xDD\xF4\x92\xD6\xF7\xDD\xC2}-n9\x8B$\x17O\xF1\xCB\x07\x92\xF8\x8A\x80\x1E>8\xB4\xC3\x0BP\x0B\xE0#-\xBB\xB2""7g\xDD\xF9""2\xF7v\x84\x9B\x14\x91\xE7\xA1\x03\x98P\xAB\x18\x86V2bt,u\x8FU\xA9\x82lj:\xE7\xD1\x86\xE6\x84\x90\x89""a\x0E\x04&&r\xD4\x84\xE9\x07\x1E\xF6n!P\x82\xB1\x19-\xD3\xC0\xA3L,\x01+#\xC3P%\x97\xF8\nS\xCA\xF4p%\xCF\x84\xA1""a\x12\x95\xF0\x03\xF9x\xEC&k\x00\xFE""f\xB6\xEF""8\xD0\xF2\xAA\xCA\xC7\xE2\xF8O|8_\xF3|\xCCjcMt$\xA0\x19\xF5:\x11\xA8\xC7\x80""d\xE9sy\x0E\xF3\x1F\xDC\x1AU\xA9\x1E\xF6$\x1D\xE3'v\xF4\xBD[\xFA}\x9B\x15\xCEU\xB9\x9A\xF0\xCC\x0B\xB6\x80%\r\x84\x81z\x9C\xF5""0>oR\x1An\xE6O\x93"
void CTelegramConnection::requestDhGenerationResult()
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) CTelegramConnection(0xb26029b8) auth CTelegramConnection::AuthState(AuthStateDhGenerationResultRequested) dc 0
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) Delayed packages: () 0
bool CTelegramConnection::processServerDhAnswer(const QByteArray&) "DhGenOk"
bool CTelegramConnection::processServerDhAnswer(const QByteArray&) Answer OK
Server DH answer is accepted. Setup the auth key...
void CTelegramConnection::setAuthKey(const QByteArray&) key: "8329f8d9a0d8f7ab311b4762f7a6b1aef4fba4a93bd68e3d545563be1e79fb05144e77d4ad58fa3eaee20f93f6d017981ecc1bf81357b0b85fa1fac6eaedbd4c95bb7892c396217a365abe59529090f5409cafacf90febe12bcb013d32180adf56b678317412b49358d07ec692276f7b452b6efe2a5e69740afcffafba4044d0333e4050cae6aaf3281bee4665892b6bcfc1690e0c6c59e0346ba943ec66f322cbdbabe09bf60dceea450275299fbad2587e9ba3984ee2f076c9fcea28e64fb22ba04980db43e1b0cc8e9857963234b9f573bb9b8554bb528dcb300c7334eaa36be961550fa8a22716e0dc7d2e755e41546309c8039738a3af73bf93de36f5e8" keyId: 12106500960832290982 auxHash: 926295159640344224
processServerDhAnswer установил newAuthKey= "\x83)\xF8\xD9\xA0\xD8\xF7\xAB""1\x1BGb\xF7\xA6\xB1\xAE\xF4\xFB\xA4\xA9;\xD6\x8E=TUc\xBE\x1Ey\xFB\x05\x14Nw\xD4\xADX\xFA>\xAE\xE2\x0F\x93\xF6\xD0\x17\x98\x1E\xCC\x1B\xF8\x13W\xB0\xB8_\xA1\xFA\xC6\xEA\xED\xBDL\x95\xBBx\x92\xC3\x96!z6Z\xBEYR\x90\x90\xF5@\x9C\xAF\xAC\xF9\x0F\xEB\xE1+\xCB\x01=2\x18\n\xDFV\xB6x1t\x12\xB4\x93X\xD0~\xC6\x92'o{E+n\xFE*^it\n\xFC\xFF\xAF\xBA@D\xD0""3>@P\xCA\xE6\xAA\xF3(\x1B\xEE""Fe\x89+k\xCF\xC1i\x0E\flY\xE0""4k\xA9""C\xEC""f\xF3\"\xCB\xDB\xAB\xE0\x9B\xF6\r\xCE\xEA""E\x02u)\x9F\xBA\xD2X~\x9B\xA3\x98N\xE2\xF0v\xC9\xFC\xEA(\xE6O\xB2+\xA0I\x80\xDB""C\xE1\xB0\xCC\x8E\x98W\x96""24\xB9\xF5s\xBB\x9B\x85T\xBBR\x8D\xCB""0\fs4\xEA\xA3k\xE9""aU\x0F\xA8\xA2'\x16\xE0\xDC}.u^ATc\t\xC8\x03\x97""8\xA3\xAFs\xBF\x93\xDE""6\xF5\xE8"
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) CTelegramConnection(0xb26029b8) auth CTelegramConnection::AuthState(AuthStateHaveAKey) dc 0
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) Delayed packages: () 0
CTelegramDispatcher::continueInitialization( CTelegramDispatcher::InitializationStep(StepFirst) ) on top of QFlags<CTelegramDispatcher::InitializationStep>(StepFirst)
отправка m_authId= 12106500960832290982
void CTelegramConnection::stopAuthTimer()
void CTelegramConnection::processMessageAck(CTelegramStream&) Package 6476612698248398696 acked
Connection CTelegramConnection(0xb26029b8) DC Id changed from 0 to 1
Core: Got DC Configuration.
1 "149.154.175.50" 443
1 "2001:0b28:f23d:f001:0000:0000:0000:000a" 443
2 "149.154.167.51" 443
2 "2001:067c:04e8:f002:0000:0000:0000:000a" 443
3 "149.154.175.100" 443
3 "2001:0b28:f23d:f003:0000:0000:0000:000a" 443
4 "149.154.167.92" 443
4 "2001:067c:04e8:f004:0000:0000:0000:000a" 443
4 "149.154.165.120" 443
5 "91.108.56.180" 443
5 "2001:0b28:f23f:f005:0000:0000:0000:000a" 443
CTelegramDispatcher::continueInitialization( CTelegramDispatcher::InitializationStep(StepDcConfiguration) ) on top of QFlags<CTelegramDispatcher::InitializationStep>(StepFirst)
void CTelegramDispatcher::setConnectionState(TelegramNamespace::ConnectionState) TelegramNamespace::ConnectionState(ConnectionStateAuthRequired)
quint64 CTelegramConnection::requestPhoneCode(const QString&) requestPhoneCode "79xxxxxxxxx" 1
отправка m_authId= 12106500960832290982
void CTelegramDispatcher::ensureMainConnectToWantedDc() Nothing to do. There is no any special 'wanted' DC yet.
Вход в функцию processAuthSendCode
void CTelegramConnection::processAuthSendCode(RpcProcessingContext*) "RpcError"
m_authCodeHash= ""
bool CTelegramConnection::processRpcError(CTelegramStream&, quint64, TLValue) "RPC Error 303: PHONE_MIGRATE_2 for message 6476612699081622296 AuthSendCode (dc 1|149.154.175.50:443)"
void CTelegramAuthModule::onWantedMainDcChanged(quint32, const QString&) 2 "79684607850"
CTelegramConnection* CTelegramDispatcher::createConnection(const TLDcOption&) 2 "149.154.167.51" 443
void CTelegramDispatcher::onConnectionStatusChanged(int, int, quint32) status CTelegramConnection::ConnectionStatus(ConnectionStatusDisconnecting) reason CTelegramConnection::ConnectionStatusReason(ConnectionStatusReasonLocal) dc 1
void CTelegramDispatcher::onConnectionStatusChanged(int, int, quint32) status CTelegramConnection::ConnectionStatus(ConnectionStatusDisconnected) reason CTelegramConnection::ConnectionStatusReason(ConnectionStatusReasonLocal) dc 1
void CTelegramDispatcher::onConnectionStatusChanged(int, int, quint32) status CTelegramConnection::ConnectionStatus(ConnectionStatusConnecting) reason CTelegramConnection::ConnectionStatusReason(ConnectionStatusReasonLocal) dc 2
QAbstractSocket::waitForBytesWritten() is not allowed in UnconnectedState
void CTelegramConnection::startAuthTimer()
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) CTelegramConnection(0xb260c2a8) auth CTelegramConnection::AuthState(AuthStatePqRequested) dc 2
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) Delayed packages: (2) 1
void CTelegramDispatcher::onConnectionStatusChanged(int, int, quint32) status CTelegramConnection::ConnectionStatus(ConnectionStatusConnected) reason CTelegramConnection::ConnectionStatusReason(ConnectionStatusReasonRemote) dc 2
bool CTelegramConnection::acceptPqAuthorization(const QByteArray&)
bool CTelegramConnection::acceptPqAuthorization(const QByteArray&) Client nonce: hm!�����xVY�G���ɋ�`׳)�\�-6����
bool CTelegramConnection::acceptPqAuthorization(const QByteArray&) Server nonce: "c98bc460d7b329b55cfb2d36deda0eb1"
bool CTelegramConnection::acceptPqAuthorization(const QByteArray&) PQ: 3175076632954143013
bool CTelegramConnection::acceptPqAuthorization(const QByteArray&) P: 1744824881
bool CTelegramConnection::acceptPqAuthorization(const QByteArray&) Q: 1819710773
bool CTelegramConnection::acceptPqAuthorization(const QByteArray&) FingerPrints: QVector(14101943622620965665)
void CTelegramConnection::requestDhParameters()
void CTelegramConnection::requestDhParameters() New nonce: "1b73ccb97760cb9edccb8dcd533f93c12015efbbf138528fef14f1a3a9a07b81"
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) CTelegramConnection(0xb260c2a8) auth CTelegramConnection::AuthState(AuthStateDhRequested) dc 2
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) Delayed packages: (2) 1
bool CTelegramConnection::acceptDhAnswer(const QByteArray&)
void CTelegramConnection::generateDh()
m_b "\xA5\xEDs!2\xCD\x9A\xD6\xD8""0\x11U\x0E\x98\xC4\x9CI\xB1\x81\x0F\x18I\"\x1AQ\xCDq\xAEM\xD9}\xCEx\x12\xA7\xD0\xA9\x97\xE0\x10\x19\xA7p\x19(\n\x11z\xB5\x84\xEB\x95w\xAC""c\\\xF2\xF3\xA6\xD3\x84\xF4\xF5\xA7\x8D\xB3\x12""a\xAEnv\xC3\xDE\xDB\x8E{2F\xE3:?vZ\xE7""B\xC8\x84\x8D\xFAM\xFA\xF9Ygp\x95\xE0\xA0)\xC2\xDA\xB5\x87""Bi\x97\xB3 \xC8Zs\xD2r\xE9\xE8\x7F\x83\xBB+\x82\n\xE4\xA0\x94""D\xFA&\x91\x94\xE9P{z\xF6s\xF0\x94:p\xE7\xD3\x82i\x84\x1E""3\x18sV^\xF1\xEC:gl\x12\xC2\xD8\xB6\xF4\xA4p/])+\xEF\xC7\x99\x85_\xE4""2,u\xAD(\xBB%\xAC\xE4\xAA\xDD\xF9\xAB\x99Q7\x80\x00\x9A\xB5""6\xDD\x93\xCB=\x00?\x89\xCD\x0B\x0B\xA4""3\xA0\x8F\xDC\xDBP=\xB5\x0Fh\x91.\x93oL\xD4\xAC\xBC\xE4""6\xD6\n9\xAFz\xA9\x8A\xD4\xA3S,\xB1\x91\xD4\xAFq\xB2\xBD\x93\\+@}\x17\xBE\xADs\x12\xAF\x1B\xB3\x8C"
void CTelegramConnection::requestDhGenerationResult()
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) CTelegramConnection(0xb260c2a8) auth CTelegramConnection::AuthState(AuthStateDhGenerationResultRequested) dc 2
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) Delayed packages: (2) 1
bool CTelegramConnection::processServerDhAnswer(const QByteArray&) "DhGenOk"
bool CTelegramConnection::processServerDhAnswer(const QByteArray&) Answer OK
Server DH answer is accepted. Setup the auth key...
void CTelegramConnection::setAuthKey(const QByteArray&) key: "6c59f11a33f077a488ba462d4668679b6907adfd9cc4153a9c35e18b7f42e3433ad1366a6dd9bccdd7d73b552e1961357eec6aa2d7b0ff1d734997dfb6d89e5b841d66d7879095d4ea046fc894764eeebba7a3fb5cfd65989419d8e875b2a075845dea4c5ecd735a54494ec771740e7733368b6a9b60ec3fed78183e6028997cd87338d4510574099507b4b17a27ec6bd000a570439b0992491fd3b3bd887e38cab4152096b7afed87e2e07abb618a5279846a02e604e376b7ce3e64ea04cc4ea58f9a91e209802898eb72e17f362143396b62acc55336cbed7cf5dbbef3dbef5ff80bb9a2bd0d98ce5f3748b6dd97a8e31667f992743f21e82b2e8a408abb1a" keyId: 16548352270544066920 auxHash: 9587955549798423857
processServerDhAnswer установил newAuthKey= "lY\xF1\x1A""3\xF0w\xA4\x88\xBA""F-Fhg\x9Bi\x07\xAD\xFD\x9C\xC4\x15:\x9C""5\xE1\x8B\x7F""B\xE3""C:\xD1""6jm\xD9\xBC\xCD\xD7\xD7;U.\x19""a5~\xECj\xA2\xD7\xB0\xFF\x1DsI\x97\xDF\xB6\xD8\x9E[\x84\x1D""f\xD7\x87\x90\x95\xD4\xEA\x04o\xC8\x94vN\xEE\xBB\xA7\xA3\xFB\\\xFD""e\x98\x94\x19\xD8\xE8u\xB2\xA0u\x84]\xEAL^\xCDsZTIN\xC7qt\x0Ew36\x8Bj\x9B`\xEC?\xEDx\x18>`(\x99|\xD8s8\xD4Q\x05t\t\x95\x07\xB4\xB1z'\xECk\xD0\x00\xA5pC\x9B\t\x92I\x1F\xD3\xB3\xBD\x88~8\xCA\xB4\x15 \x96\xB7\xAF\xED\x87\xE2\xE0z\xBB""a\x8ARy\x84j\x02\xE6\x04\xE3v\xB7\xCE>d\xEA\x04\xCCN\xA5\x8F\x9A\x91\xE2\t\x80(\x98\xEBr\xE1\x7F""6!C9kb\xAC\xC5S6\xCB\xED|\xF5\xDB\xBE\xF3\xDB\xEF_\xF8\x0B\xB9\xA2\xBD\r\x98\xCE_7H\xB6\xDD\x97\xA8\xE3\x16g\xF9\x92t?!\xE8+.\x8A@\x8A\xBB\x1A"
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) CTelegramConnection(0xb260c2a8) auth CTelegramConnection::AuthState(AuthStateHaveAKey) dc 2
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) Delayed packages: (2) 1
CTelegramDispatcher::continueInitialization( CTelegramDispatcher::InitializationStep(StepFirst) ) on top of QFlags<CTelegramDispatcher::InitializationStep>(StepDcConfiguration)
void CTelegramDispatcher::setConnectionState(TelegramNamespace::ConnectionState) TelegramNamespace::ConnectionState(ConnectionStateAuthRequired)
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) process 1 redirected packages for dc 2
отправка m_authId= 16548352270544066920
void CTelegramConnection::stopAuthTimer()
void CTelegramConnection::processMessageAck(CTelegramStream&) Package 6476612703947820200 acked
Вход в функцию processAuthSendCode
void CTelegramConnection::processAuthSendCode(RpcProcessingContext*) "AuthSentCode"
m_authCodeHash= "149b437fc3fbf55e97"
SignIn with number  "79xxxxxxxxx"
отправка m_authId= 16548352270544066920
void CTelegramConnection::processAuthSign(RpcProcessingContext*) AuthAuthorization "79xxxxxxxxx"
CTelegramDispatcher::continueInitialization( CTelegramDispatcher::InitializationStep(StepKnowSelf) ) on top of QFlags<CTelegramDispatcher::InitializationStep>(StepDcConfiguration)
void CTelegramDispatcher::setConnectionState(TelegramNamespace::ConnectionState) TelegramNamespace::ConnectionState(ConnectionStateAuthRequired)
void CTelegramDispatcher::onUsersReceived(const QVector<TLUser>&) 1
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) CTelegramConnection(0xb260c2a8) auth CTelegramConnection::AuthState(AuthStateSignedIn) dc 2
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) Delayed packages: () 0
CTelegramDispatcher::continueInitialization( CTelegramDispatcher::InitializationStep(StepSignIn) ) on top of QFlags<CTelegramDispatcher::InitializationStep>(StepDcConfiguration|StepKnowSelf)
void CTelegramDispatcher::setConnectionState(TelegramNamespace::ConnectionState) TelegramNamespace::ConnectionState(ConnectionStateAuthenticated)
quint64 CTelegramConnection::requestPhoneCode(const QString&) requestPhoneCode "79xxxxxxxxx" 2
отправка m_authId= 16548352270544066920
void CTelegramDispatcher::getContacts()
отправка m_authId= 16548352270544066920
void CTelegramDispatcher::getInitialDialogs()
отправка m_authId= 16548352270544066920
void CTelegramDispatcher::onUpdatesReceived(const TLUpdates&, quint64)
Updates too long!
void CTelegramDispatcher::getUpdatesState()
отправка m_authId= 16548352270544066920
void CTelegramConnection::processMessageAck(CTelegramStream&) Package 6476612737027658404 acked
void CTelegramConnection::processMessageAck(CTelegramStream&) Package 6476612737031953372 acked
void CTelegramConnection::processMessageAck(CTelegramStream&) Package 6476612737031953376 acked
void CTelegramDispatcher::onConnectionStatusChanged(int, int, quint32) status CTelegramConnection::ConnectionStatus(ConnectionStatusDisconnected) reason CTelegramConnection::ConnectionStatusReason(ConnectionStatusReasonRemote) dc 2
void CTelegramDispatcher::onConnectionStatusChanged(int, int, quint32) A connection is unexpectedly terminated! CTelegramConnection(0xb260c2a8)
void CTelegramDispatcher::onConnectionFailed(CTelegramConnection*) CTelegramConnection(0xb260c2a8) 2 "149.154.167.51"
CTelegramConnection* CTelegramDispatcher::createConnection(const TLDcOption&) 2 "149.154.167.51" 443
QAbstractSocket::waitForBytesWritten() is not allowed in UnconnectedState
retry timer triggered
void CTelegramDispatcher::onConnectionStatusChanged(int, int, quint32) status CTelegramConnection::ConnectionStatus(ConnectionStatusConnecting) reason CTelegramConnection::ConnectionStatusReason(ConnectionStatusReasonLocal) dc 2
void CTelegramConnection::startAuthTimer()
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) CTelegramConnection(0xb26036c0) auth CTelegramConnection::AuthState(AuthStatePqRequested) dc 2
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) Delayed packages: () 0
void CTelegramDispatcher::onConnectionStatusChanged(int, int, quint32) status CTelegramConnection::ConnectionStatus(ConnectionStatusConnected) reason CTelegramConnection::ConnectionStatusReason(ConnectionStatusReasonRemote) dc 2
bool CTelegramConnection::acceptPqAuthorization(const QByteArray&)
bool CTelegramConnection::acceptPqAuthorization(const QByteArray&) Client nonce: ���yD�u)
���#���\��%L�&24��p&!�
bool CTelegramConnection::acceptPqAuthorization(const QByteArray&) Server nonce: "cb5cf9f2254c1526323414ce702621fc"
bool CTelegramConnection::acceptPqAuthorization(const QByteArray&) PQ: 1528281512427481631
bool CTelegramConnection::acceptPqAuthorization(const QByteArray&) P: 1229164049
bool CTelegramConnection::acceptPqAuthorization(const QByteArray&) Q: 1243350319
bool CTelegramConnection::acceptPqAuthorization(const QByteArray&) FingerPrints: QVector(14101943622620965665)
void CTelegramConnection::requestDhParameters()
void CTelegramConnection::requestDhParameters() New nonce: "fc4ee43c541269383a944912066caf2c7a298edabf6cb43a9f89c03f6486b878"
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) CTelegramConnection(0xb26036c0) auth CTelegramConnection::AuthState(AuthStateDhRequested) dc 2
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) Delayed packages: () 0
bool CTelegramConnection::acceptDhAnswer(const QByteArray&)
void CTelegramConnection::generateDh()
m_b "\x10\x14\xBA\x19\xA2\xED""5V\xBF\xBB\x07\xB6\x95=\xF0\xE3k39\x97\xB4""a\xD6\xC9\x1F\xC5\xCB\x1D\x86Y\x81\x10""C\xEF\x03\x8A\xE4\xCD\xB4\xB2\x02\x9C""C*\"\xF8\xD7\xBD\x8E\x95\xA5\x12\x0F""4\x95Z\xE6\x97\x90$\xB8""a\x02\x94v\x01\xD2""Ax\xC5=\xC8?\xB1/\x1A\x89\xEC\x07\x1E""F\xBE\x8C\x98\xBB\x82\x1BL\xD7\xA1\x88t\xB1""5\xE6\xB3\xC8\xA2\xCA\xB2\xFE""9\xF8""0\xA0S\xCB""0\xA8\xCC)\x83m\x1D\xED\xD4\x99\x13\xDB\xCE\xA6[\xD5\x1D\xB1w&\x1B\xE0nW>VJO\xDA(\xB5\xA7q\xAA\xE4\x8C\x98\r\xC0\x96\xE0_Z\x16+{\x06""c\x1E\x95&DL\x81)fE>\xD6\xD9""A\xC6\xB0Z\xD4\xA7\x1Fl\xF5l\xDC\xFB\xD7\xE6w\xFC\x81Tb\x1E\x03""C\xB8/\x9A\x8E""Bj[N\\\xBF\xB1\xAB\xF7~\xD6\x8B""F\xB1\xD6>\x93\x1A\xFC\xA8""8\xC6\x84\x97Qa\x0F&\x01\xD7@]\xF7\xDC}1\x81\xEB\xAB\xF5\xA7\xC1""dE\xF5J\x85\xCD\xCD`\x05\xF7}X\xFB\x1A,SBQ\x98\x93h"
void CTelegramConnection::requestDhGenerationResult()
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) CTelegramConnection(0xb26036c0) auth CTelegramConnection::AuthState(AuthStateDhGenerationResultRequested) dc 2
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) Delayed packages: () 0
bool CTelegramConnection::processServerDhAnswer(const QByteArray&) "DhGenOk"
bool CTelegramConnection::processServerDhAnswer(const QByteArray&) Answer OK
Server DH answer is accepted. Setup the auth key...
void CTelegramConnection::setAuthKey(const QByteArray&) key: "4be12b594b33148bfd2533500cf913e2fb3fe174bcb8e3bd006534604a5880cdd62b0f2ad45c8a0dc26c0e28401c5d5072b8cae929a1ea10e80f662f897939a162871645b7f7b41c357e7f3411455b08da41f283890bb2c2ae060d10072f723cb7c6857c15c475e532b9090da7045dab6bd984cf0631e90ae5d72aa659a0feb7cd9a54b2a367d2fc5a44ff997f8083b6cef94608cf3383a57e7c69e4588b5c919e9538fe4bfcd5b22604cd7530e48819a3eedb4ca9c6b28065f16874b005825b3521149468ff584edf523eae1773ef83d103c08da501683fe0d470ec3ec8f2cb32fdcf275fdf1ffaea395ca66cfd4bdacfe95e6dd160c28ffe7cea221cf28ce0" keyId: 8939957391990381844 auxHash: 5532197644967118101
processServerDhAnswer установил newAuthKey= "K\xE1+YK3\x14\x8B\xFD%3P\f\xF9\x13\xE2\xFB?\xE1t\xBC\xB8\xE3\xBD\x00""e4`JX\x80\xCD\xD6+\x0F*\xD4\\\x8A\r\xC2l\x0E(@\x1C]Pr\xB8\xCA\xE9)\xA1\xEA\x10\xE8\x0F""f/\x89y9\xA1""b\x87\x16""E\xB7\xF7\xB4\x1C""5~\x7F""4\x11""E[\b\xDA""A\xF2\x83\x89\x0B\xB2\xC2\xAE\x06\r\x10\x07/r<\xB7\xC6\x85|\x15\xC4u\xE5""2\xB9\t\r\xA7\x04]\xABk\xD9\x84\xCF\x06""1\xE9\n\xE5\xD7*\xA6Y\xA0\xFE\xB7\xCD\x9AT\xB2\xA3g\xD2\xFCZD\xFF\x99\x7F\x80\x83\xB6\xCE\xF9""F\b\xCF""3\x83\xA5~|i\xE4X\x8B\\\x91\x9E\x95""8\xFEK\xFC\xD5\xB2&\x04\xCDu0\xE4\x88\x19\xA3\xEE\xDBL\xA9\xC6\xB2\x80""e\xF1ht\xB0\x05\x82[5!\x14\x94h\xFFXN\xDFR>\xAE\x17s\xEF\x83\xD1\x03\xC0\x8D\xA5\x01h?\xE0\xD4p\xEC>\xC8\xF2\xCB""2\xFD\xCF'_\xDF\x1F\xFA\xEA""9\\\xA6l\xFDK\xDA\xCF\xE9^m\xD1`\xC2\x8F\xFE|\xEA\"\x1C\xF2\x8C\xE0"
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) CTelegramConnection(0xb26036c0) auth CTelegramConnection::AuthState(AuthStateHaveAKey) dc 2
void CTelegramDispatcher::onConnectionAuthChanged(int, quint32) Delayed packages: () 0
CTelegramDispatcher::continueInitialization( CTelegramDispatcher::InitializationStep(StepFirst) ) on top of QFlags<CTelegramDispatcher::InitializationStep>(StepDcConfiguration|StepSignIn|StepKnowSelf)
void CTelegramDispatcher::setConnectionState(TelegramNamespace::ConnectionState) TelegramNamespace::ConnectionState(ConnectionStateAuthRequired)
void CTelegramConnection::stopAuthTimer()
отправка m_authId= 8939957391990381844
отправка m_authId= 8939957391990381844
void CTelegramConnection::processMessageAck(CTelegramStream&) Package 6476612776141925536 acked
bool CTelegramConnection::processRpcError(CTelegramStream&, quint64, TLValue) "RPC Error 401: AUTH_KEY_UNREGISTERED for message 6476612776146220504 UsersGetUsers (dc 2|149.154.167.51:443)"
void CTelegramConnection::processMessagesCheckChatInvite(RpcProcessingContext*) Is not implemented yet
bool CTelegramConnection::processRpcError(CTelegramStream&, quint64, TLValue) "RPC Error 401: AUTH_KEY_UNREGISTERED for message 6476612776141925536 MessagesCheckChatInvite (dc 2|149.154.167.51:443)"
QThread: Destroyed while thread is still running
Отладка завершена

I think that the variables in Utils.cpp are the same public server key as everywhere. Probably you didn't notice that it is in a different format.

I just checked that auth works well in testApp and telepathy-morse, I'll read your log later.

You have "ConnectionStatusDisconnected, ConnectionStatusReasonRemote", so there is something bad indeed.
After the disconnection, CTelegramConnection does not restore the session, but tries to connect again and generates a new auth key, that is clearly not registered (not attached to any account).

@gggrafff, contact me in Telegram. I have the same username as here.

Probably you didn't notice that it is in a different format.

Thanks a lot. I have dealt with different formats of keys.
https://stackoverflow.com/questions/18039401/how-can-i-transform-between-the-two-styles-of-public-key-format-one-begin-rsa