if peer does not include a security element in content node, set use_security to false
This commit is contained in:
parent
30cbdce234
commit
84debaabca
2 changed files with 11 additions and 2 deletions
|
@ -92,6 +92,12 @@ class JingleFileTransfer(JingleContent):
|
||||||
|
|
||||||
file_props['session-type'] = 'jingle'
|
file_props['session-type'] = 'jingle'
|
||||||
|
|
||||||
|
security = content.getTag('security')
|
||||||
|
if not security:
|
||||||
|
self.use_security = False
|
||||||
|
else:
|
||||||
|
self.use_security = True
|
||||||
|
|
||||||
file_tag = content.getTag('description').getTag('offer').getTag('file')
|
file_tag = content.getTag('description').getTag('offer').getTag('file')
|
||||||
for attribute in file_tag.getAttrs():
|
for attribute in file_tag.getAttrs():
|
||||||
if attribute in ('name', 'size', 'hash', 'date'):
|
if attribute in ('name', 'size', 'hash', 'date'):
|
||||||
|
@ -131,6 +137,11 @@ class JingleFileTransfer(JingleContent):
|
||||||
def __on_session_accept(self, stanza, content, error, action):
|
def __on_session_accept(self, stanza, content, error, action):
|
||||||
log.info("__on_session_accept")
|
log.info("__on_session_accept")
|
||||||
|
|
||||||
|
security = content.getTag('security')
|
||||||
|
if not security: # responder can not verify our fingerprint
|
||||||
|
self.use_security = False
|
||||||
|
|
||||||
|
|
||||||
def __on_session_terminate(self, stanza, content, error, action):
|
def __on_session_terminate(self, stanza, content, error, action):
|
||||||
log.info("__on_session_terminate")
|
log.info("__on_session_terminate")
|
||||||
|
|
||||||
|
|
|
@ -135,8 +135,6 @@ class ConnectionBytestream:
|
||||||
session = self.get_jingle_session(file_props['sender'], file_props['sid'])
|
session = self.get_jingle_session(file_props['sender'], file_props['sid'])
|
||||||
if not session:
|
if not session:
|
||||||
return
|
return
|
||||||
jid = gajim.get_jid_without_resource(file_props['sender'])
|
|
||||||
resource = gajim.get_resource_from_jid(file_props['sender'])
|
|
||||||
sid = file_props['sid']
|
sid = file_props['sid']
|
||||||
gajim.socks5queue.add_file_props(self.name, file_props)
|
gajim.socks5queue.add_file_props(self.name, file_props)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue