bugXMPP4R - Bugs: bug #14048, starttls failure not caught...

 
 
Show feedback again

bug #14048: starttls failure not caught correctly, cause exception

Submitted by:  None
Submitted on:  Sat 01 Aug 2009 06:27:43 PM UTC  
 
Category: NoneSeverity: 4 - Important
Priority: 5 - NormalStatus: None
Privacy: PublicAssigned to: None
Originator Email: -unavailable-Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 01 Aug 2009 06:27:43 PM UTC, original submission:

In the 0.5 version, connection.rb around line 138 there is a ServerError raised if a 'proceed' is not received in reply to the 'starttls'. However, the error is blindly grabbing reply.first_element('error'). This is bad for two reasons:

1) The XMPP Core spec (http://xmpp.org/rfcs/rfc3920.html) says that this should be 'failure' not error; I can confirm this as I see exceptions being thrown from errors.rb on the .to_s method of ServerError with a call stack that points back here. TLS is failing and on the failure its passing in a nil object to the ServerError.new in connection.rb.

2) Regardless of #1, the raising of the Server error needs to be guarded with a check on whether reply.first_element('failure') returns anything. If not then a different error should be generated since there is no known ErrorResponse to grab.

I've patched my version to solve these issues this way:

if reply.name != 'proceed'
error = reply.first_element('failure')
raise ServerError.new(error) unless error.nil?
raise JabberError.new("Unhandled reply type: #{reply.name}")
end

Anonymous

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup