#NEWLINE# def handleSignedNACKResponse( self , result , node , challenge ) : #NEWLINE# #INDENT# nodeIdHex = node . id . encode ( 'hex' ) . upper ( ) #NEWLINE# cert_stored = self . searchForCertificate ( nodeIdHex ) #NEWLINE# if ( cert_stored == None ) : #NEWLINE# #INDENT# logger ( self . sourceNode , 'Certificate for sender of NACK: {} not present in store' . format ( node ) ) #NEWLINE# #UNINDENT# if ( 'NACK' in result [ 1 ] ) : #NEWLINE# #INDENT# logger ( self . sourceNode , 'NACK in Value response' ) #NEWLINE# try : #NEWLINE# #INDENT# OpenSSL . crypto . verify ( cert_stored , result [ 1 ] [ 'signature' ] , challenge , 'sha256' ) #NEWLINE# self . callPing ( node , self . getOwnCert ( ) ) #NEWLINE# logger ( self . sourceNode , 'Certificate sent!' ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# logger ( node . sourceNode , 'Bad signature for sender of NACK: {}' . format ( node ) ) #NEWLINE# #UNINDENT# #UNINDENT# logger ( self . sourceNode , 'RETNONE: handleSignedNACKResponse' ) #NEWLINE# return None