fix import error
This commit is contained in:
		
							parent
							
								
									62edcc71de
								
							
						
					
					
						commit
						0c18512fcb
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -139,12 +139,13 @@ for status in ('online', 'chat', 'away', 'xa', 'dnd', 'invisible'):
 | 
				
			||||||
HAVE_PYCRYPTO = True
 | 
					HAVE_PYCRYPTO = True
 | 
				
			||||||
try:
 | 
					try:
 | 
				
			||||||
	from Crypto.PublicKey.RSA import generate
 | 
						from Crypto.PublicKey.RSA import generate
 | 
				
			||||||
 | 
						import os
 | 
				
			||||||
except ImportError:
 | 
					except ImportError:
 | 
				
			||||||
	HAVE_PYCRYPTO = False
 | 
						HAVE_PYCRYPTO = False
 | 
				
			||||||
else:
 | 
					else:
 | 
				
			||||||
	# public key for XEP-0116
 | 
						# public key for XEP-0116
 | 
				
			||||||
	#FIXME os.urandom is not a cryptographic PRNG
 | 
						#FIXME os.urandom is not a cryptographic PRNG
 | 
				
			||||||
	pubkey = Crypto.PublicKey.RSA.generate(384, os.urandom)
 | 
						pubkey = generate(384, os.urandom)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def get_nick_from_jid(jid):
 | 
					def get_nick_from_jid(jid):
 | 
				
			||||||
	pos = jid.find('@')
 | 
						pos = jid.find('@')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue