Browse Source

reverted eqstream rewrite changes as it was causing login to initially fail

Image 4 years ago
parent
commit
b65b57364e
1 changed files with 6 additions and 3 deletions
  1. 6 3
      EQ2/source/common/EQStream.cpp

+ 6 - 3
EQ2/source/common/EQStream.cpp

@@ -293,7 +293,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p, EQProtocolPacket* lastp)
 						offset = 3;
 					} else
 						offset = 1;
-					if(crypto->getRC4Key()==0 && p->size >= 8){
+					if(crypto->getRC4Key()==0 && p->size >= 70){
 						processRSAKey(p);
 					}
 					else if(crypto->isEncrypted()){
@@ -367,7 +367,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p, EQProtocolPacket* lastp)
 					NextInSeq++;
 					if(HandleEmbeddedPacket(p))
 						break;
-					if(crypto->getRC4Key()==0 && p && p->size >= 10){
+					if(crypto->getRC4Key()==0 && p && p->size >= 70){
 						processRSAKey(p);
 					}
 					else if(crypto->isEncrypted() && p){
@@ -704,7 +704,10 @@ int16 EQStream::processRSAKey(EQProtocolPacket *p){
 	}
 	crypto->setRC4Key(Crypto::RSADecrypt(p->pBuffer + offset + (limit-8), 8));
 	return (limit + offset +1) - offset2;*/
-	crypto->setRC4Key(Crypto::RSADecrypt((p->pBuffer + p->size) - 8, 8));
+	if(p->pBuffer[0] == 0)
+		crypto->setRC4Key(Crypto::RSADecrypt(p->pBuffer + 62, 8));
+	else
+		crypto->setRC4Key(Crypto::RSADecrypt(p->pBuffer + 61, 8));
 	return 0;
 }