def do_shutdown(): calls['timer'].cancel() # This should not abort the daemon shutdown try: do_cmd(force=True) except: fail = failure.failure() log.error(fail)
def requestAvatarId(self, credentials): if self.authorizedKeys.has_key(credentials.username): userKey = self.authorizedKeys[credentials.username] if not credentials.blob == base64.decodestring(userKey): raise failure.failure( error.ConchError("I don't recognize that key")) if not credentials.signature: return failure.Failure(error.ValidPublicKey()) pubKey = keys.getPublicKeyObject(data=credentials.blob) if keys.verifySignature(pubKey, credentials.signature, credentials.sigData): return credentials.username else: return failure.Failure(error.ConchError("Incorrect signature")) else: return failure.Failure(error.ConchError("No such user"))
def requestAvatarId(self, credentials): userKeyString = self.authorizedKeys.get(credentials.username) if not userKeyString: return failure.Failure(error.ConchError("No such user")) # Remove the 'ssh-rsa' type before decoding. if credentials.blob != base64.decodestring(userKeyString.split(" ")[1]): raise failure.failure(error.ConchError("I don't recognize that key")) if not credentials.signature: return failure.Failure(error.ValidPublicKey()) userKey = keys.Key.fromString(data=userKeyString) if userKey.verify(credentials.signature, credentials.sigData): return credentials.username else: print "signature check failed" return failure.Failure(error.ConchError("Incorrect signature"))
def requestAvatarId(self, credentials): userKeyString = self.authorizedKeys.get(credentials.username) if not userKeyString: return failure.Failure(error.ConchError("No such user")) # Remove the 'ssh-rsa' type before decoding. if credentials.blob != base64.decodestring( userKeyString.split(" ")[1]): raise failure.failure( error.ConchError("I don't recognize that key")) if not credentials.signature: return failure.Failure(error.ValidPublicKey()) userKey = keys.Key.fromString(data=userKeyString) if userKey.verify(credentials.signature, credentials.sigData): return credentials.username else: print "signature check failed" return failure.Failure(error.ConchError("Incorrect signature"))