From c512c662937347b74f423ad22eebeab1c223396c Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Mon, 15 Jan 2007 11:42:09 +0000 Subject: Fixed bug 1361 --- cpp/src/IceSSL/TransceiverI.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'cpp/src') diff --git a/cpp/src/IceSSL/TransceiverI.cpp b/cpp/src/IceSSL/TransceiverI.cpp index c0c2595bf83..157a65614e6 100644 --- a/cpp/src/IceSSL/TransceiverI.cpp +++ b/cpp/src/IceSSL/TransceiverI.cpp @@ -332,8 +332,17 @@ IceSSL::TransceiverI::read(IceInternal::Buffer& buf, int timeout) // "decryption failed or bad record mac". We trap that error and // treat it as the loss of a connection. // + // NOTE: We have to compare the reason string instead + // of the error codes because the error code values + // changed between OpenSSL 0.9.7i and 0.9.7j and + // between OpenSSL 0.9.8a and 0.9.8b... + // + //unsigned long e = ERR_peek_error(); + //if(ERR_GET_LIB(e) == ERR_LIB_SSL && ERR_GET_REASON(e) == SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC) + // unsigned long e = ERR_peek_error(); - if(ERR_GET_LIB(e) == ERR_LIB_SSL && ERR_GET_REASON(e) == SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC) + if(ERR_GET_LIB(e) == ERR_LIB_SSL && + strcmp(ERR_reason_error_string(e), "decryption failed or bad record mac") == 0) { ConnectionLostException ex(__FILE__, __LINE__); ex.error = 0; -- cgit v1.2.3