rakuten / as3crypto

Automatically exported from code.google.com/p/as3crypto
0 stars 1 forks source link

Error with plus.pop.mail.yahoo.com #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Make the following call

socket = new TLSSocket("plus.pop.mail.yahoo.com", 995); 

What is the expected output? What do you see instead?

Expect to connect or get an error

Actually get an unhandled exception ... see Trace below:

Error: Error #2030: End of file was encountered.
    at flash.utils::ByteArray/readShort()
    at com.hurlant.crypto.tls::TLSEngine/parseHandshakeHello()
[\crypto\com\hurlant\crypto\tls\TLSEngine.as:434]
    at com.hurlant.crypto.tls::TLSEngine/parseHandshake()
[\crypto\com\hurlant\crypto\tls\TLSEngine.as:312]
    at com.hurlant.crypto.tls::TLSEngine/parseOneRecord()
[\crypto\com\hurlant\crypto\tls\TLSEngine.as:228]
    at com.hurlant.crypto.tls::TLSEngine/parseRecord()
[\crypto\com\hurlant\crypto\tls\TLSEngine.as:206]
    at com.hurlant.crypto.tls::TLSEngine/dataAvailable()
[\crypto\com\hurlant\crypto\tls\TLSEngine.as:139]

Not sure if this is because Yahoo is using an unhandled TLS version.  At 
the very least would expect the error to be handled.

What version of the product are you using? On what operating system?

v1.2

Original issue reported on code.google.com by tgoodma...@gmail.com on 24 Dec 2008 at 5:48

GoogleCodeExporter commented 9 years ago
Sorry it is v1.3 not 1.2 

Original comment by tgoodma...@gmail.com on 24 Dec 2008 at 5:50

GoogleCodeExporter commented 9 years ago
I had the same issue. There's a bug in in the class TLSEngine. They are not 
taking
into account that the third parameter that the function ByteArray.readBytes() 
takes,
that is "length", has a special behavior for the value zero. Adobe's 
documentation
satates "The default value of 0 causes all available data to be read.".

To fix it you will need to change the file com/hurlant/crypto/tls/TLSEngine.as 
at
line 429.

From this:

rec.readBytes(session, 0, session_length);

To this:

if(session_length > 0){
  rec.readBytes(session, 0, session_length);
}

Original comment by fedebase...@gmail.com on 16 Mar 2010 at 6:34